Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: alsa-devel@alsa-project.org
Cc: Mark Hills <mark@pogo.org.uk>
Subject: Re: Buffer size/periods (Layla3G)
Date: Sat, 22 Mar 2008 22:17:18 +0000	[thread overview]
Message-ID: <20080322221718.0b24de11.pochini@shiny.it> (raw)
In-Reply-To: <20080316221239.ae934fe4.pochini@shiny.it>

On Sun, 16 Mar 2008 22:12:39 +0000
Giuliano Pochini <pochini@shiny.it> wrote:

> > Also, there seem to be failures at certain buffer sizes:
> >
> >    $ ./test_buffers "hw:Layla3G,0,2" 429
> >    buffer_size=18912 period_size=96
> >
> >    $ ./test_buffers "hw:Layla3G,0,2" 430
> >    set_buffer_time_near: Invalid argument
> >
> >    $ ./test_buffers "hw:Layla3G,0,2" 431
> >    buffer_size=19008 period_size=96
> 
> This shouldn't happen. I'll give it a look.

It seems that ALSA can't manage to find a working hwparams combo. The card
has the following constraints:

buffer size:	64-32768 frames
period size:	multiple of 32 frames
periods:	2-220

It happens that ALSA restricts the allowable buffer size range to
18976-18976 which is very close to the requested 430ms. This is bad because
the biggest multiple of 32 divisor of 18976 is 32. 18976/32 = 593 > maximum
number of periods. return -EINVAL.

BUFFER_TIME = (430294 430295) -> (430294 430295)
Rule 8 [e20b3944]: RATE = [44100 44100] -> [44100 44100]
Rule 15 [e20b38d0]: BUFFER_SIZE = [18976 32768] -> [18976 18976]
Rule 17 [e20b38d0]: BUFFER_BYTES = [151808 262144] -> [151808 151808]
Rule 19 [e20b3944]: BUFFER_TIME = (430294 430295) -> (430294 430295)

Note that if you change the order of the hw_params_*() calls the problem
goes away. It might show up again for some other values though.

I don't know how to fix it. Any clue ??


--
Giuliano.

      parent reply	other threads:[~2008-03-22 21:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-16 12:02 Buffer size/periods (Layla3G) Mark Hills
2008-03-16 22:12 ` Giuliano Pochini
2008-03-17  0:21   ` Mark Hills
2008-03-19  0:15   ` Giuliano Pochini
2008-03-22 22:17   ` Giuliano Pochini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080322221718.0b24de11.pochini@shiny.it \
    --to=pochini@shiny.it \
    --cc=alsa-devel@alsa-project.org \
    --cc=mark@pogo.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox