[alsa-devel] How to use implicit feedback with full duplex?

Daniel Mack zonque at gmail.com
Wed Feb 6 21:20:44 CET 2013

On 06.02.2013 21:13, Clemens Ladisch wrote:
> Eldad Zack wrote:
>> On Tue, 5 Feb 2013, Clemens Ladisch wrote:
>>> I thought I'd try to use implicit feedback with my simple audio device:
>>> [...]
>>> This works fine when playing something:
>> ...
>>> But when I then try to record at the same time, the driver refuses to
>>> configure the input endpoint (to the only format, which is already set):
>>> And despite that "alreay in use" check, the input endpoint is affected
>>> so much that playback breaks.
>>> Is full duplex supposed to work?  Does it work with other devices?
>> This is probably a "yes, but" :)
>> I use my device mostly full duplex, but with jack opening both
>> playback and capture at the same time.
>> I assume you are opening two different streams, one for playback and
>> one for capture.
> Jack *also* uses two different streams, but it opens them at the same
> time.
>> Can you try using jackd -d alsa -d hw:x with the device and see if that
>> works for you?
> That works.  This means that there is a race condition in the driver, or
> that the different open/hw_params/prepare order trips it up.

I'll look for the FTU and re-try this with Eldad's latest additions once
I find some time. If there are races, we should definitely fix them.

> Anyway, I feel safe now to enable implicit feedback for other devices.


On a general note, my idea from the beginning and part of the motivation
to split the driver into the snd_usb_endpoint logic was to pull that
class out to a separate library, so we can use it from other drivers as
well. Much like what snd-usbmidi does.

There are few bits to clean up in order to remove dependencies between
the endpoint code and the rest of the driver, but then your ua101
driver, snd-usb-caiaq and probably some more drivers in the future can
share the generic streaming functionality.


More information about the Alsa-devel mailing list