* ALSA DMIX support without MMAP ?
@ 2010-01-13 9:46 ANISH KUMAR
2010-01-13 11:27 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: ANISH KUMAR @ 2010-01-13 9:46 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
Hi,
I am working on android and and in our device we use ALSA.
I have enabled dmix support for andoid as by default android doesn't have this plugin enabled and soon will post it in android forum however i have run into some problems.Hoping takashi can help me out on this.
Problem is when i am trying to use dmix plugin i am not getting any sound (logs shown below).Is it because i don't have mmap mode support on my device???
If yes then can't dmix work without mmap mode??? Logs shown below:
Entered s3c24xx_pcm_hw_params,
Entered s3c24xx_pcm_hw_params, line 330
Entered s3c24xx_pcm_mmap
Entered s3c24xx_pcm_prepare
Entered s3c24xx_pcm_enqueue
Entered s3c24xx_pcm_trigger
Entered s3c24xx_pcm_pointer
Entered s3c24xx_pcm_pointer res_value[0]
snd_pcm_update_hw_ptr_pos xun: [0]occured XRUN!
Normal playback and recording is fine if i dont use dmix plugin.During my normal playback and recording i don't use mmap as i preallocate DMA memory and use them.
Regards,
anish
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
2010-01-13 9:46 ALSA DMIX support without MMAP ? ANISH KUMAR
@ 2010-01-13 11:27 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-13 11:27 UTC (permalink / raw)
To: ANISH KUMAR; +Cc: alsa-devel@alsa-project.org
On Wed, Jan 13, 2010 at 09:46:36AM +0000, ANISH KUMAR wrote:
> Problem is when i am trying to use dmix plugin i am not getting any sound (logs shown below).Is it because i don't have mmap mode support on my device???
mmap is supported by the Samsung drivers.
> If yes then can't dmix work without mmap mode??? Logs shown below:
>
> Entered s3c24xx_pcm_hw_params,
> Entered s3c24xx_pcm_hw_params, line 330
> Entered s3c24xx_pcm_mmap
> Entered s3c24xx_pcm_prepare
> Entered s3c24xx_pcm_enqueue
> Entered s3c24xx_pcm_trigger
> Entered s3c24xx_pcm_pointer
> Entered s3c24xx_pcm_pointer res_value[0]
> snd_pcm_update_hw_ptr_pos xun: [0]occured XRUN!
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <0KW800IYGE3P07@ms13.samsung.com>]
* Re: ALSA DMIX support without MMAP ?
[not found] <0KW800IYGE3P07@ms13.samsung.com>
@ 2010-01-14 9:55 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-14 9:55 UTC (permalink / raw)
To: ANISH KUMAR; +Cc: alsa-devel@alsa-project.org
On Thu, Jan 14, 2010 at 09:52:37AM +0000, ANISH KUMAR wrote:
> <HTML><HEAD>
> <META http-equiv=Content-Type content='text/html; charset=windows-1252'>
> <title>Samsung Enterprise Portal mySingle</title>
> <style> P, td, li {font-family:Arial, arial; font-size:9pt; margin-top:5px;margin-bottom:5px;} body{font-family:Arial, arial; font-size:9pt;}</style>
Unfortunately your mail has only come through as HTML which...
> </HEAD><BODY>>mmap is supported by the Samsung drivers.
> <br>
<p>Thanks for this information which i overlooked.</p>
> <br>>This looks like the dmix data rates are getting out of sync with what
> <br>>the hardware is doing. Enabling CONFIG_SND_PCM_XRUN_DEBUG will produce
...is rather hard to read. Could you please resend as text/plan?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
@ 2010-01-14 10:30 ANISH KUMAR
2010-01-14 10:37 ` Jaroslav Kysela
0 siblings, 1 reply; 9+ messages in thread
From: ANISH KUMAR @ 2010-01-14 10:30 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org
>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.
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?
If i play with ./alsa_aplay -v -D"plug:'dmix:RATE=11025'" bond.wav then no noise.Probably because no resampling happening?
Mark Brown Heartfelt Thanks for your time.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
2010-01-14 10:30 ANISH KUMAR
@ 2010-01-14 10:37 ` Jaroslav Kysela
0 siblings, 0 replies; 9+ messages in thread
From: Jaroslav Kysela @ 2010-01-14 10:37 UTC (permalink / raw)
To: ANISH KUMAR; +Cc: alsa-devel@alsa-project.org, Mark Brown
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@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
@ 2010-01-15 12:07 ANISH KUMAR
2010-01-15 13:37 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: ANISH KUMAR @ 2010-01-15 12:07 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: maniyar, alsa-devel@alsa-project.org, Mark Brown
>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.
DMIX is working now.
> 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.
Actually i am working on soc platform(android-S3C6410) and wanted to use DMIX and some good resampler for my software mixing instead of current software mixing and resampling in upper layer(Above alsa-lib).DMIX is working fine but this resampling is causing some jitter.During rate conversion it looks for libasound_module_rate_speexrate.so which i don't have so its using default one causing the jitter.
Can i build this .so file (as current way of alsa-plugin downloading will not work for me)?For sox resampler i guess i need to use differnet .so and corresponding changes in asound.conf file??
Can i get speex or sox resampler code so that i can build it for my system?????
This code(speex or sox) i guess would have been integrated with alsa-lib so that alsa-lib can call corresponding functions of resampler source code.
OR simply point me to url as googling is not helping.Everywhere i am getting this "you need to download plugins".This will not work in my case.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
2010-01-15 12:07 ANISH KUMAR
@ 2010-01-15 13:37 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-15 13:37 UTC (permalink / raw)
To: ANISH KUMAR; +Cc: maniyar, alsa-devel@alsa-project.org
On Fri, Jan 15, 2010 at 12:07:00PM +0000, ANISH KUMAR wrote:
> >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.
>
> Actually i am working on soc platform(android-S3C6410) and wanted to
> use DMIX and some good resampler for my software mixing instead of
> current software mixing and resampling in upper layer(Above
> alsa-lib).DMIX is working fine but this resampling is causing some
> jitter.During rate conversion it looks for
> libasound_module_rate_speexrate.so which i don't have so its using
> default one causing the jitter.
Have you considered using PulseAudio for this?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ALSA DMIX support without MMAP ?
@ 2010-01-18 3:25 ANISH KUMAR
2010-01-18 11:01 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: ANISH KUMAR @ 2010-01-18 3:25 UTC (permalink / raw)
To: Mark Brown
Cc: MAHAMMADRAFI MANIYAR, alsa-devel@alsa-project.org, lrg, lennart
> Actually i am working on soc platform(android-S3C6410) and wanted to
> use DMIX and some good resampler for my software mixing instead of
> current software mixing and resampling in upper layer(Above
> alsa-lib).DMIX is working fine but this resampling is causing some
> jitter.During rate conversion it looks for
> libasound_module_rate_speexrate.so which i don't have so its using
> default one causing the jitter.
>>Have you considered using PulseAudio for this?
Mark thanks for the suggestion and i checked out PulseAudio for my requirements.I found out that i don't need all the things in PulseAudio
a. I just need good resampling code.Can i just use just the resampler code of pulseaudio(mine is mobile enviroment)?
b. Just want a good mixer at ALSA-LIB level.As of now this is provided by android framework but i want this to be done by ALSA-LIB so that i
can replace with some good mixer later on(if i find that some other mixer is good).DMIX is providing that but it's not that good.
c.Jaroslav suggested to use sox resamplers but for that to work i have to get the sox resampler code(proper license) and need to build it for my system and link it
with corresponding functions of ALSA-LIB so that they can call relevant functions for resampling.As i am working on mobile domain i think i need to do the
integration of sox resampler code with ALSA-LIB for that to work??
or
Can i just use the integrated sox library(some .so i guess) and change the asound.conf for using that library??Will this work??
d. I saw some check-ins related to Scenario Manager.As of now scenario manager functionality is also given in Android(we open a differnet
device and the corresponding hooks for changing the routes dynamically) but i think if it given in alsa-lib switching will be much faster and this
will increase the system performance.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: ALSA DMIX support without MMAP ?
2010-01-18 3:25 ANISH KUMAR
@ 2010-01-18 11:01 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-18 11:01 UTC (permalink / raw)
To: ANISH KUMAR
Cc: MAHAMMADRAFI MANIYAR, alsa-devel@alsa-project.org, lrg, lennart
On Mon, Jan 18, 2010 at 03:25:31AM +0000, ANISH KUMAR wrote:
[Reflowed into 80 columns for legibility.]
> Mark thanks for the suggestion and i checked out PulseAudio for my
> requirements.I found out that i don't need all the things in PulseAudio
> a. I just need good resampling code.Can i just use just the resampler code of pulseaudio(mine is mobile enviroment)?
> b. Just want a good mixer at ALSA-LIB level.As of now this is provided by android framework but i want this to be done by ALSA-LIB so that i
> can replace with some good mixer later on(if i find that some other mixer is good).DMIX is providing that but it's not that good.
The mixing (and therefore resampling) are the core functionality of
PulseAudio which is why it seems like a good fit for your application.
> c.Jaroslav suggested to use sox resamplers but for that to work i have to get the sox resampler code(proper license) and need to build it for my system and link it
> with corresponding functions of ALSA-LIB so that they can call relevant functions for resampling.As i am working on mobile domain i think i need to do the
> d. I saw some check-ins related to Scenario Manager.As of now scenario manager functionality is also given in Android(we open a differnet
> device and the corresponding hooks for changing the routes dynamically) but i think if it given in alsa-lib switching will be much faster and this
> will increase the system performance.
The application layer code isn't going to make a meaningful difference
to the performance of scenario switching unless it's woefully
inefficient, the major constraint is almost always the fact that the
CODEC has a relatively slow control bus so the register changes to
implement the change dominate the time.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-01-18 11:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 9:46 ALSA DMIX support without MMAP ? ANISH KUMAR
2010-01-13 11:27 ` Mark Brown
[not found] <0KW800IYGE3P07@ms13.samsung.com>
2010-01-14 9:55 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2010-01-14 10:30 ANISH KUMAR
2010-01-14 10:37 ` Jaroslav Kysela
2010-01-15 12:07 ANISH KUMAR
2010-01-15 13:37 ` Mark Brown
2010-01-18 3:25 ANISH KUMAR
2010-01-18 11:01 ` Mark Brown
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.