[uae] Re: Bloody ALSA (was Re: Re: Source code snapshot)

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Sat, 25 Mar 2006 00:10:26 -0500

Hi All

On Thursday 23 March 2006 00:43, Richard Drummond wrote:
> You know, I've been a Linux user for over 8 years and in that time nothing
> has been more of a pain in the bottom than audio support. It's well passed
> time somebody sorted this mess out. :-b
>
> Does anybody have ALSA output working without a 0.5 to 1 sec latency?

Done some digging, reading and experimenting, and the problem seems to be 
ALSA's dmix plugin. If you specify the "default" ALSA device with recent ALSA 
versions, you automatically get dmix thrown on top and this adds its own 
substantial minimum latency. I don't know if there's a way to reduce that. 
The ALSA documentation isn't what you might call light reading.

The best solution for now seems to be to default to using the "plughw:0,0" 
device rather than "default" and to make the specification of the ALSA device 
to use a configuration option. "plughw:0,0" means hardware-access to the 
first device on the first soundcard with automatic rate and route conversion, 
etc. You could also try using "hw:0,0" which is more or less direct access to 
the sound device, but this means you have less configurability. For example, 
you have to choose an output frequency that your device supports.

So, while I keeping digging, you might want to try changing the snd_pcm_open() 
call in sd-alsa/sound.c to use "plughw:0,0" rather than "default". Let me 
know how it works for you.

Cheers,
Rich

Other related posts: