project jira-projects / Miscellaneous avatar

jira-projects/MISC#3: System audio (pulseaudio) doesn't work on Bumblebee



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Created: 23-May-22 09:16



Description

I don't currently have functioning audio in any application except Zoom.

Zoom uses my headset, but pulseaudio is in a weird state - the volume control applet shows now devices

Screenshot_20220523_101413

It's been like this for a while, and has survived reboots.

Need to get around to looking at it.


ben@bumblebee:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:    21.04
Codename:   hirsute

ben@bumblebee:~$ dpkg-query --list | grep pulseaudio
ii  gstreamer1.0-pulseaudio:amd64                 1.18.4-1ubuntu1                                                      amd64        GStreamer plugin for PulseAudio (transitional package)
ii  libkf5pulseaudioqt2:amd64                     1.2-2build1                                                          amd64        Pulseaudio bindings library for Qt
ii  pulseaudio                                    1:14.2-1ubuntu1                                                      amd64        PulseAudio sound server
ii  pulseaudio-module-bluetooth                   1:14.2-1ubuntu1                                                      amd64        Bluetooth module for PulseAudio sound server
ii  pulseaudio-module-gsettings                   1:14.2-1ubuntu1                                                      amd64        GSettings module for PulseAudio sound server
ii  pulseaudio-utils                              1:14.2-1ubuntu1                                                      amd64        Command line tools for the PulseAudio sound server


Toggle State Changes

Activity


assigned to @btasker

moved from LAN#49

assigned to @btasker

I've had issues with pulseaudio in the past, it's possible that I broke something dealing with those

  • MISC-49: Seinnheiser HD 450BT Bluetooth audio issues on Linux
  • MISC-50: PulseAudio can't see my laptop's built-in speakers

Looks like pulse isn't currently running

ben@bumblebee:~$ ps aux | grep pulse
ben       172647  0.0  0.0   8996   912 pts/1    S+   10:16   0:00 grep --color=auto pulse

systemctl says

ben@bumblebee:~$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-05-19 16:10:25 BST; 3 days ago
TriggeredBy: ● pulseaudio.socket
    Process: 1955 ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal (code=exited, status=1/FAILURE)
   Main PID: 1955 (code=exited, status=1/FAILURE)

May 19 16:10:25 bumblebee systemd[1432]: pulseaudio.service: Scheduled restart job, restart counter is at 5.
May 19 16:10:25 bumblebee systemd[1432]: Stopped Sound Service.
May 19 16:10:25 bumblebee systemd[1432]: pulseaudio.service: Start request repeated too quickly.
May 19 16:10:25 bumblebee systemd[1432]: pulseaudio.service: Failed with result 'exit-code'.
May 19 16:10:25 bumblebee systemd[1432]: Failed to start Sound Service.

Starting it works fine

ben@bumblebee:~$ systemctl --user start pulseaudio

Need to go look in the logs to see why it failed initially then

Found it:

May 19 16:10:24 bumblebee pulseaudio[1487]: Failed to create secure directory (/home/ben/.config/pulse): No such file or directory
May 19 16:10:24 bumblebee systemd[1432]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
May 19 16:10:24 bumblebee systemd[1432]: pulseaudio.service: Failed with result 'exit-code'.
May 19 16:10:24 bumblebee systemd[1432]: Failed to start Sound Service.
May 19 16:10:24 bumblebee systemd[1432]: Reached target Main User Target.
May 19 16:10:24 bumblebee systemd[1432]: Startup finished in 278ms.

I use a ecryptfs encrypted home directory, so /home/ben/.config/pulse isn't actually going to exist until I'm logged in

There is config in there

ben@bumblebee:~$ ls .config/pulse
1549922ee41d4896b5206a7a42386daf-card-database.tdb  1549922ee41d4896b5206a7a42386daf-default-source      1549922ee41d4896b5206a7a42386daf-runtime             cookie
1549922ee41d4896b5206a7a42386daf-default-sink       1549922ee41d4896b5206a7a42386daf-device-volumes.tdb  1549922ee41d4896b5206a7a42386daf-stream-volumes.tdb

Just as a side note, it looks like pipewire is running too? (I noticed references to it in the journal whilst looking for log lines).

ben@bumblebee:~$ ps aux | grep pipewir
ben         1484  0.0  0.0  91084  3232 ?        Ssl  May19   0:00 /usr/bin/pipewire
ben         1485  0.0  0.0  83004  3264 ?        Ssl  May19   0:00 /usr/bin/pipewire-media-session
ben       173744  0.0  0.0   9128   908 pts/1    S+   10:34   0:00 grep --color=auto pipewir

I thought pipewire was supposed to replace pulseaudio.... it's not very happy either though.

Question is, do I figure out how to fix pulseaudio or try and switch to pipewire?

It looks like Ubuntu's going to switch to using pipewire by default later this year. On the other hand all the applets/utilities in 21.04 are geared towards pulse.

changed the description

Given I need this working in a hurry, I guess switching to pipewire isn't currently an option.

It doesn't look like pulseaudio has an option to tell it to leave the user-config directory alone, so there are effectively 2 options

  • A nasty hack
  • A really nasty hack

The first is to set up some kind of late-running service that'll restart pulseaudio once I'm logged in.

The second is to move ~/config/pulse to elsewhere on the filesystem and then symlink it back, with a second symlink in place when my encrypted home isn't mounted.

It looks like this is an issue for people with NFS home directories too. PA really is just a big pile of poo.

Things have gotten busy, so going for a quick/easy solution

cat << EOM > ~/.config/autostart-scripts/pulseaudio_fix.desktop
#!/bin/bash
systemctl --user restart pulseaudio


EOM

chmod +x ~/.config/autostart-scripts/pulseaudio_fix.desktop

Will need to reboot later and see how we get on.

changed title from System audio doesn't work on Bumblebee to System audio {+(pulseaudio) +}doesn't work on Bumblebee

Rebooted, and worked