[solved]Sound only on one User

I have two User, but only on one User I have Sound.
Both Users are in Group audio.

What can I do?

with regards
Ch. Hanisch

Fix it.

1 Like

How can I do it?

it seems to be a tricky issue due to a new config file.
As I understand the things, it is related to the pulseaudio service and the the module-device-manager.
As a first workaround, here is what I did (tested in vbox) :

  • comment out the line
    load-module module-device-manager
    in /etc/pulse/default.pa to get:

.ifexists module-device-manager.so
#load-module module-device-manager

because the second connected user cannot launched the pulseaudio service as the module refuses to load more than once. See:

systemctl --user status pulseaudio

  • The first connected user gets the sound. The second one still doesn’t because the deamon is launched twice.
    So this command make the sound working again:

sudo killall pulseaudio

Thus, the service pulseaudio is reloaded with only one instance of PA running.
When connecting back as first user, the sound is still available.

As previously said, this is only a workaround and has to be improved. I think, we must also test, in /etc/pulse/default.pa, if the module is already loaded .

After this command I have Sound in both Users.
I have the following File on ~/Schreibtisch/kill-pulseaudio.desktop in the second User:
[Desktop Entry]
Exec=sudo killall pulseaudio

Instead of commenting out the module loading, it’s better to modify the config file as:

.ifexists module-device-manager.so
load-module module-device-manager

But it is still needed to kill the instance belonging the other user and that is not satisfying.

The problem is that when a user logouts from a plamas5 desktop, the pulseaudio instance isn’t killed (*). So, if another instance is launched when another user logins, it cannot get the audio devices, therefore no sound can be played . This happens until one kills all the pulseaudio instances. I don’t know why.
But using this manual command

sudo killall pulseaudio

isn’t very convenient and, fortunately, can be avoid by the users.

I propose this workaround:
create the file ~/.config/plasma-workspace/shutdown/pulseaudio (for example; you can also create the directory if necessary) with this content:

killall pulseaudio

and give it the exec permission.
It will be launched when the user will logout. Only the user’s pulseaudio instance will be killed and that’s exactly what we want.

It is now possible to add this file in /etc/skel/ thus making it available for all new users created with the mcc or in command line with the -m option.

(*): this is not true for the pulseaudio instance launched by sddm which is killed when a user logins.
In addition, I don’t talk about the case where several users are connected at the same time (see the limitations of the configuration where PA runs as system-wide daemon)

That is a good solution. ~/.config/plasma-workspace/shutdown/pulseaudio must be for every User.
This works only in KDE-Plasma.
But under LXQt it don’t work by changing from one User with Sound to other. Why?

with regards
Ch. Hanisch