[alsa-devel] commit bd5389278c96f585afcac4058420e4f3ac201d2a introduce big problem

Scott Jiang scott.jiang.linux at gmail.com
Tue Nov 8 11:06:14 CET 2011


2011/11/8 Takashi Iwai <tiwai at suse.de>:
> At Tue, 8 Nov 2011 17:16:33 +0800,
> Scott Jiang wrote:
>>
>> Hi Takash,
>>
>> commit bd5389278c96f585afcac4058420e4f3ac201d2a
>> Author: Takashi Iwai <tiwai at suse.de>
>> Date:   Fri Aug 21 01:18:00 2009 +0200
>>
>>     pcm: workaround for avoiding automatic start in mmap mode
>>
>>     In the normal mmap mode, the stream isn't started automatically even after
>>     the data >= start_threshold has been written.   However, in the
>>     mmap-emulation mode, the stream is started because it uses
>>     snd_pcm_write_areas() internally.
>>
>>     As a workaround for this inconsistency, start_threshold value is changed
>>     dynamically in sw_parmams and mmap_commit callbacks in mmap-emul plugin.
>>     Meanwhile, start_threshold for slave PCM is set to boundary so that only
>>     this plugin (or the one over it) can control the start of the stream.
>>
>>     This will fix problems in some apps using pulse plugin in the mmap mode.
>>
>>     Signed-off-by: Takashi Iwai <tiwai at suse.de>
>>
>> src/pcm/pcm_mmap_emul.c
>>
>> This commit caused codec using mmap-emul plugin can't work.
>> My config file list below:
>>
>> bfin-ad1836.pcm.default {
>>         @args [ CARD ]
>>         @args.CARD {
>>                 type string
>>         }
>>         type plug
>>         slave.pcm {
>>                 type mmap_emul
>>                 slave.pcm {
>>                         type hw
>>                         card $CARD
>>                         format S32_LE
>>                         rate 48000
>>                 }
>>         }
>> }
>>
>> Alsa will not send SNDRV_PCM_IOCTL_START to driver.
>
> And how are you testing it?  The whole background is missing...
>
Sorry, I sent it to you in former mail. I post it again.

When I use ad1836 and ad1938 with alsa lib 1.0.24, there is an error:

root:/> arecord -t wav -c 2 -d 3 -r 48000 -f S32_LE 1.wav
Recording WAVE '1.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:1773: read error: Input/output error

If format isn't S32_LE, snd_pcm_plugin_readi will be called and
everything works fine.

Regards,
Scott


More information about the Alsa-devel mailing list