Broken Audio infrastructure on Kubuntu 17.04

Bug #1684108 reported by Aurelijus Rinkevicius
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
kubuntu-meta (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

As of Kubuntu 17.04, KDE sound infrastructure is broken.
Issue:
    * System Settings -> Audio and Video -> Audio Playback. Reports "PulseAudio Sound Server" as your device of preference.
    * Sound does not work with multiple sound devices (there is a workaround though).

Comments:
    1. Such a problem can occur if one restarts PA or settings are wrong.
    2. Problem persists on both kubuntu-17.04-desktop-amd64.iso (running live) and on an updated system (tried on two different machines with consistent results).
    3. Problem is *not present* with KDE neon (neon-useredition-20170413-1018-amd64.iso)
    4. Problem was *not present* with Kubuntu 16.10

$ lsb_release -rd
Description: Ubuntu 17.04
Release: 17.04

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1684108/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → kubuntu-meta (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kubuntu-meta (Ubuntu):
status: New → Confirmed
Revision history for this message
zyrorl (zyrorl) wrote :

I can confirm that this very annoying bug is affecting me, as I now have to constantly enable/disable audio sources to switch audio devices rather than use phonon's priority list.

Revision history for this message
Stefano Pettini (ragazzojp) wrote :

I can confirm this bug as well. After a brief investigation, it looks like PulseAudio is started properly, but Phonom audio routing doesn't use it fully. Many pages mention something about "starting pulseaudio and routing KDE to is".

It looks like there are two scripts to start pulseaudio:

start-pulseaudio-x11
start-pulseaudio-kde

The second one should also enable the proper audio routing, so devices show up properly instead of having one single entry for "PulseAudio Sound Server".

Unfortunately the script start-pulseaudio-kde is not part of the system and I can't find it anywhere. I can only find start-pulseaudio-x11 in my system.

Revision history for this message
Aurelijus Rinkevicius (odysei) wrote :

Interestingly, I cannot find start-pulseaudio-kde in neither Kubuntu 16.10, nor KDE Neon.

Revision history for this message
Stefano Pettini (ragazzojp) wrote :

Right, the bug is probably not because of that missing script, but that script may provide some hints on the kind of setting or audio routing feature that is not properly enabled.

I remember doing some tests about bluetooth devices in the past on 15.10: the system was working properly, but every time I restarted pulseaudio (so basically when I restarted it, instead of when it was started by the system), the integration didn't work properly and I saw in the audio device list "PulseAudio Sound Server". I had to reboot to fix it.

So we have two hints in the same direction: after starting pulseaudio, something must be done to enable proper integration with KDE. Something that doesn't happen in Kubuntu 17.04.

Revision history for this message
zyrorl (zyrorl) wrote :

Any updates on this? this is a pretty frustrating issue as it doesn't allow us to properly prioritise sound sources in KDE with multiple sound cards.

Revision history for this message
Aurelijus Rinkevicius (odysei) wrote :

It looks like that we are dead in the water on this. Soon it will be a time to move to a better maintained distro.

Revision history for this message
José Tomás Atria (jtatria) wrote :

This bug is caused by module-device-manager not being loaded when pulseaudio starts. This command fixes the issue and restores pulseaudio KDE integration:

$ pactl load-module module-device-manager "do_routing=1"

This command is included in the pulseaudio startup script for X11, /usr/bin/start-pulseaudio-x11, which is included as part of the XDG autostart scripts via a reference in /etc/xdg/autostart/pulseaudio.desktop. As far as I understand the FreeDesktop standard, .desktop files in the /etc/xdg/autostart folder should be executed by the desktop manager on startup, which in the case of KDE is controlled by the script located at /usr/bin/startkde, but the version shipped by Kubuntu does not seem to make any reference to /etc/xdg/autostart files.

I have tested that /usr/bin/start-pulseaudio-x11 is not being ran on startup. I have no idea how KDE is starting pulseaudio, and since pulseaudio is part of the poetteringverse, determining its execution model or startup sequence is beyond the comprehension of mere mortals; but lack of integration between pulseaudio and phonon (the audio system settings module) is due to that module not being loaded, due to that script not being ran, due to, I assume, KDE not executing XDG autostart desktop files.

Revision history for this message
Petr Sedlacek (piit79) wrote :

José, thanks for pointing out a workaround!

I haven't had time to confirm yet but I may have found the reason the script /usr/bin/start-pulseaudio-x11 wasn't running correctly on my system. When I tried executing it manually I got the error message "Failed to open sound file." Looking at the script it contains the line

/usr/bin/pactl upload-sample /usr/share/sounds/ubuntu/stereo/bell.ogg bell.ogg > /dev/null

However, the file /usr/share/sounds/ubuntu/stereo/bell.ogg wasn't present on my system. Since the script is run with sh -e it will stop on the first failure and therefore not load module-device-manager. I found out that the sound file is part of the package ubuntu-sounds - once installed, the script runs correctly.

José, could you please check if you have the package ubuntu-sounds installed? The description says "Ubuntu's GNOME audio theme" so no wonder it's not installed by default on Kubuntu. This therefore seems to be a packaging bug in pulseaudio - the package should depend on ubuntu-sounds.

Revision history for this message
Petr Sedlacek (piit79) wrote :

I just reported a bug in pulseaudio related to the above - could you please check if that's the case for you as well and confirm that the bug affects you too? Thanks!

Revision history for this message
Petr Sedlacek (piit79) wrote :

Apologies for another message and notification... forgot the link to the bug:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1703334

Revision history for this message
José Tomás Atria (jtatria) wrote :

Hi Petr, thanks for looking into this. I did not have ubuntu-sounds installed, and I can confirm that installing that package fixes the issue in my system.

I'll add a comment to the new bug with this info.

Revision history for this message
Aurelijus Rinkevicius (odysei) wrote :

Awesome guys!

Jose: thanks for the pactl command, I was looking for this one since ages. Once in a while I crash/restart pulseaudio and KDE audio gets stuck.

Petr: the solution did work! Now we're just missing a pulseaudio fix in the repos.

Revision history for this message
Proc (proc) wrote :

Similar problem here.
My headphones are always "unplugged" according to pavucontrol.
I can switch around my alsamixer settings all the way I want, no audio from headphones.
This was working in 14.04 LTS

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.