Bug 49875 - Sink is getting suspended due to being idle immediately, instead of after 5 second delay
Summary: Sink is getting suspended due to being idle immediately, instead of after 5 s...
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 11:24 UTC by Tanu Kaskinen
Modified: 2012-05-14 00:03 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
sink-input,source-output: Avoid unneccessary rate updates (2.26 KB, patch)
2012-05-14 00:03 UTC, Arun Raghavan
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tanu Kaskinen 2012-05-13 11:24:56 UTC
Log snippet:

( 310.717|   0.513) D: [alsa-sink] sink-input.c: Requesting rewind due to corking
( 310.717|   0.000) D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1b.0.analog-stereo becomes idle, timeout in 5 seconds.
( 310.722|   0.005) D: [alsa-sink] protocol-native.c: Requesting rewind due to rewrite.
( 310.723|   0.000) D: [alsa-sink] protocol-native.c: Requesting rewind due to rewrite.
( 310.726|   0.002) D: [pulseaudio] sink.c: Suspend cause of sink alsa_output.pci-0000_00_1b.0.analog-stereo is 0x0004, suspending
( 310.726|   0.000) I: [alsa-sink] alsa-sink.c: Device suspended...


As you can see from the timestamps, something suspends the sink too soon. 0x0004 is PA_SUSPEND_IDLE, so supposedly module-suspend-on-idle is working incorrectly. I don't have time to investigate this right now.

How to reproduce: at least I can reproduce this by pressing the right arrow (seek forward one minute) in Totem.
Comment 1 Wang Xingchao 2012-05-13 20:53:05 UTC
Hi Tank,

follow your steps to reproduce it but not the same result. pressing the right arrow in Totem and if the playing audio is short, it will pause the stream and following message:
==============
D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_02_02.0.analog-stereo becomes idle, timeout in 5 seconds.
I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_02_02.0.analog-stereo idle for too long, suspending ...
D: [pulseaudio] sink.c: Suspend cause of sink alsa_output.pci-0000_02_02.0.analog-stereo is 0x0004, suspending
===============

From your log i doubt it's not from normal timed_out callback, but from pa_sink_suspend() in sink.c. Because there's state change after "Requesting rewind due to
corking".


--xingchao
Comment 2 Arun Raghavan 2012-05-14 00:03:18 UTC
The following fix has been pushed:
8f540c6 sink-input,source-output: Avoid unneccessary rate updates
Comment 3 Arun Raghavan 2012-05-14 00:03:21 UTC
Created attachment 61595 [details] [review]
sink-input,source-output: Avoid unneccessary rate updates

This makes sure we only call sink/source update_rate() if the stream
being woken up has a sample spec that doesn't match the corresponding
device'.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.