rhythmbox ignores pulseaudio default sink and outputs sound on random device

Bug #1883902 reported by Saroumane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rhythmbox (Ubuntu)
New
Low
Unassigned

Bug Description

Ubuntu 20.04 LTS

rhythmbox:
  Installed: 3.4.4-1ubuntu2
  Candidate: 3.4.4-1ubuntu2

What I expect to happen :

When I launch rhythmbox, I expect it to use the default pulseaudio sink. (Which can be defined in pavucontrol or with set-default-sink in /etc/pulse/default.pa ).

What happened instead :

when I launch rhythmbox, it outputs sound to a random device (in my case : either a RAOP sink in my living-room, or another RAOP sink in my kitchen. Never my local soundcard)

If I correct the output sink (with pavucontrol or pactl) the problem is fixed... until I quit and restart rhythmbox.

I did not have this problem with Ubuntu 19.10 / Rhythmbox 3.4.3-2ubuntu1

In 20.04 :
-> Spotify (snap store version 1.1.26.501.gbe11e53b-15) has the same problem
-> others apps I tested (Firefox, Chromium, VLC, Totem) do not have the problem

I already tried to delete $HOME/.config/pulse with no improvement.

Saroumane (saroumane)
description: updated
Saroumane (saroumane)
summary: - Rhythmnox ignores pulseaudio default sink and outputs sound on random
+ rhythmbox ignores pulseaudio default sink and outputs sound on random
device
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, is that specific to rhythmbox or do you get the same issue in e.g totem?

Changed in rhythmbox (Ubuntu):
status: New → Incomplete
Revision history for this message
Saroumane (saroumane) wrote :

"In 20.04 :
-> Spotify (snap store version 1.1.26.501.gbe11e53b-15) has the same problem
-> others apps I tested (Firefox, Chromium, VLC, Totem) do not have the problem"

In addition, I created a brand new user on my system to reproduce the bug, but he could not see RAOP sinks. So I can't see if the bug is happening.
Regarding this, all is greyed out in "paprefs" for the new user and my main user (see screenshot attached). The only difference is that "Make discoverable Apple AirTunes sound devices available locally" is pre-ticked for my main user, and pre-"unticked" for the new user. Maybe I should fill another bug report about this.

Revision history for this message
crvi (crvi) wrote :

> Regarding this, all is greyed out in "paprefs" for the new user

See https://gitlab.freedesktop.org/pulseaudio/paprefs/-/issues/7 for workaround.

Revision history for this message
crvi (crvi) wrote :

Rhythmbox uses ```autoaudiosink``` gstreamer plugin for outputting audio, which means Rhythmbox outsources the audio sink selection process to gstreamer. So, test your bug with the following command first.

```
$ gst-launch-1.0 -v -m audiotestsrc ! audioconvert ! audioresample ! autoaudiosink
```

This plays a audio tone on the audio sink "automatically" selected by gstreamer ```autoaudiosink``` plugin. If the same random device sink selection happens, the issue could be with ```autoaudiosink``` gstreamer plugin, and not Rhythmbox.

https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/using.html?gi-language=c should help.

Revision history for this message
Saroumane (saroumane) wrote :

Thanks for the help.

The workaround for paprefs did work for me.

Regarding rhythmbox :
I tried the gst-launch command line test a few times : it always outputs sound to my default sink, no problem here.

Revision history for this message
crvi (crvi) wrote :

I tried this with 3 audio sinks ( local audio sink + network host 1 audio sink + network host 2 audio sink ), and I don't see any random sink selection. Rhythmbox always plays in the default selected sink. This is on Ubuntu 20.04 and Debian Unstable.

Can you gather more info ?

Changed in rhythmbox (Ubuntu):
status: Incomplete → New
importance: Undecided → Low
Revision history for this message
Saroumane (saroumane) wrote :

crvi : did you use RAOP sink as networks sinks ? I don't know if it matters, but my 2 networks sinks are both RAOP.

Anyway, I have some more information :

I can totally reproduce the problem with latest Fedora Live USB (Fedora-WS-Live-32-1-6), so it's not OS specific.

I also tried Ubuntu 19.10 on live USB : the problem is not here.
To be specific, in this situation : the 1st time I launch rhythmbox, it ignores my default sink. But with pavucontrol I can remap it to my local sink (my soundcard). Then I quit and relaunch rhythmbox : this time it remembers the last sink used and outputs sound on my local soundcard.

My humble analysis :
- it's probably an upstream problem
- rhythmbox never took the default sink defined in pulseaudio into account
- In version 3.4.3 and before, rhythmbox remembers last sink used and reconnects to it for next launch
- this "save" function broke in 3.4.4
- specific conditions to trigger the problem are still to be defined, RAOP sinks may have a role

Revision history for this message
Saroumane (saroumane) wrote :

What's new : I can reproduce the problem on Ubuntu 20.04 live USB, so I'm sure the root cause is not a broken config on my side.

To summarize :

Ubuntu 20.04 / Fedora 32.1 are affected. (Ubuntu 19.10 is not)

- Rhythmbox 3.4.4 fully affected (wrong sink at start + output is switched to a RAOP sink with each new song)
- Spotify is mildly affected : wrong sink at start, but after that you can play new song normally
- Rhytmbox 3.4.3 (in Ubuntu 19.10) is lightly affected : wrong sink on 1st launched, but the last sink used is saved for next launch
- VLC, Totem, Firefox, Chromium are unaffected

Requirements to trigger the bug : 1 (maybe 2) RAOP (aka Airplay / AirTunes) sinks available on local network in addition to local soundcard.

Steps to reproduce :
$ sudo apt install pulseaudio-module-raop
$ sudo apt install paprefs
If needed, fix paprefs (which is broken in 20.04)
$ sudo ln -s /usr/lib/pulse-13.99.1/ /usr/lib/pulse-13.99
optional, to monitor sinks used by rhythmbox :
$ sudo apt install pavucontrol && pavucontrol
Launch paprefs and check "Make discoverable Apple AirTunes soud devices available locally"
Launch Rhythmbox, play a track, correct the sink, play another track (next button or direct choice), correct the sink, etc.

As the issue has been abruptly dismissed upstream : https://gitlab.gnome.org/GNOME/rhythmbox/-/issues/1797#note_844963 (I assume the guy knows his job), you are my only hope here !

I know it's my fault, I should have stayed in Ubuntu 19.10 and wait 20.04.1, but I felt harassed by the updater popup reminder :) No, seriously I needed rhythmbox 3.4.4, to support my new phone.

So what should I do now ? I understand there is some kind of middleware between pulseaudio and rhythmbox : gstreamer ? Could it be the "culprit" ? If yes, should I report a bug here https://gstreamer.freedesktop.org/bugs/ or downstream ? Is it possible to downgrade gstreamer ?

Revision history for this message
crvi (crvi) wrote :

Try the following in Ubuntu LTS 20.04, to clear things out.

1. Create a new gnome user and log in.

2. Build Rhythmbox 3.4.3 from source. This should take 15 mins + 200 MB disk space

$ sudo apt-get build-dep rhythmbox
$ sudo apt-get install git
$ git clone https://gitlab.gnome.org/GNOME/rhythmbox.git
$ cd rhythmbox/
$ git checkout tags/v3.4.3 -b v3.4.3
$ ./autogen.sh
$ make
$ shell/rhythmbox --version
$ shell/rhythmbox

Note: Here were just building and starting Rhythmbox from source tree. It runs 100% from the tree. We don't do any installation. So, this will not interfere with existing Rhythmbox installed by the system. Just always do this experiment as a new user, so config / data of both git and system Rhythmbox versions remain separate in separate user home dirs.

3. Check if the random sink issue shows up ( It SHOULD in my opinion )

4. Do step [1] / [2] in Ubuntu 19.10 replacing "3.4.3" with "3.4.4".

5. Check if the random sink issue shows up ( It SHOULD NOT in my opinion ).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the details. I see it was also reported to GNOME (which is nice)
https://gitlab.gnome.org/GNOME/rhythmbox/-/issues/1797

They pointed out to a pulseaudio problem though

Could you report it there
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues ?

Revision history for this message
Saroumane (saroumane) wrote :

Sorry for not answering sooner, I've been quite busy.
I already spent too much time reproducing the bug under differents OS and setups.

Gnome does not want to help ? Fine, I switched to more reliable audio player.

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.