Re: [alsa-devel] Adjust volume may cause audio playback corruption
Witch a patch[1] of PA which dumps playback PCM data, I found the dumped data(with ./wavformat.py[2] <dumpped_data> to convert to wav file) is not corrupted. Since PA uses mmap to transfer PCM data, the driver's DMA buffer should also be "good".
It seems related to HDA controller of SB710, I tried HDMI output, and can reproduce the problem too(http://dev.lemote.com/files/upload/software/PA-apc/HDMI-corrupted_sound.ogg). 2012/5/12 cee1 fykcee1@gmail.com:
Hi all,
We're using PA on our product, and sometimes audio playback may corrupt after adjusting volume.
We found a way to (relatively) easily reproduce the problem:
- Play sample.mp3 through totem in repeat mode.
- In gnome-volume-control, Hardware tap, repeat to shift between "Off
profile" and "Analog Stereo Duplex profile".
When the problem happens, the corruption continues until I:
- Do one more shift between "Off profile" and "Analog Stereo Duplex profile".
- Close totem (close all PA playback clients).
- Adjust volume.
When the problem happens, open another PA client doing audio playback, is also corrupt.
Some additional information:
- Output of alsa-info.sh on our product:
http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-lemote
- PA daemon log:
http://dev.lemote.com/files/upload/software/PA-apc/pulseaudio.log
- The corrupted sound:
http://dev.lemote.com/files/upload/software/PA-apc/corrupted_sound.ogg
- The sample mp3: http://dev.lemote.com/files/upload/software/PA-apc/sample.mp3
We've tried PA 1.0-0ubuntu3, 1.1-0ubuntu15 and 2.0, the problem continues.
The problem can also be reproduced on an AMD turion 64 x2 board with ubuntu 10.10 and ubuntu 12.04:
- Output of alsa-info:
ubuntu 10.10(32bit) http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-ubuntu-10.10 ubuntu 12.04(32bit) http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-ubuntu-12.04
Note:
- The AMD turion 64 x2 board uses the same chipset as our product.
- gnome-volume-control is removed in ubuntu 12.04, thus we compiled
it: http://dev.lemote.com/files/upload/software/PA-apc/gnome-volume-control
---- [1] http://dev.lemote.com/files/upload/software/PA-apc/debug/debug-alsa-sink.pat... [2] http://dev.lemote.com/files/upload/software/PA-apc/debug/wavformat.py
At Tue, 15 May 2012 16:30:14 +0800, cee1 wrote:
Witch a patch[1] of PA which dumps playback PCM data, I found the dumped data(with ./wavformat.py[2] <dumpped_data> to convert to wav file) is not corrupted. Since PA uses mmap to transfer PCM data, the driver's DMA buffer should also be "good".
It seems related to HDA controller of SB710, I tried HDMI output, and can reproduce the problem too(http://dev.lemote.com/files/upload/software/PA-apc/HDMI-corrupted_sound.ogg).
If you are using the recent kernel, try snoop=off option of snd-hda-intel driver. The recent AMD and VIA controllers are known to work with the non-snooping mode.
Takashi
2012/5/12 cee1 fykcee1@gmail.com:
Hi all,
We're using PA on our product, and sometimes audio playback may corrupt after adjusting volume.
We found a way to (relatively) easily reproduce the problem:
- Play sample.mp3 through totem in repeat mode.
- In gnome-volume-control, Hardware tap, repeat to shift between "Off
profile" and "Analog Stereo Duplex profile".
When the problem happens, the corruption continues until I:
- Do one more shift between "Off profile" and "Analog Stereo Duplex profile".
- Close totem (close all PA playback clients).
- Adjust volume.
When the problem happens, open another PA client doing audio playback, is also corrupt.
Some additional information:
- Output of alsa-info.sh on our product:
http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-lemote
- PA daemon log:
http://dev.lemote.com/files/upload/software/PA-apc/pulseaudio.log
- The corrupted sound:
http://dev.lemote.com/files/upload/software/PA-apc/corrupted_sound.ogg
- The sample mp3: http://dev.lemote.com/files/upload/software/PA-apc/sample.mp3
We've tried PA 1.0-0ubuntu3, 1.1-0ubuntu15 and 2.0, the problem continues.
The problem can also be reproduced on an AMD turion 64 x2 board with ubuntu 10.10 and ubuntu 12.04:
- Output of alsa-info:
ubuntu 10.10(32bit) http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-ubuntu-10.10 ubuntu 12.04(32bit) http://dev.lemote.com/files/upload/software/PA-apc/alsa-info-ubuntu-12.04
Note:
- The AMD turion 64 x2 board uses the same chipset as our product.
- gnome-volume-control is removed in ubuntu 12.04, thus we compiled
it: http://dev.lemote.com/files/upload/software/PA-apc/gnome-volume-control
[1] http://dev.lemote.com/files/upload/software/PA-apc/debug/debug-alsa-sink.pat... [2] http://dev.lemote.com/files/upload/software/PA-apc/debug/wavformat.py
-- Regards,
- cee1
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi,
Thanks for reply. 2012/5/15 Takashi Iwai tiwai@suse.de
At Tue, 15 May 2012 16:30:14 +0800, cee1 wrote:
Witch a patch[1] of PA which dumps playback PCM data, I found the dumped data(with ./wavformat.py[2] <dumpped_data> to convert to wav file) is not corrupted. Since PA uses mmap to transfer PCM data, the driver's DMA buffer should also be "good".
It seems related to HDA controller of SB710, I tried HDMI output, and can reproduce the problem too(http://dev.lemote.com/files/upload/software/PA-apc/HDMI-corrupted_sound.ogg).
If you are using the recent kernel, try snoop=off option of snd-hda-intel driver. The recent AMD and VIA controllers are known to work with the non-snooping mode.
I'm trying snd-hda-intel.snoop=0 under ubuntu10.10(32bit) with kernel from ubuntu 12.04(32bit), I still can reproduce it.
BTW, what is difference between snoop and no snoop? Enable no snoop mode will render no sound on our platform(which is mips compatible).
---- Regards, cee1
At Thu, 17 May 2012 17:15:24 +0800, cee1 wrote:
Hi,
Thanks for reply. 2012/5/15 Takashi Iwai tiwai@suse.de
At Tue, 15 May 2012 16:30:14 +0800, cee1 wrote:
Witch a patch[1] of PA which dumps playback PCM data, I found the dumped data(with ./wavformat.py[2] <dumpped_data> to convert to wav file) is not corrupted. Since PA uses mmap to transfer PCM data, the driver's DMA buffer should also be "good".
It seems related to HDA controller of SB710, I tried HDMI output, and can reproduce the problem too(http://dev.lemote.com/files/upload/software/PA-apc/HDMI-corrupted_sound.ogg).
If you are using the recent kernel, try snoop=off option of snd-hda-intel driver. The recent AMD and VIA controllers are known to work with the non-snooping mode.
I'm trying snd-hda-intel.snoop=0 under ubuntu10.10(32bit) with kernel from ubuntu 12.04(32bit), I still can reproduce it.
BTW, what is difference between snoop and no snoop? Enable no snoop mode will render no sound on our platform(which is mips compatible).
Ah, *this* is the biggest missing information. The non-snoop mode is implemented currently only for x86-64.
The non-snoop mode requires the non-cached pages and its mmap. This implementation is pretty arch-dependency, and currently no properl way is provided for MIPS. On such platforms, mmap doesn't work reliably, unfortunately.
Takashi
participants (2)
-
cee1
-
Takashi Iwai