Bug with PCM plug layer with mmap emulation=true ?
Another question:
If the driver is being used in MMAP mode - is the ack callback invoked when the appl_ptr is updated ?
I dont see it happening in my driver.
Thanks,
Nikhil
----- Original Message -----
From: "Nikhil Rao" <[email protected]>
To: "Takashi Iwai" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, October 11, 2006 10:09 AM
Subject: Re: Fw: Bug with PCM plug layer with mmap emulation=true ?
Quoted 59 lines
Hi,
I am running into a bug with mmap_emulation=true and the plug layer, I had also run into the bug with 1.0.9b.
The symptom of the bug is that the first period (first 2 ?) get repeated on
playback.To reproduce the bug -
Modify the the intel-snd8x0 driver so that MMAP is disabled and only the 48Khz sample rate is supported in hardware.
Compile the driver and install it.The changes are attached with this email and reproduced below.
1097c1097
< .info = (SNDRV_PCM_INFO_INTERLEAVED|
---Quoted 1 line
.info = (
SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_INTERLEAVED|1099c1099,1100
<SNDRV_PCM_INFO_PAUSE|
---Quoted 2 lines
SNDRV_PCM_INFO_MMAP_VALID|
SNDRV_PCM_INFO_PAUSE|1143,1144c1144
< //runtime->hw.rates =ichdev->pcm->rates;
<runtime->hw.rates=SNDRV_PCM_RATE_48000;
---Quoted 1 line
runtime->hw.rates=ichdev->pcm->rates;Since MMAP is now disabled enable mmap_emulation=true in
/usr/share/alsa/alsa.conf, below is the modificationpcm.plughw {
<SNIPPED>
type plug
slave.pcm {
type hw
card $CARD
device $DEV
subdevice $SUBDEV
mmap_emulationtrue #modification to get plughw to work if MMAP is not
supported.
}
}Now play any non-48Khz wav file and you will hear the first fragment repeating.
aplay -D plughw:0,0 <wav file name>
If anyone knows of a workaround or if you need any more info please let me know.
Quoted 76 lines
Thanks,
Nikhil
----- Original Message -----
From: "Takashi Iwai" <[email protected]>
To: "Nikhil Rao" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, April 12, 2006 4:10 AM
Subject: Re: Fw: Bug with PCM plug layer with mmap emulation=true ?Quoted 65 lines
At Mon, 10 Apr 2006 15:51:14 -0700,
Quoted 6 lines · Nikhil Rao
Hi Takashi,
I havent received any response to the query below, let me know if I need to
add more information.Sorry I seem to have missed that post.
Quoted 18 lines
thanks,
Nikhil
----- Original Message -----
From: "Nikhil Rao" <[email protected]>
To: <[email protected]>
Sent: Monday, April 03, 2006 4:26 PM
Subject: Bug with PCM plug layer with mmap emulation=true ?Quoted 8 lines
Hello,
I have observed that the using pcm plug layer with mmap emulation=true in
alsa.conf, causes the first period of data to be sent twice to the driver.
I also verified this by dumping the PCM data to a file (using the copy callback)This could be a bug. The
mmap_emulationmode wasn't debugged for long time.Quoted 12 lines
Quoted 12 lines
I have tried experiments using the ALSA driver (ver 1.0.10) written by me
for my development system (an SoC)
and also the intelx80 driver on a Suse 10.0 system (ALSA ver 1.0.9b). I
modified the intelx80 driver so that it only supports 48Khz and then used
the plughw device to playout a 44Khz sample. There is a distinct stutter
audible at the beginning of the clip caused by the first period being presented twice to the hardware.Quoted 3 lines
Quoted 3 lines
Is this a known problem ? if so, is a workaround available (my development
platform does not support mmap currently).Well, another question is whether really mmap is necessary for your device. Any particular applications require the mmap access exclusively?
Anyway, the bug should be fixed. First, could you try the latest ALSA (1.0.11rc5 was released yesterday)? Debugging old codes is a waste of time.
The symptom sounds like a problem with rate plugin. The rate plugin defers the transfer until a whole period size is filled. So, if the problem still exists, please describe the method you checked this behavior in details, too.
Takashi
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
At Thu, 12 Oct 2006 17:52:50 -0700,
Quoted 6 lines · Nikhil Rao
Another question:
If the driver is being used in MMAP mode - is the ack callback invoked when the
appl_ptris updated ?
I dont see it happening in my driver.
That's odd. Could you check whether pcm_lib.c::snd_pcm_lib_write1() is called? In this code path, ack callback must be issued at each transfer.
Takashi
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642