[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
Thu Mar 30 17:36:48 UTC 2017


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

--- Comment #6 from Tanu Kaskinen <tanuk at iki.fi> ---
(In reply to Vivek Dasmohapatra from comment #5)
> Seems bizarre to have a port selector that can't ever return an available
> port.

That would be bizarre, but that's not how the function works.

If the name parameter is set, some other module has already selected a port. If
that port is available, new_sink_source() will return NULL, and as a result,
the port choice is not overridden. If the port that the other module chose is
unavailable, then new_sink_source() will override that with what
find_best_port() returns.

If the name parameter is not set, then there shouldn't be need for
new_sink_source() to do anything, but for some reason it nevertheless first
picks the highest priority port. If that port is available, then
new_sink_source() returns NULL. As a result, no port will be selected, and
pa_sink_new() will do its own selection logic. If the highest priority is
unavailable, then new_sink_source() will return what find_best_port() returns.
This is bizarre, but harmless.

If you want to change the code, I would suggest removing the port selection
logic from module-switch-on-port-available and fix all other modules so that
they never choose an unavailable port (actually module-device-restore is the
only other module that configures the initial port of new sinks and sources).

-- 
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/20170330/0f91a935/attachment-0001.html>


More information about the pulseaudio-bugs mailing list