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.