home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.72k forks source link

Denon AVR Sound Mode mismatch between HA and the actual unit #121792

Open SodaWithoutSparkles opened 1 month ago

SodaWithoutSparkles commented 1 month ago

The problem

When using the "Denon AVR network recievers" integration with my AVR_X1600H, I discovered the following issue:

Method to reproduce:

  1. turn on the reciever and select DTS NEU:X as sound mode with IR remote
  2. via developer tools/service, call media_player.select_sound_mode on the unit with "DOLBY DIGITAL" as sound mode, observe that the unit actually changed to DSUR mode
  3. observe that the state attribute of the unit changes to:
    sound_mode: DOLBY DIGITAL
    sound_mode_raw: DOLBY AUDIO-DSUR
  4. select "DTS SURROUND" via the UI, notice the unit actually changes to DTS Neu:X mode
  5. observe that the state attribute of the unit changes to:
    sound_mode: DOLBY DIGITAL     <--- mismatch
    sound_mode_raw: NEURAL:X
  6. close the dialogue box on the UI and re-open it, observe the sound mode is still stuck at "DOLBY DIGITAL"

What version of Home Assistant Core has the issue?

core-2024.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Denon AVR network recievers

Link to integration documentation on our website

https://www.home-assistant.io/integrations/denonavr/

Diagnostics information

It does not provide diagnostic

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.denonavr.media_player
Source: components/denonavr/media_player.py:213
integration: Denon AVR Network Receivers (documentation, issues)
First occurred: July 11, 2024 at 10:02:36 PM (3 occurrences)
Last logged: July 11, 2024 at 10:35:41 PM

Denon AVR receiver at host 192.168.31.36 responded with HTTP 403 error. Device is unavailable. Please consider power cycling your receiver

Additional information

A reload does not fix the issue, so the 403 is likely not an issue.

Possibily related to #117255 , but I cannot find the relevant logs.

It is possible to transition from DTS-STEREO-DOLBY, but the sound mode is still wrong.

It is not possible to transition from DTS-DOLBY directly as it thinks it was in DOLBY already.

home-assistant[bot] commented 1 month ago

Hey there @ol-iver, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (denonavr) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `denonavr` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign denonavr` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


denonavr documentation denonavr source (message by IssueLinks)

SodaWithoutSparkles commented 1 month ago

From my limited tests, I think the issue is incorrect mapping of NEURAL:X to DOLBY DIGITAL.

I will look through the code and see if I find anything

SodaWithoutSparkles commented 1 month ago

It seems that it was incorrectly mapped here. I can't find Dolby Neural:X on my unit, perhaps it would be unit-dependent?

https://github.com/ol-iver/denonavr/blob/a32de5979a4bda19e1e9b599fd895570af59e292/denonavr/const.py#L238-L249

Maybe it would be more approiate to check for NEURAL:X instead of DTS NEURAL:X?

https://github.com/ol-iver/denonavr/blob/a32de5979a4bda19e1e9b599fd895570af59e292/denonavr/const.py#L275-L279

Edit: sorry cant get the embedded code snippets to work