Links2004 / arduinoVNC

a VNC Client for Arduino based on rfbproto
GNU General Public License v2.0
303 stars 58 forks source link

Is sound supported? #21

Closed NonaSuomy closed 3 years ago

NonaSuomy commented 3 years ago

Is audio streaming supported by this?

Thank you.

Links2004 commented 3 years ago

no, the VNC protocol does not support sound.

NonaSuomy commented 3 years ago

https://www.realvnc.com/en/connect/audio/

https://help.realvnc.com/hc/en-us/articles/360002504358-Audio-FAQ#how-does-the-audio-feature-work--0-9

https://guacamole.apache.org/doc/gug/configuring-guacamole.html#vnc

Audio support (via PulseAudio)

VNC does not provide its own support for audio, but Guacamole's VNC support can obtain audio through a secondary network connection to a PulseAudio server running on the same machine as the VNC server.

Most Linux systems provide audio through a service called PulseAudio. This service is capable of communicating over the network, and if PulseAudio is configured to allow TCP connections, Guacamole can connect to your PulseAudio server and combine its audio with the graphics coming over VNC.

Configuring PulseAudio for network connections requires an additional line within the PulseAudio configuration file, usually /etc/pulse/default.pa:

load-module module-native-protocol-tcp auth-ip-acl=192.168.1.0/24 auth-anonymous=1 This loads the TCP module for PulseAudio, configuring it to accept connections without authentication and only from the 192.168.1.0/24 subnet. You will want to replace this value with the subnet or IP address from which guacd will be connecting. It is possible to allow connections from absolutely anywhere, but beware that you should only do so if the nature of your network prevents unauthorized access:

load-module module-native-protocol-tcp auth-anonymous=1 In either case, the auth-anonymous=1 parameter is strictly required. Guacamole does not currently support the cookie-based authentication used by PulseAudio for non-anonymous connections. If this parameter is omitted, Guacamole will not be able to connect to PulseAudio.

Once the PulseAudio configuration file has been modified appropriately, restart the PulseAudio service. PulseAudio should then begin listening on port 4713 (the default PulseAudio port) for incoming TCP connections. You can verify this using a utility like netstat:

$ netstat -ln | grep 4713 tcp 0 0 0.0.0.0:4713 0.0.0.0: LISTEN tcp6 0 0 :::4713 ::: LISTEN $ The following parameters are available for configuring the audio support for VNC:

enable-audio | If set to "true", audio support will be enabled, and a second connection for PulseAudio will be made in addition to the VNC connection. By default, audio support within VNC is disabled.

audio-servername | The name of the PulseAudio server to connect to. This will be the hostname of the computer providing audio for your connection via PulseAudio, most likely the same as the value given for the hostnameparameter.If this parameter is omitted, the default PulseAudio device will be used, which will be the PulseAudio server running on the same machine as guacd.

Links2004 commented 3 years ago

PulseAudio is independent of the VNC protocol. its basically a seconde connection with its own protocol.

in the realvnc cases its a proprietary change they made behind a pay wall, so hard to say how they do it but its not part of the RFC for VNC for sure.

more details about VNC and the RFB protocol can be found here: https://github.com/Links2004/arduinoVNC/tree/master/docu https://tools.ietf.org/html/rfc6143

if you want to stream via PulseAudio you need a second lib that handles this. but the ESP8266 more then likely has to less CPU power to handle VNC and audio at the same time. with two ESP8266 one for VNC and one for PulseAudio this may is possible. Alternative experiment with the ESP32 and its two CPU cores.