* buffer_bytes not multiple of period_bytes
@ 2006-04-20 1:54 Carlos Munoz
2006-04-20 7:13 ` Jaroslav Kysela
2006-04-20 7:17 ` Giuliano Pochini
0 siblings, 2 replies; 4+ messages in thread
From: Carlos Munoz @ 2006-04-20 1:54 UTC (permalink / raw)
To: alsa-devel
Hi all,
I just noticed that alsa doesn't allocate a buffer size that is a
multiple of the period size. For example when aplay plays a 8000 sample
rate wav file, the driver gets the following:
buf_bytes=8000
period_bytes=1024
How am I going to dma the last period ?
I verified that the 16000 sample rate also has the same problem.
However, when the sample rate is 44100 the buffer size is a perfect
multiple of the period size.
Thanks,
Carlos Munoz
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: buffer_bytes not multiple of period_bytes
2006-04-20 1:54 buffer_bytes not multiple of period_bytes Carlos Munoz
@ 2006-04-20 7:13 ` Jaroslav Kysela
2006-04-20 7:17 ` Giuliano Pochini
1 sibling, 0 replies; 4+ messages in thread
From: Jaroslav Kysela @ 2006-04-20 7:13 UTC (permalink / raw)
To: Carlos Munoz; +Cc: alsa-devel
On Wed, 19 Apr 2006, Carlos Munoz wrote:
> Hi all,
>
> I just noticed that alsa doesn't allocate a buffer size that is a
> multiple of the period size.
Yes, it's not guaranteed. The period size determines the time period to
acknowledge transfers and these boundaries might shift across the ring
buffer.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: buffer_bytes not multiple of period_bytes
2006-04-20 1:54 buffer_bytes not multiple of period_bytes Carlos Munoz
2006-04-20 7:13 ` Jaroslav Kysela
@ 2006-04-20 7:17 ` Giuliano Pochini
2006-04-20 17:50 ` Carlos Munoz
1 sibling, 1 reply; 4+ messages in thread
From: Giuliano Pochini @ 2006-04-20 7:17 UTC (permalink / raw)
To: Carlos Munoz; +Cc: alsa-devel
On 20-Apr-2006 Carlos Munoz wrote:
> Hi all,
>
> I just noticed that alsa doesn't allocate a buffer size that is a
> multiple of the period size.
It's not required. If it is not a multiple, then the IRQ happens
in different points of the ring buffer each round. On some cards
this is hard or impossible to do. In those cases you can add this
constraint:
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
--
Giuliano.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: buffer_bytes not multiple of period_bytes
2006-04-20 7:17 ` Giuliano Pochini
@ 2006-04-20 17:50 ` Carlos Munoz
0 siblings, 0 replies; 4+ messages in thread
From: Carlos Munoz @ 2006-04-20 17:50 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: alsa-devel
Giuliano Pochini wrote:
>On 20-Apr-2006 Carlos Munoz wrote:
>
>
>>Hi all,
>>
>>I just noticed that alsa doesn't allocate a buffer size that is a
>>multiple of the period size.
>>
>>
>
>It's not required. If it is not a multiple, then the IRQ happens
>in different points of the ring buffer each round. On some cards
>this is hard or impossible to do. In those cases you can add this
>constraint:
>
>if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
> return err;
>
>
>
>
Hi Giuliano,
Yes, that solved the problem.
Thanks,
Carlos
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-04-20 17:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-20 1:54 buffer_bytes not multiple of period_bytes Carlos Munoz
2006-04-20 7:13 ` Jaroslav Kysela
2006-04-20 7:17 ` Giuliano Pochini
2006-04-20 17:50 ` Carlos Munoz
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.