Bug 2890 - sleep cuts sound early, but then continues
: sleep cuts sound early, but then continues
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 6.2.2
: PC Windows (legacy)
: P2 normal (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-29 16:27 UTC by Scott
Modified: 2006-02-01 08:49 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2006-01-29 16:27:11 UTC
I used CLI to send a sleep command. A few seconds ahead of the end, the sound began to fade - all well and good. But

1) The server sent a power off when the volume was still at around 17%.

2) When I followed it up with a play command, the music started up again, but at 17% volume, and then it continued to fade to 0%. 

Off should follow volume 0; at the end of the sleep, volume should be reset to where it was before the fade; and it definitely should not continue to fade after a subsequent play.
Comment 1 KDF 2006-01-30 02:18:45 UTC
fred, is this a problem with the sleep timers?
Comment 2 Fred 2006-01-30 03:51:40 UTC
Try 5949 (next nightly). It should be fixed. If not please enable d_command, replicate and send us the log.
Comment 3 Fred 2006-01-31 19:13:54 UTC
Can anyone confirm this is fixed?
Comment 4 Scott 2006-02-01 06:53:42 UTC
It's much better now. The only slight oddity is -
1. I set the volume to 100%
2. I set the sleep timer to 60 seconds
3. The song starts to fade. (There's something wrong with softsqueeze or the server when it comes to fading - the last few steps into silence are abrupt  changes in volume, not a smooth fade. Smaller, faster steps at the end, please!)
4. We get to silence, and the player goes off a few seconds after.

That's all good. Then I click Play to see how it picks up.

5. The music starts. But not at 100%. It's closer to ~95% volume, according to the status command. Why?

It's a trivial thing and I can live with this as is. Thanks!
Comment 5 Fred 2006-02-01 08:05:16 UTC
Can't reproduce your scenario, but got once no sound at all using play and Softsqueze? Could not reproduce any of it on a real player (a SliMP3, for the record).

A real player has a much smoother fade than SoftSqueeze, but it remains the fade is essentially linear. Any psycho-acoustic expert out there to improve this? Feel free to add a (different) enhancement request for this. And if you can come up with pseudo code or mathematical formulas, I may find it fun to try and "port" that in the server...
Comment 6 Scott 2006-02-01 08:49:57 UTC
> Any psycho-acoustic expert out there to improve
this? Feel free to add a (different) enhancement request for this. And if you
can come up with pseudo code or mathematical formulas, I may find it fun to try
and "port" that in the server..

It's probably not worth it - it's hard to do right and few speakers are linear at very low levels anyway, let alone ears. 

Plus, fade has two purposes - 1) get rid of the music in a satisfying, slow way; 2) get rid of the music in a way that won't wake me back up just as I'm drifting off.

For 1), linear or cosine is fine. For 2) you want to give the sense that the music source is *moving away*, which means that you fade the source exponentially, AND (towards the end) progressively cut out more and more high frequencies, until at the end you're essentially doing a lowpass filter of 200Hz or so. Lots of work, and weird if you happen to be wide awake and listening.

Try cos(PI * (t - x) / t) / 2 + 0.5 where x is the number of seconds left in the fade (never less than 0) and t is the total length of the fade. Honestly, linear's probably just as good.