[pulseaudio-discuss] kcontrol implementation for jack detection

Colin Guthrie gmane at colin.guthr.ie
Thu Jan 19 03:47:25 PST 2012


'Twas brillig, and Tanu Kaskinen at 18/01/12 17:35 did gyre and gimble:
> On Wed, 2012-01-11 at 17:03 +0100, David Henningsson wrote:
>> 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?
> 
> The current approach of using hctl and smixer side by side looks ok to
> me. 

Yeah, I think this is OK for now too. Seems like it's easier in the
short term so go for it.

One quick question from me too: how does this affect salsa? I think Arun
got PA working nicely with salsa as part of his Android work (tho'
ultimately didn't use it), so it would be nice to at least consider
it... (tho' obviously if it doesn't work I wouldn't lose sleep over it -
just nice to know the impact of the change :))

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



More information about the pulseaudio-discuss mailing list