Bug 8146 - Allow software selection of headphone vs speaker output
: Allow software selection of headphone vs speaker output
Status: CLOSED FIXED
Product: SB Boom
Classification: Unclassified
Component: Hardware
: unspecified
: All All
: -- normal (vote)
: 7.3
Assigned To: Squeezebox QA Team email alias
http://forums.slimdevices.com/showthr...
:
Depends on: 10808
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-14 08:45 UTC by Max Spicer
Modified: 2009-09-08 09:25 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
Patch to only switch line-out mode to sub if line out is connected (1.09 KB, patch)
2008-08-29 07:25 UTC, Max Spicer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Spicer 2008-05-14 08:45:54 UTC
A user has requested in the forums that they be able to go to sleep listening to the Boom through their headphones but be woken up by the Boom alarm playing through the speakers.  They can't just fall asleep with the Boom playing quietly as this would disturb their partner in the same bed, and the headphone levels would not be loud enough to wake them up in the morning once soundly asleep.   http://forums.slimdevices.com/showthread.php?p=301766

This would require that the Alarm code could request that the Boom output through the speakers despite the fact that the headphones may be plugged in.  It would definitely have to be an option under Alarm, assuming it's possible.
Comment 1 KDF 2008-05-14 09:06:02 UTC
simply have the alarm code turn off the headphone/nospeaker flag when the alarm goes off.  no sense in having an alarm through headphones
Comment 2 Caleb Crome 2008-05-14 12:01:33 UTC
This makes sense to me.  This is how I will use it too.

-Caleb
Comment 3 Max Spicer 2008-05-25 07:50:22 UTC
R20169 changes the alarm clock to set analogOutMode to sub during the alarm.  This forces output through the speakers.  However, this could also means that audio playback sounds a bit odd during an alarm with headphones plugged in as the boom itself will assumedly be producing less bass as it thinks it has a sub.  What do you reckon, Caleb?
Comment 4 Caleb Crome 2008-05-25 11:19:31 UTC
We have complete control over how audio comes out.  Let's define a state machine that will describe all the different states and transitions between states.  It will take some time to flesh out I think, but it will help us clarify behavior.  

Internally to the ip3k is a bit of ugly code controlling the DAC that needs some rework, so we should sweep this all together in one go.  

An initial set of states are:

1) Uninitialized
2) Headphone mode
3) Subwoofer mode
4) Headphone mode, alarm ringing
5) Sub mode, alarm ringing.

Events are:
a) sleep mode activated
b) alarm activated
c) headphone/sub removal
d) alarm deactivated
e) snooze activated
f) headphone/sub insertion

I'm sure I'm missing some.  In any case, let's define all the states and transitions among them.

What have I missed?
Comment 5 Max Spicer 2008-05-26 08:07:28 UTC
A snooze can never be active unless an alarm is active and I don't think we'd ever want to treat snooze and alarm separately, so snooze can probably be ignored.  Audio is paused during a snooze, but that's more of a side effect.  You probably need events for the user changing the analog out preference.
Comment 6 Max Spicer 2008-06-05 07:45:06 UTC
We should try to allow for users to leave the headphones plugged in but to select in the software that output should go through the main speakers.  This could alleviate issues with the awkward placement of the headphone socket around the back - allowing users to leave the phones plugged in all the time.

When phones are plugged in and selected for output via the software, the alarm should still be able to override this and output through the main speakers instead.
Comment 7 Felix Mueller 2008-07-24 02:26:34 UTC
Line out mode can be changed from SC already and Boom fw 19 adds the 'line in' and 'line out' status in the slimproto STAT event so SC knows about it. (see bug 8701)
Comment 8 Felix Mueller 2008-07-24 07:54:00 UTC
I suggest moving this to a later release and mark it as enhancement as it already works but just isn't optimal.

What do you think, Caleb?
Comment 9 Max Spicer 2008-08-07 15:20:11 UTC
From campfire:

Max S.  	
Felix - at the moment when an alarm goes off it sets analogOutMode to sub-woofer, which I think means that alarms must sound very weird, as the output through the main speakers is designed to be supported by a sub. Could this be done better now? i.e. is it possible to know if headphones are plugged in and only change analogOutMode if they are? I guess the correct thing to do is only set analogOutMode to sub if it is currently set to headphones and headphones are currently plugged in.
Aug 6 	
5:05 AM
Felix M. 	
Max: Upcoming Boom fw 23 contains notification message if something is plugged into line in and/or line out so it should be possible to do what you suggest.
Aug 6 	
5:35 AM
Max S. 	
can you query it or do you have to track plugging in events?
Michael H. 	
there will be linOutConnected/lineInConnected
Michael H. 	
Andy already added stubs to Boom

The above should probably be done for 7.2 if I'm right about alarms lacking bass due to analogOutMode being set to sub.  I've never noticed this though, so maybe it's not a big issue or not an issue at all.  Could you comment, Caleb?

If this is wanted for 7.2 I can have a go.
Comment 10 Max Spicer 2008-08-29 07:25:15 UTC
Created attachment 3915 [details]
Patch to only switch line-out mode to sub if line out is connected

The attached patch only switches line-out to sub during an alarm if line out is connected.  This should in theory make alarms sound better for people with nothing connected to line-out.  It doesn't fix this bug, but I think is well worth including in 7.2.1.  I'm not 100% sure if I should just drop it in, so please let me know if you'd like it for 7.2 or 7.3.
Comment 11 Max Spicer 2008-09-05 07:44:58 UTC
Comment on attachment 3915 [details]
Patch to only switch line-out mode to sub if line out is connected

Patch checked in as change 23052.
Comment 12 James Richardson 2008-11-17 10:45:12 UTC
QA to validate patch then mark/comment appropriately.
Comment 13 James Richardson 2008-11-17 12:08:01 UTC
The patch appears to be working for me in 7.3.

Before alarm event, audio out = headphone
During alarm event, audio out = speaker, headphone silent
During snooze event, audio out = speaker, headphone silent
After alarm event, audio out = headphone

Marking bug a fixed.
Comment 14 James Richardson 2008-12-15 12:04:47 UTC
This bug has been fixed in the 7.3.0 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 15 Max Spicer 2009-02-06 14:18:34 UTC
Bug fixed properly via bug 10808.