Ticket #264 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

Audio stops after hibernate until closing all programs/connections to PA

Reported by: theg33kb0y Owned by: lennart
Milestone: Component: daemon
Keywords: hibernate hibernation no sound xmms flashplayer Cc:

Description (last modified by lennart) (diff)

Since I started using PA (Fedora 8), after all audio programs are closed and reopened. Below are the steps I have taken to troubleshoot a problem. There are 10 steps in this example to reproduce the bug. Debug output is inline between "========" as code blocks. Is this a bug in PA after resume, or a configuration problem? After an afternoon of research, there does not appear to be any configuration change to adjust this behavior.

Thank you!

-Eric

0. start pulseaudio -vvv
1. open xmms, start mp3 playing through pulse audio.
2. hibernate
3. resume
4. xmms has stopped playing at this point. I try to play any track from the existing xmms playlist, which fails. Each attempt to play a track results in this debug output from pulseaudio:

===========================================================================
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
I: sink-input.c: Freeing output 5 "ALSA Playback"
I: client.c: Freed 2 "ALSA plug-in [xmms]"
I: protocol-native.c: connection died.
I: client.c: Created 3 "Native client (UNIX socket client)"
I: protocol-native.c: Got credentials: uid=500 gid=500 success=1
I: protocol-native.c: Enabled SHM for new connection
I: client.c: Client 3 changed name from "Native client (UNIX socket client)" to "ALSA plug-in [xmms]"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
I: module-volume-restore.c: Restoring volume for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes busy.
I: resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates.
D: resampler.c: Channel matrix:
D: resampler.c:        I00 
D: resampler.c:     +------
D: resampler.c: O00 | 1.000
D: resampler.c: O01 | 1.000
I: resampler.c: Using resampler 'copy'
I: resampler.c: Using s16le as working format.
I: sink-input.c: Created input 6 "ALSA Playback" on alsa_output.hw_0 with sample spec s16le 1ch 44100Hz and channel map mono
D: memblockq.c: memblockq requested: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: memblockq.c: memblockq sanitized: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
I: sink-input.c: Freeing output 6 "ALSA Playback"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
I: module-volume-restore.c: Restoring volume for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes busy.
I: resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates.
D: resampler.c: Channel matrix:
D: resampler.c:        I00 
D: resampler.c:     +------
D: resampler.c: O00 | 1.000
D: resampler.c: O01 | 1.000
I: resampler.c: Using resampler 'copy'
I: resampler.c: Using s16le as working format.
I: sink-input.c: Created input 7 "ALSA Playback" on alsa_output.hw_0 with sample spec s16le 1ch 44100Hz and channel map mono
D: memblockq.c: memblockq requested: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: memblockq.c: memblockq sanitized: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
===========================================================================

5. Repeats of step-4 result in nearly identical output, but the input/output descriptors increment.

6. Open flashplayer and play pandora.com's interface swf (directly, not through firefox) - no audio. Output from step-6:

===========================================================================
I: client.c: Created 5 "Native client (UNIX socket client)"
I: protocol-native.c: Got credentials: uid=500 gid=500 success=1
I: protocol-native.c: Enabled SHM for new connection
I: client.c: Client 5 changed name from "Native client (UNIX socket client)" to "Adobe Flash"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$Adobe Flash>
I: module-volume-restore.c: Restoring volume for <pulsecore/protocol-native.c$Adobe Flash>
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes busy.
I: sink-input.c: Created input 10 "Flash Animation" on alsa_output.hw_0 with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
D: memblockq.c: memblockq requested: maxlength=132300, tlength=88200, base=4, prebuf=86436, minreq=1764
D: memblockq.c: memblockq sanitized: maxlength=132300, tlength=88200, base=4, prebuf=86436, minreq=1764
===========================================================================

7. Close pandora (flashplayer). Output from step-7:

===========================================================================
I: sink-input.c: Freeing output 10 "Flash Animation"
I: client.c: Freed 5 "Adobe Flash"
I: protocol-native.c: connection died.
===========================================================================

8. Attempt to play another track in xmms, which is still open from before hibernation. Results in same output as step-4 and does not play audio.

9. Close xmms. Output after closing xmms:

===========================================================================
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
I: sink-input.c: Freeing output 12 "ALSA Playback"
I: client.c: Freed 6 "ALSA plug-in [xmms]"
I: protocol-native.c: connection died.
I: module-suspend-on-idle.c: Sink alsa_output.hw_0 idle for too long, suspending ...
I: module-alsa-sink.c: Device suspended...
===========================================================================

10. Open xmms and play audio track. At this point all connections to PA are closed (note the device suspended line in step-9's output) and the track plays properly. Debug output from PA for this successfull output (this debug output includes closing xmms after successfully playing an mp3):

===========================================================================
I: client.c: Created 7 "Native client (UNIX socket client)"
I: protocol-native.c: Got credentials: uid=500 gid=500 success=1
I: protocol-native.c: Enabled SHM for new connection
I: client.c: Client 7 changed name from "Native client (UNIX socket client)" to "ALSA plug-in [xmms]"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
I: module-volume-restore.c: Restoring volume for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
I: module-alsa-sink.c: Trying resume...
I: module-alsa-sink.c: Resumed successfully...
I: module-alsa-sink.c: Starting playback.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes busy.
I: resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates.
D: resampler.c: Channel matrix:
D: resampler.c:        I00 
D: resampler.c:     +------
D: resampler.c: O00 | 1.000
D: resampler.c: O01 | 1.000
I: resampler.c: Using resampler 'copy'
I: resampler.c: Using s16le as working format.
I: sink-input.c: Created input 13 "ALSA Playback" on alsa_output.hw_0 with sample spec s16le 1ch 44100Hz and channel map mono
D: memblockq.c: memblockq requested: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: memblockq.c: memblockq sanitized: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
I: sink-input.c: Freeing output 13 "ALSA Playback"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
I: module-volume-restore.c: Restoring volume for <pulsecore/protocol-native.c$ALSA plug-in [xmms]>
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes busy.
I: resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates.
D: resampler.c: Channel matrix:
D: resampler.c:        I00 
D: resampler.c:     +------
D: resampler.c: O00 | 1.000
D: resampler.c: O01 | 1.000
I: resampler.c: Using resampler 'copy'
I: resampler.c: Using s16le as working format.
I: sink-input.c: Created input 14 "ALSA Playback" on alsa_output.hw_0 with sample spec s16le 1ch 44100Hz and channel map mono
D: memblockq.c: memblockq requested: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: memblockq.c: memblockq sanitized: maxlength=66150, tlength=44100, base=2, prebuf=39690, minreq=4410
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
D: module-suspend-on-idle.c: Sink alsa_output.hw_0 becomes idle.
I: sink-input.c: Freeing output 14 "ALSA Playback"
I: client.c: Freed 7 "ALSA plug-in [xmms]"
I: protocol-native.c: connection died.
I: module-suspend-on-idle.c: Sink alsa_output.hw_0 idle for too long, suspending ...
I: module-alsa-sink.c: Device suspended...
===========================================================================

Change History

Changed 4 years ago by theg33kb0y

  • keywords hibernate hibernation xmms flashplayer added

Changed 4 years ago by theg33kb0y

  • keywords no sound added

Changed 4 years ago by lennart

  • status changed from new to closed
  • resolution set to invalid

This is a bug in ALSA not in PA. The driver doesn't properly restart playback after a resume. Please contact upstream ALSA.

I will close this bug now. Feel free to reopen if it turns out that ALSA behaves correctly (which I am pretty sure it doesn't).

Changed 3 years ago by alexg

  • status changed from closed to reopened
  • resolution invalid deleted

I also experiment this problem.

Don't you think you could apply the same fix as VLC : https://trac.videolan.org/vlc/ticket/1286

Changed 3 years ago by alexg

Moreover on my ubuntu intrepid distrib, killing pulseaudio and restarting it make it work again (leaving alsa as is).

Changed 2 years ago by lennart

  • status changed from reopened to closed
  • resolution set to fixed
  • description modified (diff)

alexg, we handle ESTRPIPE properly in PA. And have done so since about ever. If Suspend doesn't work nonetheless this is usually a problem in the audio driver.

Note: See TracTickets for help on using tickets.