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

Support switch to Line In and TV #106

Open
neophob opened this issue Oct 20, 2017 · 6 comments
Open

Support switch to Line In and TV #106

neophob opened this issue Oct 20, 2017 · 6 comments

Comments

@neophob
Copy link

neophob commented Oct 20, 2017

I use a Playbar which is connected to my TV. After the configuration step, I can select "TV" in the Sonos app - which uses the optical input from the tv.

Looks like at the moment, sonos-discovery does not support switching to this input, which would be very handy.

do you have an idea how to implement that?

edit: looks like Soco implement this feature: https://github.com/SoCo/SoCo/blob/06a5e758f65dcb920f72b21353094b468173fa77/soco/core.py#L1077 and https://github.com/SoCo/SoCo/blob/06a5e758f65dcb920f72b21353094b468173fa77/soco/core.py#L1140

@neophob neophob changed the title Support switch to linein Support switch to Line In and TV Oct 20, 2017
@jishi
Copy link
Owner

jishi commented Oct 20, 2017

Yeah, just setting the the source to the optical input is really simple, the tricky part is to know whether the player has an optical in or a regular line in since the action you need to invoke will differ.

See jishi/node-sonos-http-api#109 for a longer discussion about the problem.

The preferable way would be to listen for events that would expose whether the player has spdif or line-in, and preferably also if it is connected or not. I know the regular line-in does announce it, and I would be surprised of the PLAYBAR/PLAYBASE didn't do the same.

I have been meaning to look into it, but haven't gotten around to it. It also helps if I have a PLAYBAR around (which I don't have at home).

@neophob
Copy link
Author

neophob commented Oct 20, 2017

thanks for the quick feedback. maybe it make sense to split your request up in two different issues: 1) switch to tvin and linein and 2) detect model.
then the application which use this library is responsible to limit the access to certain calls.

@neophob
Copy link
Author

neophob commented Oct 25, 2017

any thought @jishi ?

@jishi
Copy link
Owner

jishi commented Oct 25, 2017

Having different methods for line-in and spdif-in would be easy to solve, but would be very confusing since you can select a line-in from another device. That would mean that you need to call the correct method depending on which src player you are using, which I assume feels totally backwards. My goal is always to keep it as simple as possible.

However, if you would really need this functionality right now, it's easily implemented. On another note, it is already possible using the setAVTransport() however you would need to create the uri yourself from the player UUID.

@neophob
Copy link
Author

neophob commented Oct 25, 2017

Thanks for the hint about the setAVTransport() workaround.

about

That would mean that you need to call the correct method depending on which src player you are using

for example the playbar has two distinct inputs if I'm not wrong. so the the application should know which input to choose. but i don't know how sonos handles this internally, I guess they map the correct input depending on your configuration.

@jishi
Copy link
Owner

jishi commented Oct 25, 2017

It has two? One spdif and one analogue? Yeah, I'm guessing you have told it which one it uses, but I also think it knows which one is connected, so the only confusion would be if you have two inputs connected simulatenously.

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

No branches or pull requests

2 participants