Media Controller initial support for ALSA devices
Hello Hans,
If you can find a few minutes, please take a look at the following tree, where I added initial support for including the ALSA devices in the MC enumeration. I also did a bit of cleanup on your example tool, properly showing the fields associated with the given node type and subtype (before it was always showing fields for the V4L subtype).
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-mc-alsa/
I've implemented it for em28xx as a prototype, and will probably see how the code looks when calling it from au0828 and cx88 as well (to judge the quality of the abstraction).
Comments welcome, of course...
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Em Fri, 18 Sep 2009 00:40:34 -0400
Devin Heitmueller <[email protected]> escreveu:
Quoted 8 lines
Hello Hans,
If you can find a few minutes, please take a look at the following tree, where I added initial support for including the ALSA devices in the MC enumeration. I also did a bit of cleanup on your example tool, properly showing the fields associated with the given node type and subtype (before it was always showing fields for the V4L subtype).
Quoted 7 lines
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-mc-alsa/
I've implemented it for em28xx as a prototype, and will probably see how the code looks when calling it from au0828 and cx88 as well (to judge the quality of the abstraction).
Comments welcome, of course...
How do you expect that em28xx devices using snd-usb-audio to be enumerated?
Cheers,
Mauro
Quoted 13 lines · Mauro Carvalho Chehab
Em Fri, 18 Sep 2009 00:40:34 -0400
Devin Heitmueller <[email protected]> escreveu:Quoted 10 lines
Hello Hans,
If you can find a few minutes, please take a look at the following tree, where I added initial support for including the ALSA devices in the MC enumeration. I also did a bit of cleanup on your example tool, properly showing the fields associated with the given node type and subtype (before it was always showing fields for the V4L subtype).
Quoted 7 lines
Quoted 5 lines
I've implemented it for em28xx as a prototype, and will probably see how the code looks when calling it from au0828 and cx88 as well (to judge the quality of the abstraction).
Comments welcome, of course...
How do you expect that em28xx devices using snd-usb-audio to be enumerated?
There are two basic issues your question raises:
1. Finding the correct ALSA device: I wrote some code a few weeks ago that does it by enumerating through the sound card entries and digging through the usb interface pointers to find the one that matches. I'm just not happy with the code yet and wasn't ready to show it to anybody. I've got the same basic issue with au0828, and I've been thinking about it for a while. Certainly the cases where we have vendor audio or DMA audio for PCI devices are much more straightforward.
2. The second issue has to do with the loading sequence. Because each interface is bound separately, I'm not confident I can setup the alsa device so early in the process, since in the case of the snd-usb-audio the driver hasn't been initialized against the device yet. I'm still trying to work out the optimal scheme for this - for example perhaps waiting until the media controller is opened for the first time before doing the lookup.
In short, I am certainly aware of both issues and am actively working on finding an optimal solution. Either way though, the prototype code is good enough for us to start exercising the userland interface and evaluate how well it will integrate into applications for common use cases.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 8 lines · On Friday 18 September 2009 06:40:34 Devin Heitmueller wrote:
Hello Hans,
If you can find a few minutes, please take a look at the following tree, where I added initial support for including the ALSA devices in the MC enumeration. I also did a bit of cleanup on your example tool, properly showing the fields associated with the given node type and subtype (before it was always showing fields for the V4L subtype).
Quoted 7 lines
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-mc-alsa/
I've implemented it for em28xx as a prototype, and will probably see how the code looks when calling it from au0828 and cx88 as well (to judge the quality of the abstraction).
Comments welcome, of course...
Looks good. But rather than adding v4l2_device_register_alsa_node you should add a v4l2_device_register_entity. I intended to do that, but never got around to it. The entity struct is just part of the larger struct v4l2_alsa_device and you can go from one to the other using container_of.
This way you don't need to make v4l2_device_register_fb_node and dvb_node, etc. A single generic register_entity is sufficient.
Note that I am leaning more to replacing the v4l2 prefix by a media prefix. It's not really very v4l2-specific anymore. I think that most of what the media controller does can be generalized completely and used by pretty much anything that has complex mesh-like relationships. Too early to say for sure, though.
Regards,
Hans
Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
Quoted 22 lines · Hans Verkuil
Quoted 8 lines · On Friday 18 September 2009 06:40:34 Devin Heitmueller wrote:
Hello Hans,
If you can find a few minutes, please take a look at the following tree, where I added initial support for including the ALSA devices in the MC enumeration. I also did a bit of cleanup on your example tool, properly showing the fields associated with the given node type and subtype (before it was always showing fields for the V4L subtype).
Quoted 7 lines
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-mc-alsa/
I've implemented it for em28xx as a prototype, and will probably see how the code looks when calling it from au0828 and cx88 as well (to judge the quality of the abstraction).
Comments welcome, of course...
Looks good. But rather than adding
v4l2_device_register_alsa_nodeyou should add av4l2_device_register_entity. I intended to do that, but never got around to it. The entity struct is just part of the larger structv4l2_alsa_deviceand you can go from one to the other usingcontainer_of.
Quoted 8 lines
This way you don't need to make
v4l2_device_register_fb_nodeanddvb_node, etc. A single genericregister_entityis sufficient.Note that I am leaning more to replacing the v4l2 prefix by a media prefix. It's not really very v4l2-specific anymore. I think that most of what the media controller does can be generalized completely and used by pretty much anything that has complex mesh-like relationships. Too early to say for sure, though.
Hello Hans,
I'm not against substituting v4l2_device_register_alsa_node for v4l2_device_register_entity, provided you really believe that there won't need to be any additional properties. Right now the ALSA struct just has the entity struct and the v4l2_device pointer for the parent.
If you really believe we won't need anything else, then I can change
it accordingly.
I'll see about whipping up something this week. It would be good though if I can get this to a point where you pull in the changes to your mc tree, so that I don't get out of sync when you start making more changes yourself.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com