[alsa-devel] a11y: howto reduce latency with alsa's dmix plugin?

Halim Sahin halim.sahin at freenet.de
Fri Sep 4 11:09:17 CEST 2009

On Fr, Sep 04 2009, Takashi Iwai wrote:

> At Wed, 02 Sep 2009 10:56:17 +0200,
> Halim Sahin wrote:
>> On Di, Sep 01 2009, Takashi Iwai wrote:
>> > At best, we need a small C code that reproduces the behavior.
>> Ok here is a small example.
>> It's a modified version of pcm_min.c.
>> Simply press ctrl+c to reproduce the problematic behaviour.
>> on my machine it takes about an half sek to stop with an usb head which
>> uses dmix.
> Hmm, I cannot reproduce the problem, at least, dmix + HD-audio.
> After removing sleep(1), it quits immediately.

Yes you can't, because the program doesn't run.
The sleep shouldn't be removed to see the problem.
When speech-dispatcher is running and someone tries to stop the output,
the programm doesn't exit.
Think about it like a pause key :-).

The sblive stopps emmidiately with inserted sleep the usb headset

> Doesn't this problem happen if you use usb-audio with "hw" PCM?

The pcm_min example of alsalib doesn't run this way.
--8<---------------cut here---------------start------------->8---

ALSA lib pcm.c:7125:(snd_pcm_set_params) Sample format not available for
K: Invalid argument
Playback open error: Invalid argument
--8<---------------cut here---------------end--------------->8---

Can you tell me which sampleformat works with this device???

> It's possible that the behavior of snd_pcm_drop() of usb-audio is
> different from others because of URB handling.

The stop problem also happends on my laptop with hd audio and ad1981

with kind regards

More information about the Alsa-devel mailing list