Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAYBAR | Switching between TV Audio and Music #148

Closed
amitgandhinz opened this issue Dec 11, 2016 · 7 comments
Closed

PLAYBAR | Switching between TV Audio and Music #148

amitgandhinz opened this issue Dec 11, 2016 · 7 comments

Comments

@amitgandhinz
Copy link

amitgandhinz commented Dec 11, 2016

Has anyone looked into the ability to programmatically switch the Audio streams on the Playbar?

When using functions such as play and stop, they will only work when the Playbar is in Music mode. While in TV mode with the audio in line, it will return a 500.

Basically I want to be able to call play() and have the sonos switch to audio mode and start playing the queue/playlist. When I stop, i would like it to switch back to the TV audio input.

This issue may be related to #142 but not sure as they have not indicated what sonos device they are using.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39944978-playbar-switching-between-tv-audio-and-music?utm_campaign=plugin&utm_content=tracker%2F276575&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F276575&utm_medium=issues&utm_source=github).
@bencevans
Copy link
Owner

Aaah yes, this may well be the background to #142!

Support for switching manually too would also be great.

@amitgandhinz
Copy link
Author

im going to see what i can find out here.

just noting helpful hints here as i investigate how to switch the input

@ebaauw
Copy link
Contributor

ebaauw commented Dec 17, 2016

When the Playbar is in TV mode it doesn't accept Play nor Pause, Next, ..., hence the 500 error code. The Sonos app disables these controls when in TV mode.

When in TV mode, the Playbar plays a stream of type x-sonos-htastream. This is different from the audio in of a Play:5 or Connect, which are of type x-rincon-stream. As far as I can tell, the only way to get the Playbar out of TV mode is to select a different music source through the SetAVTransportURI action in the AVTransport service.

By selecting TV Autoplay in TV Setup under the Room Settings of the Sonos app, the Playbar switches automatically to TV mode, when it detects input on the optical audio interface. No need to switch back to TV mode on Stop. This setting can be accessed through the Playbar's HTControl service.

svrooij pushed a commit to svrooij/node-sonos that referenced this issue Jan 3, 2018
This is only possible since the pull-request bencevans#200
Should clearify bencevans#148
@svrooij
Copy link
Collaborator

svrooij commented Jan 3, 2018

The latest version (v0.20.0) has direct access to the SetAVTransportURI through sonos.playWithoutQueue(uri) so that can be used to switch to TV/line-in mode as shown in this sample.

I think getting out of the TV mode, requires you to select the queue with sonos.selectQueue or by starting a TuneIn/Spotify radio station.

I also think issue can be closed because we have a working sample at this moment. Feel free if you think, this issue isn’t solved completely.

@svrooij svrooij closed this as completed Jan 3, 2018
@MikaAK
Copy link

MikaAK commented Apr 7, 2018

Is there a solution to this? I tried the code from the example and was still hit with 500 errors

@svrooij
Copy link
Collaborator

svrooij commented Apr 7, 2018

Could you create a new issue for your problem. We set-up an issue template that helps us solving issues faster.

Without the output of some example it is really hard to diagnose the problem.

@MikaAK
Copy link

MikaAK commented Apr 7, 2018

For sure! I just didn't want to create a new issue for an old one before asking 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants