Bug 498858 - alsa patch causes mplayer to stutter on unpause
Summary: alsa patch causes mplayer to stutter on unpause
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-04 04:09 UTC by Nathan G. Grennan
Modified: 2009-07-24 06:46 UTC (History)
6 users (show)

Fixed In Version: 2.6.29.6-213.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-24 06:46:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output from alsa-info.sh (35.43 KB, text/plain)
2009-05-16 16:36 UTC, Nathan G. Grennan
no flags Details
alsa-info.sh output (30.13 KB, text/plain)
2009-06-25 01:25 UTC, Jason Farrell
no flags Details

Description Nathan G. Grennan 2009-05-04 04:09:26 UTC
Description of problem:
  I recent started to notice mplayer stuttering after an unpause. I found mplayer with -nosound caused it not to occur. I tried different versions of the nvidia driver, and it didn't have any effect. I tried with the nv driver, no effect. I tried an older kernel, kernel-2.6.29-10.fc10.x86_64, and the problem went away. Next I tried taking out the posix timer patches, no effect. Then a few compiles to isolate the alsa patch that caused it. I narrowed it down to the patch below.

alsa-pcm-midlevel-add-more-strict-buffer-position.patch

Version-Release number of selected component (if applicable):
kernel-2.6.29.2-52.fc10.x86_64

How reproducible:
Every few tries

Steps to Reproduce:
1. Start mplayer with any video
2. Space bar to pause
3. Space bar again to unpause
  
Actual results:
Video and audio stutter really badly

Expected results:
Video and audio to play normally

Additional info:

Comment 1 Chuck Ebbert 2009-05-04 15:37:22 UTC
Can you see if it generates any xrun debug messages? Writing a 1 to /proc/asound/card*/pcm*/xrun_debug should enable the messages.

Comment 2 Nathan G. Grennan 2009-05-04 16:56:19 UTC
These are the messages from dmesg after triggering the issue twice, most of it from the first attempt. When the issue isn't happening during playpack, no dmesg output occurs.

ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=11263, delta=17400, period=1024, jdelta=21/362/0)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=11730, delta=1490, period=1024, jdelta=10/31)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=11734, delta=1494, period=1024, jdelta=10/31)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=11734, delta=1494, period=1024, jdelta=10/31)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=11735, delta=1495, period=1024, jdelta=10/31)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=12287, delta=2047, period=1024, jdelta=21/42/0)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=12449, delta=2209, period=1024, jdelta=4/46)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=13311, delta=3071, period=1024, jdelta=22/63/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=14335, delta=4095, period=1024, jdelta=21/85/0)
__ratelimit: 444 callbacks suppressed
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=6143, delta=12287, period=1024, jdelta=22/255/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=7167, delta=13311, period=1024, jdelta=21/277/0)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=7600, delta=13744, period=1024, jdelta=9/286)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=7606, delta=13750, period=1024, jdelta=9/286)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=7606, delta=13750, period=1024, jdelta=9/286)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=8121, delta=14265, period=1024, jdelta=20/297)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=8191, delta=14335, period=1024, jdelta=21/298/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=9215, delta=15359, period=1024, jdelta=22/319/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=10239, delta=16383, period=1024, jdelta=21/341/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=11263, delta=17407, period=1024, jdelta=21/362/0)
__ratelimit: 409 callbacks suppressed
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=1926, delta=8070, period=1024, jdelta=19/168)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=1927, delta=8071, period=1024, jdelta=19/168)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=1931, delta=8075, period=1024, jdelta=19/168)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=1931, delta=8075, period=1024, jdelta=19/168)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=2047, delta=8191, period=1024, jdelta=21/170/0)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=2713, delta=8857, period=1024, jdelta=14/184)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=2714, delta=8858, period=1024, jdelta=14/184)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=2717, delta=8861, period=1024, jdelta=15/184)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=2717, delta=8861, period=1024, jdelta=15/184)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=3071, delta=9215, period=1024, jdelta=22/191/0)
__ratelimit: 145 callbacks suppressed
ALSA sound/core/pcm_lib.c:279: hda_codec: Lost interrupts? (stream=0, delta=7166, intr_ptr=60416)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=15359, delta=16527, period=1024, jdelta=3/344/0)
ALSA sound/core/pcm_lib.c:263: hda_codec: hw_ptr skipping! [Q] (pos=16383, delta=2047, period=1024, jdelta=21/42/0)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=132, delta=2180, period=1024, jdelta=3/45)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=134, delta=2182, period=1024, jdelta=3/45)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=138, delta=2186, period=1024, jdelta=3/45)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=200, delta=2248, period=1024, jdelta=4/46)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=200, delta=2248, period=1024, jdelta=4/46)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=201, delta=2249, period=1024, jdelta=4/46)
ALSA sound/core/pcm_lib.c:337: hda_codec: hw_ptr skipping! (pos=981, delta=3029, period=1024, jdelta=21/63)


00:00.0 Host bridge: Intel Corporation 82P965/G965 Memory Controller Hub (rev 02)
00:01.0 PCI bridge: Intel Corporation 82P965/G965 PCI Express Root Port (rev 02)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 02)
00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 02)
00:1c.5 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 6 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation G80 [GeForce GTX 260] (rev a1)
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)
03:00.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)
03:00.1 IDE interface: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)
04:00.0 Ethernet controller: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) (rev 06)
06:01.0 Multimedia audio controller: Creative Labs SB Audigy (rev 04)
06:01.1 Input device controller: Creative Labs SB Audigy Game Port (rev 04)
06:01.2 FireWire (IEEE 1394): Creative Labs SB Audigy FireWire Port (rev 04)
06:02.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 20)
06:03.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
06:04.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 14)


lsmod | grep ^snd
snd_emu10k1_synth       7088  0 
snd_emux_synth         34688  1 snd_emu10k1_synth
snd_seq_virmidi         5840  1 snd_emux_synth
snd_seq_midi_emul       5776  1 snd_emux_synth
snd_emu10k1           144944  2 snd_emu10k1_synth
snd_rawmidi            22608  2 snd_seq_virmidi,snd_emu10k1
snd_ac97_codec        114760  1 snd_emu10k1
snd_seq_dummy           3108  0 
snd_seq_oss            31424  0 
snd_seq_midi_event      6656  2 snd_seq_virmidi,snd_seq_oss
snd_seq                54032  8 snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            43344  0 
snd_mixer_oss          15216  1 snd_pcm_oss
snd_pcm                78184  3 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
snd_seq_device          7060  7 snd_emu10k1_synth,snd_emux_synth,snd_emu10k1,snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq
snd_timer              22160  3 snd_emu10k1,snd_seq,snd_pcm
snd_page_alloc          8992  2 snd_emu10k1,snd_pcm
snd_util_mem            4048  2 snd_emux_synth,snd_emu10k1
snd_hwdep               8296  2 snd_emux_synth,snd_emu10k1
snd                    63448  18 snd_emu10k1_synth,snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_seq_dummy,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_device,snd_timer,snd_hwdep

Comment 4 Nathan G. Grennan 2009-05-06 06:14:37 UTC
  I reenabled the other patch, and put the patch you mentioned comment three. Below is the output from dmesg.

ALSA sound/core/pcm_lib.c:269: hda_codec: hw_ptr skipping! [Q] (pos=7167, delta=16803, period=1024, jdelta=9/350/0)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7301, delta=1157, period=1024, jdelta=3/24)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7302, delta=1158, period=1024, jdelta=3/24)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7304, delta=1160, period=1024, jdelta=3/24)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7307, delta=1163, period=1024, jdelta=3/24)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7364, delta=1220, period=1024, jdelta=4/25)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7365, delta=1221, period=1024, jdelta=4/25)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7365, delta=1221, period=1024, jdelta=4/25)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=7872, delta=1728, period=1024, jdelta=15/36)
__ratelimit: 471 callbacks suppressed
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=1870, delta=12110, period=1024, jdelta=18/252)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=1873, delta=12113, period=1024, jdelta=18/252)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=1874, delta=12114, period=1024, jdelta=18/252)
ALSA sound/core/pcm_lib.c:269: hda_codec: hw_ptr skipping! [Q] (pos=2047, delta=12287, period=1024, jdelta=22/255/0)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=2655, delta=12895, period=1024, jdelta=12/268)
ALSA sound/core/pcm_lib.c:269: hda_codec: hw_ptr skipping! [Q] (pos=3071, delta=13311, period=1024, jdelta=21/277/0)
ALSA sound/core/pcm_lib.c:269: hda_codec: hw_ptr skipping! [Q] (pos=4095, delta=14335, period=1024, jdelta=21/298/0)
ALSA sound/core/pcm_lib.c:269: hda_codec: hw_ptr skipping! [Q] (pos=5119, delta=15359, period=1024, jdelta=22/319/0)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=5931, delta=16171, period=1024, jdelta=17/336)
ALSA sound/core/pcm_lib.c:344: hda_codec: hw_ptr skipping! (pos=5935, delta=16175, period=1024, jdelta=17/336)

Comment 5 Nathan G. Grennan 2009-05-16 16:36:10 UTC
Created attachment 344277 [details]
Output from alsa-info.sh

Comment 6 Nathan G. Grennan 2009-05-16 17:36:39 UTC
 I still see the issue with the kernel version below.

kernel-2.6.30-0.81.rc5.git1.fc12.x86_64

Comment 7 Chuck Ebbert 2009-06-08 21:59:25 UTC
Patch dropped in 2.6.29.4-170; upstream has disabled this checking except when xrun debugging is enabled. Should be fixed in very recent 2.6.30 kernels too.

Comment 8 Fedora Update System 2009-06-17 11:53:42 UTC
kernel-2.6.29.5-191.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kernel-2.6.29.5-191.fc11

Comment 9 Fedora Update System 2009-06-19 13:44:14 UTC
kernel-2.6.29.5-191.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-6768

Comment 10 Fedora Update System 2009-06-24 19:22:49 UTC
kernel-2.6.29.5-191.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Jason Farrell 2009-06-25 01:23:58 UTC
Just updated, and I can still reliably reproduce the mplayer audio stutter on unpause when using alsa. The common thread I share with Nathan is the Audigy2 device and emu10k driver.

smplayer (using mplayer) crashes instead of stuttering when using 'alsa', but likewise stutters when specifically choosing 'alsa (0.0 - SB Audigy 4 [SB0610])'

VLC is fine.

after doing:
# for i in /proc/asound/card*/pcm*/xrun_debug; do echo 1 > $i; done

I see tons of the following sample dmesg output:
...
ALSA sound/core/pcm_lib.c:262: hda_codec: hw_ptr skipping! [Q] (pos=9215, delta=13311, period=1024, jdelta=22/277/0)
ALSA sound/core/pcm_lib.c:262: hda_codec: hw_ptr skipping! [Q] (pos=10239, delta=14335, period=1024, jdelta=21/298/0)
__ratelimit: 450 callbacks suppressed
ALSA sound/core/pcm_lib.c:262: hda_codec: hw_ptr skipping! [Q] (pos=16383, delta=4095, period=1024, jdelta=22/85/0)
...

Comment 12 Jason Farrell 2009-06-25 01:25:44 UTC
Created attachment 349323 [details]
alsa-info.sh output

Comment 13 Nathan G. Grennan 2009-07-07 06:37:09 UTC
This issue seems to be back in, kernel-2.6.29.6-211.fc11.x86_64.

Comment 14 Nathan G. Grennan 2009-07-07 23:59:11 UTC
CONFIG_SND_PCM_XRUN_DEBUG=y

Comment 15 Chuck Ebbert 2009-07-08 00:34:51 UTC
(In reply to comment #13)
> This issue seems to be back in, kernel-2.6.29.6-211.fc11.x86_64.  

The wrong patch was dropped. Should be fixed in 2.6.29.6-213

Comment 16 Jason Farrell 2009-07-08 03:25:55 UTC
(In reply to comment #15)
> The wrong patch was dropped. Should be fixed in 2.6.29.6-213  

Happy to report that it's indeed fixed here. The pause/unpause stutter used to happen with about ~50% regularity, but I haven't been able to reproduce it after dozens of attempts (after booting your freshly built 2.6.29.6-213 koji kernel). Thanks.

Comment 17 Fedora Update System 2009-07-08 12:13:30 UTC
kernel-2.6.29.6-213.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kernel-2.6.29.6-213.fc11

Comment 18 Fedora Update System 2009-07-16 07:12:26 UTC
kernel-2.6.29.6-213.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7617

Comment 19 Fedora Update System 2009-07-22 21:57:08 UTC
kernel-2.6.29.6-213.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.