pascp
Posts: 7
Joined: Fri Apr 02, 2021 7:15 pm

VNC no sound through speakers

Mon Apr 05, 2021 4:42 pm

Hello,

I have a headless raspberry setup and I have connected a USB speaker and a microphone in order to run mycroft.
The problem is that I have no sound through the speakers.

Alsamixer is recognizing the speaker when I press the F6 (sound card menu). But the speaker icon on the tray I get a message saying "No audio device found" when I press it with a right-click. The left-click gives me a volume control and shows 100% volume.

PulseAudio gives me the following error when I run the command "pulseaudio"
W: [pulseaudio] alsa-util.c: Unable to load mixer: Invalid argument
W: [pulseaudio] alsa-util.c: Unable to load mixer: Invalid argument
E: [pulseaudio] socket-server.c: bind(): Address already in use
E: [pulseaudio] module.c: Failed to load module "module-native-protocol-unix" (argument: ""): initialization failed.
E: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.
I have connected a screen and the sound works fine when I log in from a "real" desktop.

Can you please help! Thank you

terribleted
Posts: 234
Joined: Tue Oct 06, 2020 8:07 pm

Re: VNC no sound through speakers

Mon Apr 05, 2021 10:38 pm

try using sudo raspi-config from a terminal
then:

system
audio
- to headphone jack
i had a Trash-80 model 1 (circa 1980). upgrading from 4k to 16k of RAM, i thought "i'll never use this much RAM".
Now i have a computer with a million times that much memory. And i keep running out of it.
Not the computer....ME.

cleverca22
Posts: 3605
Joined: Sat Aug 18, 2012 2:33 pm

Re: VNC no sound through speakers

Tue Apr 06, 2021 5:52 am

it sounds like there is a 2nd pulseaudio already running

depending on which vnc server your using, it may help to "sudo systemctl stop lightdm" first

pascp
Posts: 7
Joined: Fri Apr 02, 2021 7:15 pm

Re: VNC no sound through speakers

Fri Apr 09, 2021 9:17 pm

Thank you both for your suggestions.

I tried configuring it through raspi-config. The USB device was already selected.

I am using RealVNC. I tried stopping lightdm but there was no change at all. I also disabled the service to no avail.

LTolledo
Posts: 5154
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: VNC no sound through speakers

Fri Apr 09, 2021 10:15 pm

where are the speakers connected?
where do you want to audio to output?
a. VNC server
b. VNC client
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

pascp
Posts: 7
Joined: Fri Apr 02, 2021 7:15 pm

Re: VNC no sound through speakers

Sun Apr 11, 2021 9:08 pm

I have the speakers connected to one of the usb2 ports of the raspberry.
I want the audio to come out from the speaker which is connected to the vnc server(A) when I play a video for example.
I know that vnc does not support audio transfer to the client.

Update:
Interestingly enough if I open a vlc from vnc go to preferences -> audio -> output module -> alsa audio output & device: the usb device the sound comes from the speaker. But this is not happening with all the rest e.g. browser
Last edited by pascp on Sun Apr 11, 2021 10:13 pm, edited 1 time in total.

LTolledo
Posts: 5154
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: VNC no sound through speakers

Sun Apr 11, 2021 9:50 pm

well, I just tried it a week ago
server is RPi3B+ with RPiOS32
client is RPi4B-4GB with RPiOS32

accessed VNC server from VNC client,
played a mkv file (from a locally mounted NAS share) using VLC (on VNC server)
audio came out from speakers of VNC server (has speakers connected via I2S DAC and amp)
video seen on both VNC server and VNC client...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

pascp
Posts: 7
Joined: Fri Apr 02, 2021 7:15 pm

Re: VNC no sound through speakers

Sun Apr 11, 2021 10:16 pm

I added an update to my previous post. I believe the problem comes from PulseAudio but I am not sure. In an older setup, it was working for me too. but this time I have everything set up perfectly apart from that. How can we see where this problem comes from to know what to search for and what to change?

LTolledo
Posts: 5154
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: VNC no sound through speakers

Mon Apr 12, 2021 9:11 am

I have pulse audio on both server and client...

the sound just needs to come out from the VNC server's speakers, right?
did you check that the speakers on the VNC server side is actually working if you connect a monitor, keyboard and mouse to the VNC server itself?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

pascp
Posts: 7
Joined: Fri Apr 02, 2021 7:15 pm

Re: VNC no sound through speakers

Mon Apr 12, 2021 6:23 pm

yes of course! I mention it in my initial post. Furthermore, I can have sound from the server from vlc if I set it up as I mention in my previous reply (update section)

Return to “Troubleshooting”