[alsa-devel] [Q] Writing an alsa module for usb audio & video capture device
Hi everyone,
I'm writing a driver for stk1160 usb bridge (audio & video capture device). The video part is almost done [1] and now I've started the alsa part.
As the driver replaces an in-tree staging driver I could just grab the alsa part from the original driver (called easycap), or look into em28xx sources.
But as I want to learn a thing or two in this life, I've decided to take a look at sound drivers first. Currently I'm reading through sound/usb/6fire driver (picked randomly).
I would like to know: do you have any suggestions and/or hints in order to write a *nice* driver? What driver would you consider as being a *correct* usb sound capture implementation?
[1] http://patchwork.linuxtv.org/patch/11577/
Thanks, Ezequiel.
Hi again,
On Mon, Jun 4, 2012 at 6:50 PM, Ezequiel Garcia elezegarcia@gmail.com wrote:
Hi everyone,
I'm writing a driver for stk1160 usb bridge (audio & video capture device). The video part is almost done [1] and now I've started the alsa part.
As the driver replaces an in-tree staging driver I could just grab the alsa part from the original driver (called easycap), or look into em28xx sources.
[snipped myself]
I also would like to know (if anyone is reading this):
1. Why do I need to write another module for my device? Is it not possible to make it work with snd-usb-audio? 2. The device uses ac97 chip, could I use some ac97 common code instead of rewriting it myself?
Currently, v4l drivers that must support alsa rewrites a lot of stuff. I'm not sure this is the *right thing*.
Thanks, Ezequiel.
Ezequiel Garcia wrote:
- Why do I need to write another module for my device? Is it not
possible to make it work with snd-usb-audio?
Of course it is possible; just make it USB Audio class compliant.
- The device uses ac97 chip, could I use some ac97 common code
instead of rewriting it myself?
The AC'97 code is for managing codecs on an AC'97 bus, but the bus inside a USB device is not directly accessible to code on the host.
Regards, Clemens
Hi Clemens,
On Wed, Jun 6, 2012 at 2:26 PM, Clemens Ladisch clemens@ladisch.de wrote:
Ezequiel Garcia wrote:
- Why do I need to write another module for my device? Is it not
possible to make it work with snd-usb-audio?
Of course it is possible; just make it USB Audio class compliant.
What do you mean by that? What's exactly the scope of supported devices by snd-usb-audio?
- The device uses ac97 chip, could I use some ac97 common code
instead of rewriting it myself?
The AC'97 code is for managing codecs on an AC'97 bus, but the bus inside a USB device is not directly accessible to code on the host.
Understood.
Thank you very much! Ezequiel.
Ezequiel Garcia wrote:
On Wed, Jun 6, 2012 at 2:26 PM, Clemens Ladisch clemens@ladisch.de wrote:
make it USB Audio class compliant.
What do you mean by that?
Implement the descriptors and class-specific requests required by one of the Audio Class specifications: http://www.usb.org/developers/devclass_docs#approved
What's exactly the scope of supported devices by snd-usb-audio?
Pretty much everything in Audio Class 1.0 and 2.0 (some clock-related parts of v2 are yet missing).
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Ezequiel Garcia