[pulseaudio-tickets] [Bug 87002] Headphones selected on first run while unplugged and other ports are available

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Dec 5 04:14:59 PST 2014


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

--- Comment #15 from Mario Sanchez Prada <msanchez at gnome.org> ---
(In reply to David Henningsson from comment #14)
> Ok, I've looked at this issue now. 
> 
> The startup order is something like:
> 
> 1) module_alsa_card's init_jacks initializes port availability, and for
> every port, we get a callback to port_available_hook_callback. No action is
> done here due to the fix for bug 73375.
> 
> 2) module_alsa_card's init_profile is called, which in turn creates sources
> and sinks. At this point, we don't switch profiles: our current profile is
> analog, we don't switch away from profiles when ports become unavailable.
> 
> The thing is, to solve this properly, we should need a callback *between* 1)
> and 2). We can't act on 1), because not all ports are guaranteed to have its
> availability set yet. But acting on 2) is too late, because then the profile
> is already set.

What about letting 1) and 2) to finish, as if everything went fine and then, as
a last and desperate attempt to avoid having a profile with no ports available,
check if there's a better option and switch profiles if needed?

That's the "hack" I've been experimenting with lately in this device (notice
that we use PA 5.0, but an stable release, not the trunk), and so far seemed to
work fine, although I'm not 100% it's a totally broken or not.

You can check it in this commit:
https://github.com/mariospr/pulseaudio/commit/4d3fdd5bbe8bc003f98403188e38a02110ba4c91

Please let me know what you think

Thanks a lot for the feedback!

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


More information about the pulseaudio-bugs mailing list