Re: mapping externally allocated Scatter Gather DMA buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 9 Nov 2010, Manu Abraham wrote:

On Tue, Nov 9, 2010 at 6:21 PM, Jaroslav Kysela <perex@xxxxxxxx> wrote:
On Tue, 9 Nov 2010, Manu Abraham wrote:

On Tue, Nov 9, 2010 at 5:31 PM, Jaroslav Kysela <perex@xxxxxxxx> wrote:

On Tue, 9 Nov 2010, Manu Abraham wrote:

testbox ~ # arecord -Dhw:2,0
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono

Any idea, why saa7231_hw_params is not getting invoked ?

Your hw probably does not support directly 8-bit sample at 8000Hz, one
channel. Use 'plughw:2,0' device instead 'hw:2,0' to let alsa-lib do all
stream format conversions.

That didn't make any difference at all.

Check your code. You probably created wrong hw_ops, looking to your code:

   Â.buffer_bytes_max    = 512 * 4096,
   Â.period_bytes_min    = 8192,
   Â.period_bytes_max    = 8192,
   Â.periods_min      Â= 8192,
   Â.periods_max      Â= 8192,

It's definitely an empty configuration space.

You have buffer_bytes_max 2097152, but restricted number of periods to 8192
and period_bytes to 8192.

8192 * 8192 = 67108864 which is not less than 2097152 (and I'm not counting
the bytes for channels and formats). Bingo, the ALSA PCM code does not know
what to configure.

Decrease periods_min and probably also periods_max.


oh ! The error message was really a weird one. I can say that the
hardware can do 192 audio frames in an interrupt, whatever the frame
size is. So, what periods and period_bytes should I describe in the
configuration ?

You cannot describe this using hw_ops. Leave period bytes in good range (192 - 1536?), periods (2-1024?) and add something like this to the open callback:

       err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
                                          192, 192);

Note the difference between SNDRV_PCM_HW_PARAM_PERIOD_SIZE and SNDRV_PCM_HW_PARAM_PERIOD_BYTES.

						Jaroslav

-----
Jaroslav Kysela <perex@xxxxxxxx>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux