GNOME Bugzilla – Bug 647540
autoaudiosink picks element to use by rank, but pulsesink/alsasink/jackaudiosink are all PRIMARY
Last modified: 2011-07-04 16:21:14 UTC
autoaudiosink picks what element to use based on rank, but most of the audio sink elements are all PRIMARY, so it's undeterministic what will be used. It seems that for example debian patches pulsesink to PRIMARY+10, probably because of this. So we might want to think about how all this should work exactly. Other autodetect elements might have similar ponderings as well. This became a topic to me due to totem git now using autoaudiosink for playbin2 audio-sink property, instead of gconf or gsettings audiosink, which might want to be revised by totem separately eventually before 3.2 release.
The element selection is still deterministic... elements are sorted by their name if the ranks are equal. Of course this doesn't make this much better ;) What would you propose as a solution for this? Other than distributions adjusting the ranks for their policies?
We should probably rank sound servers (pulseaudio and jack) higher than lower-level thing (like alsa), since using alsasink will just result in adding another layer.
What exactly is the bug here? Are there cases where an audio sink element is chosen that causes degraded playback? Otherwise, if there's no difference, it doesn't matter, right?
I'd call it a degradation if I use a sound server like pulseaudio and instead of outputting to it directly, I get an alsa plugin in the way to go gstreamer -> alsa -> pulseaudio -> alsa -> output instead of gstreamer -> pulseaudio -> alsa -> output with all the associated compatibility code paths and whatnot. Why have a pulsesink element at all then if it doesn't mean any degradation compared to alsasink...
(In reply to comment #2) > We should probably rank sound servers (pulseaudio and jack) higher than > lower-level thing (like alsa), since using alsasink will just result in adding > another layer. +1 Ideally we could lower the ranks for sink that are not used. E.g. I hate it when apexsink is trying to connect and fail, as I don't have the hardware. But then I have no idea how to practically do it (except having a UI where I can override the ranks).
(Stefan: Why would apexsink be probed by autoaudiosink? Its rank is NONE.) IMO, it makes sense to increase pulsesink to PRIMARY+10, since it really is always preferred over any other output if it happens to be running. It's unclear if jacksink should be PRIMARY at all, since jack is a "specialty" output, and not general purpose. To that effect, commit f69dcaab58b262bb60fbbd561f01b9e049ba8da4 Author: David Schleef <ds@schleef.org> Date: Sun Jul 3 19:51:32 2011 -0700 pulse: Increase ranks to PRIMARY + 10 So that pulsesrc/pulsesink get chosen over other possible PRIMARY src/sinks by autoaudiosink. Presumably, if pulse is available, it is always preferred over another src/sink. Fixes: #647540.
(In reply to comment #6) > (Stefan: Why would apexsink be probed by autoaudiosink? Its rank is NONE.) > My bad, when a user goes to the audio settings in buzztard I get all audiosinks from the registry and probe them. For apexsink this blocks a little.