All of lore.kernel.org
 help / color / mirror / Atom feed
* ALSA USB quirk mixer driver question
@ 2025-02-14 12:05 Lena
  2025-02-26 10:22 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Lena @ 2025-02-14 12:05 UTC (permalink / raw)
  To: alsa-devel

Hi all!

I'm currently trying to develop an usb quirk mixer driver for a desktop 
USB audio interface.

The interface exposes the following:

- interface 0-2 are USB UAC compliant, bound to by snd-usb-audio, and
   working flawlessly

- interface 3 is vendor specific, and we can ignore it (used for
   firmware updates)

- interface 4 exposes a non-standard mixer with a HID interface exposing
   2 interrupt endpoints, and is used by the vendor windows app.

I have studied the protocol with usbpcap and can successfully talk to 
the interface on the userspace, but i had a question regarding how to 
proceed in the kernel.

This is because, after creating a new entry in `sound/usb/mixer_quirks.c`
with all the needed controls, userspace can interact with them, etc.

I can't figure out how to tell ALSA to
bind to the correct interface for the mixer (and kick out usbhid).
Looking at the other quirk mixer drivers it doesn't look (?) like any
other quirk mixer driver is binding to a *different* interface, not even 
`sound/usb/mixer_scarlett.c`.

Generally, in a standalone USB driver you'd have tracking/teardown
handled easily with a callback, but i'm having trouble with the
dependencies here. (simply using `usb_sndintpipe()` or
`usb_interrupt_msg()` triggers kernel oopses, so that's probably not it)

What i think i have to do is to use `usb_get_intf()`, then i have to
somehow claim it (does `usb_driver_claim_interface()` work here?). But
`usb_get_intf()` requires me to then release the interface with
`usb_put_intf()`, and it doesn't look like there's anywhere for me to do
that. (`snd_usb_mixer_elem_free()`? doesn't look like the order is
correct)

`iface_ref_find()` would sorta do what i need, but i cannot use it here.

Could someone please point me in the right direction? I'm very stuck at
the moment.

Thanks,

Lena

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-05  9:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 12:05 ALSA USB quirk mixer driver question Lena
2025-02-26 10:22 ` Takashi Iwai
2025-02-26 23:15   ` Lena
2025-02-27  7:01     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.