[pulseaudio-discuss] [RFC] Pulseaudio jack sense
David Henningsson
david.henningsson at canonical.com
Thu Mar 10 23:12:57 PST 2011
On 2011-03-10 22:47, Margarita Olaya wrote:
> Hi,
>
> I have some initial code for jack sense implementation, the approach
> is to listen /dev/input/eventX and pass that data as argument to a new
> module called module-jack-detect where a thread wakes when the jack
> has been inserted.
>
> Using the current code I'm able to catch jack insertion and removal,
> next step is to signal PA core when the jack has been inserted so this
> calls a hook in the PA UCM module to load the ucm configuration for
> jack.
Jack sense is something that we all want, so it's great that someone is
working on it.
The first tricky thing is to match /dev/input/eventX against the proper
card - that is, if you have three cards, all with headphone outputs, you
must know which card your event belongs to. Is this solved in your git
tree? I had a quick look but couldn't find code for doing that. (You
also seem to add threads for all eventX, even those not audio related at
all, could this be improved?)
> So, I need to send a message to any other interested module but I'm
> sure how implement it, Can a hook be used to signal PA core?
The second thing is to figure out what we should really do once we have
detected jack insertion or removal. Adding a hook event and let other
modules act on that, seems reasonable to me. But we should also add a
property to the property list (or something similar?) telling the
current state of the jack - and btw, can this be figured out by reading
from /dev/input/eventX at startup?
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
More information about the pulseaudio-discuss
mailing list