[pulseaudio-discuss] kcontrol implementation for jack detection

David Henningsson david.henningsson at canonical.com
Wed Jan 11 08:03:57 PST 2012


With 3.3 merge window opened, and the new jack detection interface 
scheduled to go in, maybe it's time to talk about the implementation as 
well.

My draft patch is here: 
http://kernel.ubuntu.com/git?p=diwic/pulseaudio.git;a=commit;h=1f239a9966fe7e43d3c9cb37fedabf31ff7d706e

Fetching the jack state is done through the alsa-lib hctl interface, 
whereas the existing mixer stuff uses the alsa-lib smixer interface, 
which layers on top of the hctl interface. Right now I've tried to reuse 
the existing mixer code, which leads to stuff such as:

     if (fdl->hctl)
         err = snd_hctl_poll_descriptors_revents(fdl->hctl, 
fdl->work_fds, fdl->num_fds, &revents);
     else
         err = snd_mixer_poll_descriptors_revents(fdl->mixer, 
fdl->work_fds, fdl->num_fds, &revents);

Looks a bit copy-pasted, but I think it is the easiest solution at the 
moment. It's just five or so places anyway.
The other option would be to try to port the entire mixer stuff to use 
the hctl interface instead of the smixer interface, but I'm not sure I 
can foresee how much trouble that actually would be, and if we would run 
in to any regressions.

Thoughts?

// David



More information about the pulseaudio-discuss mailing list