[alsa-devel] ALSA DMIX support without MMAP ?

Jaroslav Kysela perex at perex.cz
Thu Jan 14 11:37:10 CET 2010


On Thu, 14 Jan 2010, ANISH KUMAR wrote:

>> mmap is supported by the Samsung drivers.
>
> Thanks for this information which i overlooked.
>> This looks like the dmix data rates are getting out of sync with what
>> the hardware is doing.  Enabling CONFIG_SND_PCM_XRUN_DEBUG will produce
>> more diagnostic information from the driver side
> I got the problem and after doing the changes DMIX plugin is working 
> very fine. As you know XRUN was happening and this happening in 
> snd_pcm_update_hw_ptr_post function. This happened because 
> stop_threshold is increased suddenly(Is it done by dmix? If yes then why 
> ?) ?????? In normal condtions this would have been fine but in my code i 
> was multiplying it by some amount causing it to wrap 
> around(stop_threshold=0 );Causing XRUN.So i just removed this 
> multiplying factor.

For dmix, the stop_threshold should be equal to boundary value, thus XRUN 
check should never be true. If you got xrun with dmix, something is wrong.

> One more Rate conversion query: ./alsa_aplay -v 
> -D"plug:'dmix:RATE=44100'" bond.wav Playing WAVE 'bond.wav' : Unsigned 8 
> bit, Rate 11025 Hz, Mono Plug PCM: Rate conversion PCM (44100, 
> sformat=U8) As you can see bond.wav is sampled at 11025k but when i am 
> playing with Plug PCM there is some noise in the song why????Is rate 
> conversion algoritm not able to resample it properly?

The default linear resampler is not very good quality. You may use some 
sox resamplers from the alsa-plugins package, but they're more CPU 
intensive. Check google.

 						Jaroslav

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.



More information about the Alsa-devel mailing list