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

Songal - changing input #22116

Closed
e-krebs opened this issue Mar 16, 2019 · 10 comments
Closed

Songal - changing input #22116

e-krebs opened this issue Mar 16, 2019 · 10 comments

Comments

@e-krebs
Copy link

e-krebs commented Mar 16, 2019

Home Assistant release with the issue: 0.89.2

Last working Home Assistant release (if known): not known, it's been here for a while

Operating environment (Hass.io/Docker/Windows/etc.): hass.io

Component/platform: songpal

Description of problem:
I'm using a Sony SRS-X77 speaker.
From home-assistant, when switching the input (for example from Bluetooth Audio to Audio in):

  • the media_player entity becomes unavailable in home assistant for around 10 seconds,
  • however, the device itself behaves as asked,
  • the two logs below (in the Traceback section) appear.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

media_player:
  - platform: songpal
    name: sony_bureau
    endpoint: !secret endpoint_songpal_bureau

endpoint_songpal_bureau looks like : http://192.168.xx.xxx:54480/sony

Traceback (if applicable):

_18:21 __main__.py (WARNING)_
Got unknowns for ContentChange: {'parentUri': '', 'stateInfo': {'state': ''}} - please create an issue!
_18:21 components/media_player/songpal.py (ERROR)_
Got disconnected with Unable to make a request: 'extInput:line': None, trying to reconnect.

Additional information:
In an older version of home assistant (not showing anymore), I used to saw log mentioning that it got two versions (1.0 & 1.1 if I remember correctly), and that it used the first version (which is NOT the latest).
This may not be related, though.

@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@e-krebs
Copy link
Author

e-krebs commented Jul 7, 2019

the issue still exists with the latest version of home assistant: 0.95.4

@stale stale bot removed the stale label Jul 7, 2019
@rytilahti
Copy link
Member

Could you please enable debug logging for the songpal library and this integration, and post a log when this happens? That warning about unknowns is not the problem here. For some reason an exception is raised by the backend library (showing as 'extInput:line': None) is the real cause. This is potentially related to rytilahti/python-songpal#5 .

Also, your note about the used version is helpul, and I think the upstream library should do a better job sticking to the newest as announced by the device.

@rytilahti rytilahti self-assigned this Jul 8, 2019
@e-krebs
Copy link
Author

e-krebs commented Jul 14, 2019

hi, I added the following to my config (and restarted):

logger:
  default: warn
  logs:
    homeassistant.components.songpal: debug

unfortunately, I didn't get more logging than in my first post :/
maybe the component namespace is wrong? but I don't know how to verify this.

@rytilahti
Copy link
Member

Add also songpal: debug and you will start seeing the communications with the device itself.

@e-krebs
Copy link
Author

e-krebs commented Jul 15, 2019

(I was looking at the wrong place)

switching from Audio In to Bluetooth Audio, I got:

2019-07-15 20:32:46 DEBUG (MainThread) [songpal.service] setPlayContent got called with args (()) kwargs ({'uri': 'extInput:btAudio'})
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.method] Got no response, assuming success
2019-07-15 20:32:46 WARNING (MainThread) [songpal.containers] Got unknowns for ContentChange: {'parentUri': '', 'stateInfo': {'state': ''}} - please create an issue!
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.containers] Missing key service with no default for ContentChange
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.containers] Missing key applicationName with no default for ContentChange
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.service] Got notification: ContentChange(contentKind='input', service=None, source='extInput:btAudio', uri='extInput:btAudio', applicationName=None)
2019-07-15 20:32:46 DEBUG (MainThread) [homeassistant.components.songpal.media_player] Source changed: ContentChange(contentKind='input', service=None, source='extInput:btAudio', uri='extInput:btAudio', applicationName=None)
2019-07-15 20:32:46 DEBUG (MainThread) [homeassistant.components.songpal.media_player] New active source: Bluetooth Audio (uri: extInput:btAudio)
2019-07-15 20:32:46 WARNING (MainThread) [songpal.service] Got unknown notification type: notifyAvailablePlaybackFunction
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.service] Got notification: None
2019-07-15 20:32:46 DEBUG (MainThread) [songpal.device] No callbacks for None

@rytilahti
Copy link
Member

Does it come unavailable when doing that? I don't see the error there, so I'm wondering what'd cause it to become unavailable...

Also, does that happen always or does it just happen when changing to some specific input? Is the issue I linked above potentially related to ths issue?

@e-krebs
Copy link
Author

e-krebs commented Jul 18, 2019

indeed, the error is different, but the result is the same: the media_player entity becomes unavailable.

it happens for all inputs.
actually, it even happens on HA when changing the input directly on the device.

@rytilahti
Copy link
Member

rytilahti commented Jul 18, 2019

I understand, but in order to fix it I have to see where it goes wrong, otherwise it would be just guessing why this happens. The cause itself is that the request causes an unexpected error when calling the method to change the input, any unexpected errors will be raised as exceptions in which case the availability is set to unavailable.

It could very well be, that the implementation is trying to use the 1.1 version of parameters while calling the 1.0 version of the API.

Could you run songpal dump-devinfo somefile.json and compare it to https://github.com/rytilahti/python-songpal/blob/master/devinfos/SRS-X77.json ? setPlayContent under avContent service is the one that is being used to change the input: https://github.com/rytilahti/python-songpal/blob/master/devinfos/SRS-X77.json#L1085 (https://github.com/rytilahti/python-songpal/blob/master/songpal/containers.py#L382 is where it is called.)

This code path has stayed stable for quite long, only thing that has changed was the added support for zones (rytilahti/python-songpal#42) which changed the method call to contain the output parameter.. The best way to figure out if that's the problem would be changing the call not to have the output parameter, or simply downgrading python-songpal to 0.0.9 not having this feature, and playing around with the console tool.

balloob pushed a commit that referenced this issue Oct 10, 2019
Fixes #24269 and fixes #26776 - potentially also #22116
balloob pushed a commit that referenced this issue Oct 13, 2019
Fixes #24269 and fixes #26776 - potentially also #22116
@stale
Copy link

stale bot commented Oct 16, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 16, 2019
@stale stale bot closed this as completed Oct 23, 2019
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

3 participants