[alsa-devel] [PATCH 2/2] ALSA: Integrate control based jack reporting with core jack reporting
broonie at opensource.wolfsonmicro.com
Mon Feb 13 16:44:59 CET 2012
On Mon, Feb 13, 2012 at 02:56:55PM +0100, Takashi Iwai wrote:
> Mark Brown wrote:
> > There's rather a lot of people who do embedded development and do need
> > to look at this stuff, though. There's a real cost to raising the bar
> > for humans to understand things.
> Hm, I'm afraid that this is getting apart from the real worth
> discussion. I'm interested in whether "Line-Out" is acceptable
> enough, or it's a matter of taste, just like Marmite is acceptable as
> the normal English breakfasts.
Well, I dunno - you did suggest adding direction modifiers to the jack
names which would both be a more general solution to the problem and
clean up the naming issue.
> with the input-jack layer. The input-jack doesn't provide the index
> number. So, you can't register the same name correctly. Thus I tried
> to create a unique name string as input-jack id.
It's really never been the intention to have an "input-jack" layer -
the API is there to hide all the input layer stuff it can from the
individual audio drivers. The only thing that leaks out is the button
remapping which I couldn't think of anything more sensible to do with
> Now, looking back to your implementation, the kctl jack is created
> with a name string based on the switch type, not from the name string
> passed to snd_jack_new() itself. Why not passing the string as is?
We can't pass it as-is since we'll need multiple controls per jack -
literally all the systems I have available to test on would fail if they
used the same name as they all have headset jacks. As I said further up
the thread my plan had been to refactor the name generation code once
the separate kctl code is gone and they can be merged into the same
source file which makes this a lot easier.
With these patches I'm mainly looking for a quick and simple refactoring
to get rid of the duplication - once we've got rid of the duplicate
driver APIs then we can refactor the internals of the implementation
however we like but there's a pretty pressing need to fix the driver
API and get all the drivers doing the same thing to userspace even if
it's not ideal.
> If multiple kctls are needed (e.g. for headset), you can either create
> a new name or just create the multiple instances with the same name
> but give extra TLVs to identify which type it is. Or, you can create
> an enum control so that both the input-jack and the kctl-jack
> correspond as 1:1.
This stuff is why I've been asking you about the ABI and general
semantics for the new controls, I was never sure what the intention was
- when you said they were just plain booleans I just went ahead and
created multiple controls as that seemed to be what the current idiom
I don't think an enumeration is going to scale so well given the number
of possible combinations you can get on more complex jacks.
> In other words, if 1:1 mapping isn't needed, we don't have to create a
> different name string at all. Just create "Jack Detect" controls with
> different indices and with corresponding TLVs. This would be enough
> (could be even easier) for a machine parser.
That'd work I think, though I would create a new control for each
physical jack at least just for clarity.
> And, it seems that there is no standard rule defined for the id string
> of input-jack. If 1:1 model is used, we'd need to define this rule.
The input stack doesn't have the same concept of machine parsable names
for things that ALSA does (honestly that's pretty unique to ALSA within
the kernel) - the names it users are all free form text intended to be
meaningful to humans only.
> BTW, I found another issue. With this implementation, you can't build
> kjack ctl without input-jack. I can work around it for HD-audio by
> adding more ifdef, but it'd be ugly...
I really don't see this as a problem; it seems vanishingly unlikely that
any realistic system would want to disable the input API and need
accessory detection. Obviously the end goal here is that you wouldn't
be able to have HDA specific hacks in the code as everything will be
handled by the ALSA core code...
To my mind we should just support everything and let userspace worry
about deciding what to use, this isn't the sort of thing which should
require a kernel rebuild to configure and it's not like there's any
fundamental problem or massive overhead caused by having the devices
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: Digital signature
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20120213/1fa859cc/attachment.sig
More information about the Alsa-devel