Pulseaudio acting differently on different VNC sessions

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Pulseaudio acting differently on different VNC sessions

Post by rktr »

Hi,

I have an old Macbook4,1 with Linuxmint 18.3 (sylvia) installed and updated to the most recent packages through update manager.
uname -a generates:
Linux macbook 4.15.0-101-generic #102~16.04.1-Ubuntu SMP Mon May 11 11:38:16 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

This macbook is a homeassistant server, and I usually login with a VNC client from my MacOS desktop.
Sound doesn't need to stream to my desktop, I only want to use the internal speaker and internal mic on the macbook,
to be used for audio surveillance.

The thing is that all was working, but I believe at some point on the past updates, sound got weird.

* I have x11vnc server running to connect VNC to the console screen, display:0 via port 5900
* I have another vnc4server running which will accept VNC sessions as display:1 via port 5901

Everything is working, both sound output and input through snd-hda-intel(ALC889a), in the vnc4server session above,
but not working at all, seeing dummy output, dummy input in pavucontrol, when I connect to a x11vnc session.

What is strange to me is that, even I login locally via the macbook screen, I get the same result as the x11vnc session above.
So sound only works if I control my macbook via vnc4server session.
ssh to macbook will result in a same problem as the x11vnc case above.

Is this the way it should be?
So it seems like vnc4server session is grabbing all the control of pulseaudio,
leaving other local, ssh, vnc sessions not to use the card.

In the x11vnc session, is see,

lsmod | grep snd_hda_intel
snd_hda_intel 45056 6
snd_hda_codec 126976 3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core 81920 4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_pcm 98304 5 snd_hda_intel,snd_hda_codec,snd_hda_core
snd 81920 20 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi

lspci -nnk | grep -A2 Audio
00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03)
Subsystem: Apple Inc. 82801H (ICH8 Family) HD Audio Controller [106b:00a1]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

pacmd list-cards
0 card(s) available.

pacmd list-sinks
1 sink(s) available.
* index: 0
name: <auto_null>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: IDLE
suspend cause:
priority: 1000
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 350.06 ms
max request: 344 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 2000.00 ms; range is 0.50 .. 2000.00 ms
module: 10
properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889A Analog [ALC889A Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889A Digital [ALC889A Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0


So alsa looks totally fine, but pulseaudio not in the x11vnc session.
Booting with Sylvia LiveCD, sound works.

Looking for any help to this problem.

Thank you in advance.

rktr

rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by rktr »

Anyone please?

The problem is, sound works on output and input only when I control the macbook through vnc4server session,
where I get dummy output if I control it on the macbook screen.
Is it a vnc problem, or a pulseaudio setup problem, I feel the cause maybe the latter.
Checked almost all the similar cases I found through google, but I am lost from the way to fix it.

Thank you.

User avatar
MrEen
Level 19
Level 19
Posts: 9630
Joined: Mon Jun 12, 2017 8:39 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by MrEen »

Hi rktr,

I had hoped someone else might be able to assist as I have no clue on VNC-related issues.

Some things you could try:

1. Delete the files in /home/YourUserName/.config/pulse then run pulseaudio -k in the terminal.

2. Try running sudo alsa force-reload possibly followed by pulseaudio -k

3. If the pulseaudio -k attempts produce an error, try pulseaudio --start

If all that fails, run this command when logged in to the troublesome situation and paste the output:

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999

rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by rktr »

Mr. Een,

Thank you very much for your reply.
All the commands work, but pulseaudio did not.

So I have pasted two termbins as,
Not working vnc session including the console: https://termbin.com/fhfw
Working vnc session: https://termbin.com/e5gi

Thank you in advance.

rktr

User avatar
MrEen
Level 19
Level 19
Posts: 9630
Joined: Mon Jun 12, 2017 8:39 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by MrEen »

Okay, just from looking at the top of each output, I can see pulseaudio is being run by root in both cases. That could be part of the issue. Normal use of pulseaudio is as a user process.

I can't really say why one is working and one is not, because in both cases pulseaudio is running.

EDIT: In the non working case, the card didn't get detected, leaving you with a Dummy Output. That doesn't really help much I don't think.

Just a guess, but try sudo killall pulseaudio in the terminal. The default is for the daemon to automatically restart itself, and if you're logged in as rktr when running that, hopefully the daemon will restart under your user. Again, if it doesn't restart automatically, use pulseaudio --start (as rktr, not root) and hopefully the issue will be gone.

User avatar
MrEen
Level 19
Level 19
Posts: 9630
Joined: Mon Jun 12, 2017 8:39 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by MrEen »

An additional note; the non working instance has this, which is normally what we want to see:

Code: Select all

Server String: /run/user/1000/pulse/native
The working version has this:

Code: Select all

Server String: unix:/tmp/pulse-PKdhtXMmr18n/native

rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by rktr »

MrEen,

First things first, I am trying to kill pulseaudio.
With the command you have suggested, and looking for clues elsewhere to stop pulseaudio from autospawning, or whatever I do,
the root process keep coming out as,

root 5670 0.0 0.0 204 4 ? S 09:19 0:00 s6-supervise pulseaudio
root 5680 0.2 0.2 96548 9632 ? S<sl 09:19 0:00 pulseaudio --system -vvv --disallow-exit --exit-idle-time=-1 --disable-shm

Where in the conf or how by systemctl can I stop this thing?

client.conf in /etc/pulse obviously set as, autospawn = no.
I don't have client.conf in user directory.

I tried,
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
systemctl --user disable pulseaudio.socket
systemctl --user disable pulseaudio.service
systemctl --user mask pulseaudio.socket
systemctl --user mask pulseaudio.service

deleting ~/.config/pulse directory and rebooted,
but doesn't stop the root process at all.

kill -9 the above 5670, 5680, will just result in autospawning into a different process number.

rktr

User avatar
MrEen
Level 19
Level 19
Posts: 9630
Joined: Mon Jun 12, 2017 8:39 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by MrEen »

Does the system itself boot up as root user by default? I could see that causing this.

Having autospawn=no already indicates something else is starting up pulse. Some script somewhere. I saw nothing in your outputs that gave any hints.

Do you have a .pulse folder in your home directory, or worse, in roots home directory?

Also, let's see the output for ls -la ~/.config/pulse and ls -la /.config/pulse. The latter will probably error with no such file or directory. At least I hope it will.

rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by rktr »

Hi MrEen

So long story short of my tackle to this problem for a whole day today, I think I have found the solution, but mission half completed.

I've finally got rid of x11vnc and vnc4server completely, and changed my remote login method to xrdp.
So now, a login via macbook display, via ssh, via xrdp, sound is working in every individual session, and sound works
in all the sessions at the same time. No dummy outputs and inputs.

xrdp will not let me see the actual macbook screen, so sources pointed me to install tigervnc.
With x11vnc, I was able to login from a remote vnc session and see the actual screen, but still cannot find the way with tiger.
As far I can get is that, I need to login via macbook display physically first, and then with the script I made
to launch x0vncserver(included in tigernvc package a vncserver specifically for display:0) after xfce4 startup,
I will be able to connect a vnc session to display:0.
I need to learn more about systemd scripting technique.

Mr. Een, thank you very much for supporting me. I have taken your time to fix a non-sound issue, which turned out to be
a vnc issue.
Your expertise in sound made me to think that vnc could be the cause, and was able to get sound back.

Thank you,

rktr

User avatar
MrEen
Level 19
Level 19
Posts: 9630
Joined: Mon Jun 12, 2017 8:39 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by MrEen »

You're quite welcome.

I have a complete lack of understanding of vnc/rdp/ssh/etc that makes it tricky to help. I'm glad you were able to get things where they are at least. You might want to consider a new topic for the tiger issue, as I know I've seen topics on it before, so someone may know what you might need.

Good luck and stay safe! :D

rktr
Level 1
Level 1
Posts: 11
Joined: Mon May 18, 2020 8:26 pm

Re: Pulseaudio acting differently on different VNC sessions

Post by rktr »

Appeared to be good but half completed was true..
I have one issue remaining now, and this probably is not related to vnc, so will raise it in new topic.

Post Reply

Return to “Sound, Multimedia, & Codecs”