adding audio support for vnc connections

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

adding audio support for vnc connections

robertkwild
hi all,

i have established a connection to my vnc machine but i have no audio from
it when listening to youtube etc

i have install pulseaudio-libs-devel on my centos 7 server

any ideas?

cheers,
rob



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

mjumper
Administrator
On Thu, Jun 14, 2018, 12:47 robertkwild <[hidden email]> wrote:
hi all,

i have established a connection to my vnc machine but i have no audio from
it when listening to youtube etc

i have install pulseaudio-libs-devel on my centos 7 server

any ideas?

Audio is not provided by VNC natively. Guacamole supports audio for VNC using a secondary connection to PulseAudio, which you will need to configure for the VNC connection in question:


Just having the support built into guacamole-server isn't sufficient; you need to configure the machine running the VNC server to additionally accept network PulseAudio connections, and configure the Guacamole connection to use both VNC and PulseAudio.

- Mike

Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
thanks for that

i have added this line to "/etc/pulse/default.pa" -

load-module module-native-protocol-tcp auth-ip-acl=0.0.0.0/0
auth-anonymous=1

i have made it all 0's as i want all networks to access it, otherwise how
would i go about adding two networks?

when i restart pulseaudio on the guacamole server i get this -

W: [pulseaudio] main.c: This program is not intended to be run as root
(unless --system is specified).

i have also installed pulseaudio on my vnc server that i want guacamole to
connect to and on that connection computer on the guacamole server i have

enabled audio and
in the audio server name i have put in the hostname of the vnc server that i
want guacamole to connect to




--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

vnick
On Thu, Jun 14, 2018 at 4:49 PM robertkwild <[hidden email]> wrote:
thanks for that

i have added this line to "/etc/pulse/default.pa" -

load-module module-native-protocol-tcp auth-ip-acl=0.0.0.0/0
auth-anonymous=1

i have made it all 0's as i want all networks to access it, otherwise how
would i go about adding two networks?

when i restart pulseaudio on the guacamole server i get this -

W: [pulseaudio] main.c: This program is not intended to be run as root
(unless --system is specified).

i have also installed pulseaudio on my vnc server that i want guacamole to
connect to and on that connection computer on the guacamole server i have


Okay, a couple of points of clarification, here.  First, the changes made to the default.pa file and (re)starting the PulseAudio service only need to be done on the *VNC Server*, not on the system running guacd (unless those two happen to be the same system, which I gather is *not* the case in your setup).  So, make those changes on the VNC server and restart the PulseAudio service, there.  Also, as far as the 0.0.0.0/0, you don't need that to allow all Guacamole clients to have audio - you only need to allow the system that's running guacd in that ACL.  Basically, PulseAudio needs to be accessible by the system running guacd, and then the Guacamole protocol (between Tomcat and guacd) takes care of encapsulating all of the audio and video for a connection - so guacd converts from PulseAudio to Guacamole and back, sending it over to the Guacamole Client, which then sends it to your browser.

On the system running guacd, you really only need to make sure that guacd is compiled with PulseAudio support - so, depending on your Linux distribution, make sure the pulseaudio development packages are installed, and then ./configure guacd and make sure it specifies that PulseAudio is enabled, compile, and (re)install.
 
Hope this helps.

-Nick
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
no the vnc server and guacamole server are different machines

vnc server ip is 172.16.9.27

guacamole server ip is 172.16.9.16

so do i enter this on the vnc server with pulseaudio installed in the
"/etc/pulse/default.pa" -

load-module module-native-protocol-tcp auth-ip-acl=172.16.9.16/21
auth-anonymous=1

or can i just put this in -

load-module module-native-protocol-tcp auth-anonymous=1



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

vnick
On Thu, Jun 14, 2018 at 6:18 PM robertkwild <[hidden email]> wrote:
no the vnc server and guacamole server are different machines

vnc server ip is 172.16.9.27

guacamole server ip is 172.16.9.16

so do i enter this on the vnc server with pulseaudio installed in the
"/etc/pulse/default.pa" -

load-module module-native-protocol-tcp auth-ip-acl=172.16.9.16/21
auth-anonymous=1



Since it's an ACL, you probably want to put in:

load-module module-native-protocol-tpc auth-ip-acl=172.16.9.16/32 auth-anonymous=1

Depending on how pulse interprets the /21, you might be opening it up to the entire 172.16.8.0/21 subnet, rather than just the guacd host.  If you use the /32 it'll be limited to only the guacd host, which, with anonymous authentication, is probably what you want.
 
or can i just put this in -

load-module module-native-protocol-tcp auth-anonymous=1


I'm not familiar enough with Pulse Audio's behavior to know if this would be completely locked down (no access if missing the auth-ip-acl) or allow everything (all access if missing auth-ip-acl).  But, either way, probably not what you want.

-Nick 
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
Nice

So i have added the acl rule on the vnc server ie 172.16.8.0/21 as thats my
whole subnet as i dont want to lock it down

I do pulseaudio -k and it returns to the command line so i know its
succesfully restarted the daemon

Then i do the netstat command and i see its listening

Now on guacamole i enable audio plus the audio server i put the vnc server

But it still doesnt work as i hear no audio



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
mmm... think i know why its not working

as the vnc server is on a VM with no sound card im pretty sure this is why?



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

vnick
On Thu, Jun 14, 2018 at 18:56 robertkwild <[hidden email]> wrote:
mmm... think i know why its not working

as the vnc server is on a VM with no sound card im pretty sure this is why?


No, you shouldn't need a sound card - the whole point of doing it over the network is that the hardware need not be present in the server, it's using what is available on the system with the browser.

Does the VNC server have a firewall running - iptables/firewalld?  This could be blocking things, as well.

-Nick


Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
ok i have succesfully done it via this command instead cutting out the acl
network stuff -

load-module module-native-protocol-tcp auth-anonymous=1

now on the guacamole server when i click the connection it works

but when i connect via vnc client ie realvnc it doesnt work so how can i get
the vnc client to get the audio

Nick, thanks so much for all your help, really appreciate it mate!



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

vnick
On Thu, Jun 14, 2018 at 8:55 PM robertkwild <[hidden email]> wrote:
ok i have succesfully done it via this command instead cutting out the acl
network stuff -

load-module module-native-protocol-tcp auth-anonymous=1

now on the guacamole server when i click the connection it works

but when i connect via vnc client ie realvnc it doesnt work so how can i get
the vnc client to get the audio


I kind of doubt it'll work with just the straight VNC Client - the VNC client would have to support audio, itself, and I don't know that any of them do.  In Guacamole, this is all handled by guacd - guacd makes the VNC connection, and then it makes a separate PulseAudio connection, and encapsulates all of it in the Guacamole protocol stream.  So, as soon as the VNC + PulseAudio connection hits guacd, it's no longer VNC + PulseAudio, it's Guacamole.  The VNC client would have to do exactly the same thing that guacd is doing - that is, it would need to make both the VNC connection *and* the PulseAudio connection in order to provide the audio.  Perhaps one of the VNC clients does that, I'm not sure - I haven't used them in a long time - but I kind of doubt it.

The one option you do have with something like VNCViewer is to run the PulseAudio system as a client on the same system that's running the VNCViewer software, and make the network connection to the VNCServer's PulseAudio port.  Guacamole abstracts these details from you, for the most part - that is, with Guacamole, you're not required to manually establish separate connections for both VNC and Pulse - guacd does it all for you.  If you're using VNCViewer, though, you'll have to do it manually.

-Nick 
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
Makes perfect sense

How would i go about installing pulseaudio on the end users machine so they
can have audio while they are using vnc viewer to log in there vurtual
machines



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild
hi,

now i have pulseaudio working on a vnc users connection

how do i add audio for the other vnc connection users, so they all have
audio

atm it just works for one vnc user and not the others

is this because pulseaudio only uses one port number?



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

vnick
On Sat, Jun 16, 2018 at 7:30 PM robertkwild <[hidden email]> wrote:
hi,

now i have pulseaudio working on a vnc users connection

how do i add audio for the other vnc connection users, so they all have
audio

atm it just works for one vnc user and not the others

is this because pulseaudio only uses one port number?


This gets a little beyond my knowledge of PulseAudio - I think you're probably on the right track in thinking that the single port number is the issue - not necessarily the single port number, but the single instance of PulseAudio on the VNC server, and the fact that PulseAudio is not "coupled" in any way to the VNC session, means that it's hard (impossible) for PulseAudio to know which user session should be associated with which PulseAudio client.

There are two ways to work around this - one is to have a single user (VNC Session, Pulse Audio Session) per VNC server so that you just avoid the problem - you can use load balancing on the front-end to make it easy for folks to connect, and the load balancing, either through Guacamole (Connection Groups), HAProxy, or somethings like Amazon's Elastic Load Balancer (ELB) would allow you to send the VNC and Pulse connections to the same system.  With 1 VNC/Pulse session per system, you don't have to worry about it.

The other option would be to run PulseAudio as a user process rather than a system process, and start it up with the VNC session.  The theory would be that you could put each user on a different PulseAudio port and have PulseAudio start up as a user process when VNC launches their session.  In reality, I don't know how well this would work - for one thing, you'd either have to delay the startup on the PulseAudio client on the client-side until PulseAudio were running on the server side (doable with VNCViewer + PulseAudio, but harder with Guacamole), and, for another thing, you'd have to have some way to dynamically calculate and allocate PulseAudio ports, and communicate that over to the client such that either the user knows which port to connect to or the client is able to determine it automatically.  This wouldn't really work at all with Guacamole, it's really only doable in a VNCViewer + PulseAudio setup, and, even then, it would take a little doing to make it happen.

-Nick 
Reply | Threaded
Open this post in threaded view
|

Re: adding audio support for vnc connections

robertkwild