All of lore.kernel.org
 help / color / mirror / Atom feed
* snd-hda-intel+dmix: Disabling power save doesn't work
@ 2012-05-07  2:19 Adam Nielsen
  2012-05-08  5:37 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Nielsen @ 2012-05-07  2:19 UTC (permalink / raw)
  To: alsa-devel

Hi all,

I'm trying to hunt down a bug in either dmix or the snd-hda-intel module and 
I'm hoping someone can give me some pointers.

When I am playing audio and I pause playback, the codec goes into power save 
and stops generating a SPDIF signal.  My amplifier then displays a 'signal 
lost' message.  This is quite annoying as it takes a few seconds to sync when 
the signal returns (during which time I can't hear the audio being played), so 
I set "powersave=0" to disable this behaviour.

This works as expected when stopping playback, but if I only *pause* playback 
then the signal drops almost exactly one second later, no matter what 
"powersave" is set to.  So of course then resuming playback means I lose a 
couple of seconds of audio while the amplifier re-syncs to the SPDIF signal.

Setting powersave to other values only affects the time before going into 
powersave mode after playback has stopped.  It has no effect on whether power 
saving is activated while paused.

The problem happens with any audio program (e.g. mplayer and xmms2.)  Setting 
"powersave=0" means the SPDIF signal keeps going when stopping playback, but 
it still drops after one second when pausing playback.

It doesn't happen if I use hw:0,1 as the output device (the SPDIF signal keeps 
going, even when paused) but as soon as I change the output device to dmix 
then the signal drops whenever the audio is paused.

Is there any way to stop this behaviour and make dmix honour the module setting?

Thanks,
Adam.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: snd-hda-intel+dmix: Disabling power save doesn't work
  2012-05-07  2:19 snd-hda-intel+dmix: Disabling power save doesn't work Adam Nielsen
@ 2012-05-08  5:37 ` Takashi Iwai
  2012-05-08 10:19   ` Adam Nielsen
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2012-05-08  5:37 UTC (permalink / raw)
  To: Adam Nielsen; +Cc: alsa-devel

At Mon, 07 May 2012 12:19:37 +1000,
Adam Nielsen wrote:
> 
> Hi all,
> 
> I'm trying to hunt down a bug in either dmix or the snd-hda-intel module and 
> I'm hoping someone can give me some pointers.
> 
> When I am playing audio and I pause playback, the codec goes into power save 
> and stops generating a SPDIF signal.  My amplifier then displays a 'signal 
> lost' message.  This is quite annoying as it takes a few seconds to sync when 
> the signal returns (during which time I can't hear the audio being played), so 
> I set "powersave=0" to disable this behaviour.
> 
> This works as expected when stopping playback, but if I only *pause* playback 
> then the signal drops almost exactly one second later, no matter what 
> "powersave" is set to.  So of course then resuming playback means I lose a 
> couple of seconds of audio while the amplifier re-syncs to the SPDIF signal.

Check the powersave option value when this happens.  The system such as
power-utils script may change the parameter by itself.

> Setting powersave to other values only affects the time before going into 
> powersave mode after playback has stopped.  It has no effect on whether power 
> saving is activated while paused.
> 
> The problem happens with any audio program (e.g. mplayer and xmms2.)  Setting 
> "powersave=0" means the SPDIF signal keeps going when stopping playback, but 
> it still drops after one second when pausing playback.
> 
> It doesn't happen if I use hw:0,1 as the output device (the SPDIF signal keeps 
> going, even when paused) but as soon as I change the output device to dmix 
> then the signal drops whenever the audio is paused.

It's weird becauase the pause function isn't implemented in dmix at
all.  Thus it's application's own behavior how to pause the stream.
Usually the application stops the stream like a normal stop then
restarts from the position manually.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: snd-hda-intel+dmix: Disabling power save doesn't work
  2012-05-08  5:37 ` Takashi Iwai
@ 2012-05-08 10:19   ` Adam Nielsen
  2012-05-08 10:31     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Nielsen @ 2012-05-08 10:19 UTC (permalink / raw)
  To: alsa-devel

>> This works as expected when stopping playback, but if I only *pause* playback
>> then the signal drops almost exactly one second later, no matter what
>> "powersave" is set to.  So of course then resuming playback means I lose a
>> couple of seconds of audio while the amplifier re-syncs to the SPDIF signal.
>
> Check the powersave option value when this happens.  The system such as
> power-utils script may change the parameter by itself.

Thanks for the quick reply!  I checked this and there was no change.  Before, 
during and after playback, the module options haven't changed.

>> It doesn't happen if I use hw:0,1 as the output device (the SPDIF signal keeps
>> going, even when paused) but as soon as I change the output device to dmix
>> then the signal drops whenever the audio is paused.
>
> It's weird becauase the pause function isn't implemented in dmix at
> all.  Thus it's application's own behavior how to pause the stream.
> Usually the application stops the stream like a normal stop then
> restarts from the position manually.

Upon more experimentation I have noticed that the SPDIF signal also drops out 
during silent sections of audio.  If there's a 100% quiet part of a film or 
movie I'm watching with mplayer or another program, during the silent sections 
the signal drops out and I again miss a few seconds when they start speaking 
again.

I now realise this has been happening for a long time, as I created a .wav 
file containing 60 seconds of very quiet white noise a few years ago.  I play 
this in a loop in the background whenever I want to prevent the powersave from 
kicking in in the silent parts when I'm watching a movie.

It seems that this happens regardless of the output device - hw:0,1 or dmix 
both drop out during silent sections.  I have double-checked during pausing 
though, and as before hw:0,1 keeps going during a pause while dmix drops out.

Is dmix closing its output PCM stream when all input streams are paused or 
silent?  I'm not sure what else would cause this behaviour.

Thanks again,
Adam.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: snd-hda-intel+dmix: Disabling power save doesn't work
  2012-05-08 10:19   ` Adam Nielsen
@ 2012-05-08 10:31     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2012-05-08 10:31 UTC (permalink / raw)
  To: Adam Nielsen; +Cc: alsa-devel

At Tue, 08 May 2012 20:19:56 +1000,
Adam Nielsen wrote:
> 
> >> This works as expected when stopping playback, but if I only *pause* playback
> >> then the signal drops almost exactly one second later, no matter what
> >> "powersave" is set to.  So of course then resuming playback means I lose a
> >> couple of seconds of audio while the amplifier re-syncs to the SPDIF signal.
> >
> > Check the powersave option value when this happens.  The system such as
> > power-utils script may change the parameter by itself.
> 
> Thanks for the quick reply!  I checked this and there was no change.  Before, 
> during and after playback, the module options haven't changed.
> 
> >> It doesn't happen if I use hw:0,1 as the output device (the SPDIF signal keeps
> >> going, even when paused) but as soon as I change the output device to dmix
> >> then the signal drops whenever the audio is paused.
> >
> > It's weird becauase the pause function isn't implemented in dmix at
> > all.  Thus it's application's own behavior how to pause the stream.
> > Usually the application stops the stream like a normal stop then
> > restarts from the position manually.
> 
> Upon more experimentation I have noticed that the SPDIF signal also drops out 
> during silent sections of audio.  If there's a 100% quiet part of a film or 
> movie I'm watching with mplayer or another program, during the silent sections 
> the signal drops out and I again miss a few seconds when they start speaking 
> again.
> 
> I now realise this has been happening for a long time, as I created a .wav 
> file containing 60 seconds of very quiet white noise a few years ago.  I play 
> this in a loop in the background whenever I want to prevent the powersave from 
> kicking in in the silent parts when I'm watching a movie.
> 
> It seems that this happens regardless of the output device - hw:0,1 or dmix 
> both drop out during silent sections.  I have double-checked during pausing 
> though, and as before hw:0,1 keeps going during a pause while dmix drops out.
> 
> Is dmix closing its output PCM stream when all input streams are paused or 
> silent?  I'm not sure what else would cause this behaviour.

Well, maybe the difference is the support of PAUSE operation.
The hardware driver itself supports the pause operation.  Thus, if you
access via hw:0,1, the app just uses the hardware pause feature.  In
this case, the device is still opened, thus no power-saving is done.

OTOH, dmix provides no pause feature, thus the app stops (and often
closes) the stream once.  Thus the pause is not pause in this case.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-08 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07  2:19 snd-hda-intel+dmix: Disabling power save doesn't work Adam Nielsen
2012-05-08  5:37 ` Takashi Iwai
2012-05-08 10:19   ` Adam Nielsen
2012-05-08 10:31     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.