[pulseaudio-tickets] [Bug 100451] module-switch-on-port-available will only select unavailable ports when a new sink or source appears

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri May 5 15:36:57 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100451

--- Comment #12 from Kristian Klausen <klausenbusk at hotmail.com> ---
(In reply to Tanu Kaskinen from comment #1)
> I believe you misunderstood the intention of the code (which is no wonder -
> comments would be very welcome here).
> 
> If the name parameter of new_sink_source() is set, then that means that some
> other module has already chosen the initial port. If so,
> module-switch-on-port-available shouldn't override that, unless the chosen
> port is unavailable.
> 
> The function works correctly as far as I can tell. In the bug title you say
> that the function selects unavailable ports, but to me that seems to be
> possible only if all ports are unavailable.

I'm experiencing what you are describing (PulseAudio selecting as unavailable
port, even through there is a available port), see attachment:
https://bugs.freedesktop.org/attachment.cgi?id=131228 .
As you can see online line 469, it set hdmi-output-0 to no (available: no)
(   0.234|   0.000) D: [pulseaudio] device-port.c: Setting port hdmi-output-0
to status no
On line 477, it set hdmi-output-1 to yes (available: yes)
(   0.234|   0.000) D: [pulseaudio] device-port.c: Setting port hdmi-output-1
to status yes

But even through it know hdmi-output-0 is unavailable and hdmi-output-1 is
available it choose hdmi-output-0. (Line 508)
(   0.252|   0.000) D: [pulseaudio] module-switch-on-port-available.c:
Switching initial port for sink 'alsa_output.pci-0000_00_1f.3.hdmi-stereo' to
'hdmi-output-0'

As I understand the "initial port" logic, it will always choose a unavailable
port? But maybe I'm misunderstanding something.

https://github.com/pulseaudio/pulseaudio/blob/master/src/modules/module-switch-on-port-available.c#L340

> 
> The code seems a bit weird if the only purpose is to prevent other modules
> from selecting unavailable ports, and if that's indeed the only purpose, I
> think it would be better to fix those other modules and not worry about the
> initial port at all in module-switch-on-port-available.
> 
> I don't understand how your change could result in better port choices.
> Details about what ports exist on your system, the availability status of
> the ports, and the choices made before and after your change would be
> helpful.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20170505/6b37f842/attachment.html>


More information about the pulseaudio-bugs mailing list