2011/11/8 Takashi Iwai tiwai@suse.de:
At Tue, 8 Nov 2011 17:16:33 +0800, Scott Jiang wrote:
Hi Takash,
commit bd5389278c96f585afcac4058420e4f3ac201d2a Author: Takashi Iwai tiwai@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@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