Bug 476410

Summary: (reltek ac97) Driver signals "writability" via poll() but snd_pcm_update_avail() says there is nothing to write
Product: [Fedora] Fedora Reporter: Syam <get.sonic>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 10CC: dtlabz, gauret, kernel-maint, lkundrak, lpoetter, rdieter
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 07:17:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 446451    
Attachments:
Description Flags
pulseaudio -vv messages before starting Amarok
none
After starting Amarok, but before playing anything
none
After starting successful playback
none
After closing UI, and selecting Pause from systray menu (playback pauses)
none
Portion after selecting resume from systray
none
Portion a while after resuming
none
After killing Amarok process none

Description Syam 2008-12-14 11:40:50 UTC
Description of problem:
When I pause an mp3 file, and resume later, sometimes the resume doesn't work.
Nothing happens on clicking play/pause buttons. When I quit Amarok, it goes away. But the task list still lists amarok, and PA volume control lists the Amarok stream. Once I kill Amarok, the stream disappears and everything's back to normal.
If I invoke amarok (without killing the running instance), it doesn't come up.

Version-Release number of selected component (if applicable):
Amarok: 2.0-2-fc10
Pulse Audio packages: 0.9.13-6.fc10
alsa-plugins-pulseaudio: 1.0.18-1.rc3.fc10
xine-lib-pulseaudio: 1.1.15-3.fc10

How reproducible:
The problem can occur when pausing by the Amarok UI button or from the system tray right-click menu. But I feel that it's more easily reproduced by pausing from system tray menu.

Steps to Reproduce:
1. Start Amarok and play an MP3
2. Close Amarok, so that it continues to run without UI
3. Right-click system tray Amarok icon
4. Select 'Play/Pause' to pause playback
5. Select 'Play/Pause' to resume
  
Actual results:
Playback doesn't resume, and amarok/pulseaudio messes up!

Expected results:
Play/resume works as advertised

Additional info:
The problem was present with the 1.9 beta version shipped with F10.
I've an integrated Reltek AC'97 codec.

Comment 1 Syam 2008-12-14 11:42:26 UTC
In case you are not able to reporoduce with the first attempt, please play around pausing/resuming playback from the UI and the system tray.

Comment 2 Kurian John 2008-12-14 12:17:23 UTC
The problem is reproducible on a Fedora 10 with nVidia MCP51 High Definition Integrated Audio.

Performing repeated play/pause always results in a mess.

Pulseaudio messages:

D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 31800 bytes on render memblockq.
D: sink-input.c: Requesting rewind due to corking
D: module-suspend-on-idle.c: Sink alsa_output.pci_10de_26c_sound_card_0_alsa_playback_0 becomes idle.
I: module-suspend-on-idle.c: Sink alsa_output.pci_10de_26c_sound_card_0_alsa_playback_0 idle for too long, suspending ...
I: module-alsa-sink.c: Device suspended...

Comment 3 Syam 2008-12-14 12:56:56 UTC
Created attachment 326863 [details]
pulseaudio -vv messages before starting Amarok

Comment 4 Syam 2008-12-14 12:57:44 UTC
Created attachment 326864 [details]
After starting Amarok, but before playing anything

Comment 5 Syam 2008-12-14 12:58:27 UTC
Created attachment 326865 [details]
After starting successful playback

Comment 6 Syam 2008-12-14 13:00:17 UTC
Created attachment 326866 [details]
After closing UI, and selecting Pause from systray menu (playback pauses)

Comment 7 Syam 2008-12-14 13:02:12 UTC
Created attachment 326867 [details]
Portion after selecting resume from systray

Playback *does not* actually resume. Amarok seekbar does not move and counter is static.

Comment 8 Syam 2008-12-14 13:02:45 UTC
Created attachment 326868 [details]
Portion a while after resuming

Comment 9 Syam 2008-12-14 13:04:13 UTC
Created attachment 326869 [details]
After killing Amarok process

Exiting the amarok app (from the systray) does not produce any new messages from PA.

Comment 10 Rex Dieter 2008-12-14 13:08:16 UTC
comment #2 highlights a PA/audio_driver issue.  I'll have to scour the other logs here, but I suspect I'll find the same there.

Comment 11 Syam 2008-12-14 13:15:46 UTC
Indeed! 3 Fedora releases, and PA still scares me!
On my machine, I can reproduce the problem simply by pausing the audio!

Comment 12 Rex Dieter 2008-12-15 15:54:33 UTC
shrug, PA these days is very good at exposing low-level alsa/driver bugs.  I'd venture that's the case here (Reltek AC'97).

Comment 13 Lennart Poettering 2008-12-17 22:22:53 UTC
You're audio driver is broken. Have you seen this message?

"ALSA woke us up to write new data to the device, but there was actually nothing to write! Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers."

Reassigning to kernel since apparently the Realtek AC97 driver needs fixing. It signals "writability" while snd_pcm_updateavail() subsequently tells us there is nothing to write.

Comment 14 Syam 2009-01-10 18:38:40 UTC
This is more problematic than I thought. Looking for lost free space, I found that my /var/log/messages (and backed up files) run in to more than 750MB. The files are full of this message:
"pulseaudio[2699]: module-alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write! Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.".

Comment 15 Syam 2009-01-16 01:48:15 UTC
I filed a bug with ALSA since Lennart says it's a problem with the ALSA driver.

Comment 16 Syam 2009-01-16 02:09:30 UTC
Here's the ALSA bug report: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4339

Comment 17 Bug Zapper 2009-11-18 09:40:56 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 18 Bug Zapper 2009-12-18 07:17:27 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.