Change Listening mode of media player

It would be great if changing the listening mode (Stereo, Auto Surround, Ext. Stereo,…) of a media player or AVR would be supported.

I use the Onkyo integration with HA and miss it.

I implemented such a feature for another platform and would like to have it in HA too.

Github link

It is supported for, eg, denon. Can’t see it in my onkyo, or in the source.

Would be great if you add it to onkyo! The underlying library seems to support it (and much more)

Does it? How is that presented?
AFAIK, HA only support selecting sources, not tweaking the output…

These are my attributes.

source_list:
  - AUX1
  - AUX2
  - Blu-ray
  - Bluetooth
  - CBL/SAT
  - CD
  - DVD
  - Favorites
  - Flickr
  - Game
  - Internet Radio
  - Media Player
  - Media Server
  - Online Music
  - Spotify
  - TV Audio
  - Tuner
  - iPod/USB
sound_mode_list:
  - MUSIC
  - MOVIE
  - GAME
  - AUTO
  - STANDARD
  - VIRTUAL
  - MATRIX
  - ROCK ARENA
  - JAZZ CLUB
  - VIDEO GAME
  - MONO MOVIE
  - DIRECT
  - PURE DIRECT
  - DOLBY DIGITAL
  - DTS SURROUND
  - AURO3D
  - MCH STEREO
  - STEREO
  - ALL ZONE STEREO
friendly_name: Family Room Amp
supported_features: 69004

Ok, and how do you actually apply a sound mode from HA?

In the ui, I’ll do a screenshot when not on tablet, or via the media_player.select_sound_mode service.

I note the docs say it is only available currently on denon and songpal Media Player - Home Assistant

Capture

1 Like

Thanks. I see indeed that there is a “SUPPORT_SELECT_SOUND_MODE” capability.
Will see to add that to onkyo. It would be an actual plus as changing the sound mode with the remote is a PITA :wink:

Very good of you, I look forward to that as I have both onkyo and denon. Testing if you need.

Happily.

There is no api to get a list of supported sound modes from the AVR, unfortunately, so I use a kind of baseline list, much like what is done for sources.
Likewise, you can also override the list the same way in YAML with sound_modes.

Code is at home-assistant/homeassistant/components/onkyo at onkyosoundmode · koying/home-assistant · GitHub
Don’t forget to add a “version” key in the manifest to test the code as a custom component.

Here is my attributes with the stock HA onkyo integration (HA 2022.3.6)

source_list:
  - TV
  - Bluray
  - Game
  - Aux1
  - Video 1
  - Video 2
  - Video 3
  - Video 4
  - Video 5
  - Video 6
  - Video 7
  - Radio
volume_level: 0.5625
is_volume_muted: false
source: Bluray
audio_information:
  format: ''
  input_frequency: ''
  input_channels: ''
  listening_mode: All Ch Stereo
  output_channels: 3.1 ch
  output_frequency: ''
video_information:
  input_resolution: UNKNOWN
  input_color_schema: ''
  input_color_depth: ''
  output_resolution: UNKNOWN
  output_color_schema: ''
  output_color_depth: ''
  picture_mode: Direct
video_out: yes,out
friendly_name: TX-NR515_0009B0CC1B8B
supported_features: 20364

And with your custom code (installed as a custom component) NB I have edited this as I mucked up the manifest.json, got it this time!)

source_list:
  - TV
  - Bluray
  - Game
  - Aux1
  - Video 1
  - Video 2
  - Video 3
  - Video 4
  - Video 5
  - Video 6
  - Video 7
  - Radio
sound_mode_list:
  - Stereo
  - Direct
  - Surround
  - Film
  - Musical
  - Orchestra
  - Unplugged
  - Studio Mix
  - TV Logic
  - All channels Stereo
  - Theatrical
  - Dolby Surround
  - DTS-X
  - Neo 6 Music
volume_level: 0.5625
is_volume_muted: false
source: Bluray
sound_mode: All channels Stereo
audio_information:
  format: ''
  input_frequency: ''
  input_channels: ''
  listening_mode: All Ch Stereo
  output_channels: 3.1 ch
  output_frequency: ''
video_information:
  input_resolution: UNKNOWN
  input_color_schema: ''
  input_color_depth: ''
  output_resolution: UNKNOWN
  output_color_schema: ''
  output_color_depth: ''
  picture_mode: Direct
video_out: yes,out
friendly_name: TX-NR515_0009B0CC1B8B
supported_features: 85900

@saxn-paule do you want to give it a try and see if it works on your system?

1 Like

As I said, what sound mode is shown as available is pretty much hardcoded.
What would be interesting to test:

  1. test if applying the available sound modes work as expected
  2. Identify missing ones on your devices
  3. Adapt the YAML configuration accordingly

The list of all sound modes across onkyo devices is available at onkyo-eiscp/commands/main/LMD.yaml at e9269e21b346a783dc4902b9003d7467a648695f · miracle2k/onkyo-eiscp · GitHub

The default list is

DEFAULT_SOUND_MODES = {
    "stereo": "Stereo",
    "direct": "Direct",
    "surround": "Surround",
    "film": "Film",
    "musical": "Musical",
    "orchestra": "Orchestra",
    "unplugged": "Unplugged",
    "studio-mix": "Studio Mix",
    "tv-logic": "TV Logic",
    "all-ch-stereo": "All channels Stereo",
    "theater-dimensional": "Theatrical",
    "dolby-surround": "Dolby Surround",
    "dts-x": "DTS-X",
    "neo-6-music": "Neo 6 Music",
}

If adaptation is needed, you’d have to do the same as what’s done for the source list: build your own with the key being one of the “name” in the github list above, and the value a description of your liking.

I’ll try it out more today if I get some time :slight_smile: Thanks for the great work.

Yes I would give it a try. How could I install your version?

Just adding the sound_mode_list doesn’t work as the config is invalid.

media_player:
  - platform: onkyo
    host: 192.168.0.195
    name: VSX-831
    sources:
      video2: 'HTPC'
      tv: 'TV'
    sound_mode_list:
      - Stereo
      - Direct
      - Surround
      - All channels Stereo

It is @koying 's code. Install it as a custom component.

  1. Copy from koying’s repo the directory onkyo and everything below it to your custom_components directory.

  2. Add a version key to manifest.json

  3. Restart.

1 Like

Mhh doesn’t seem to work. It isn’t listed in custom components:

And also not listed in the installable repos list:

Custom component is in place, version added to manifest.json and HA restarted.
image

Did you read my post! Do so. Nothing to do with HACS.

Yes. Please see my last screenshot. I copied the onkyo folder from github into the custom_component folder of my HA installation, added a version entry to manifest.json and restarted HA.

So after restarting ha, is it working?