peteS-UK / emotiva

Home Assistant Media Player for Emotiva Processors
Other
1 stars 1 forks source link

Suddenly stopped working #6

Closed dlmorgan999 closed 2 weeks ago

dlmorgan999 commented 3 weeks ago

I had been using the previous version of your integration and then yesterday I found this one. I'm very happy to get the media player support - it makes my automations (which cover multiple receivers) much easier.

I had this all working well, and then all of a sudden it stopped working. The device says the RMC-1 is off, and trying to turn it on does nothing. When I click the Remote slider, it turns on and then immediately turns off again.

I restarted Home Assistant, I removed and re-added the integration, and I hard power cycled the RMC-1 and that made no difference.

The iOS app is able to control the RMC-1 with no issues. Any ideas on what's going on, or what I can do to troubleshoot?

peteS-UK commented 3 weeks ago

Hi @dlmorgan999 . Yes, that's the reason I wanted to do the media player - I have different receivers as well and it makes it much easier to just have everything as media players....

The remote slider doing that is what I'd expect if the integration isn't getting the right feedback from the rmc. I had one other person who had a similar problem where another integration (adb in their case) was interfering with background threads, but that was a really strange one.

First steps would be turn on debug logging (on the device) and then reload the integration and try turning the rmc on and off and then turn off debug logging - it'll give you the log file. Post that and I'll take a look.

dlmorgan999 commented 3 weeks ago

Thanks for the response. I've attached the debug log. I don't see any obvious smoking guns (maybe the unknown elements?), but maybe you'll see something I don't.

Also here's an interesting data point. As I was doing the testing to create the debug log, I noticed that the processor is actually getting turned on when I press the power button in HA - even though the HA UI still shows it as off. I am not able to turn it back off with the button in HA.

home-assistant_emotiva_2024-06-06T18-35-25.453Z.log

peteS-UK commented 3 weeks ago

Yes, I'd expect it to turn on but not off if it's not getting the notify. Basically the internal state in the integration reads feedback from the RMC, so if it's not getting the feedback correctly, it still thinks it's off, so won't turn it off again.

I'll take a look. Btw, you don't have more than 1 emo processor by any chance. That won't work currently as I can't test it, but I guess you don't as it wouldn't have worked at all I think.

dlmorgan999 commented 3 weeks ago

I have just the RMC-1. Let me know if there is anything else I can get to you to help troubleshoot this, or if you would like me to do any further testing.

peteS-UK commented 3 weeks ago

OK, I can see the problem (but not the cause). It's actually getting the responses OK, and parsing them (that's where it's listing the "unknown element" for elements not currently being tracked, but for some reason, it's not then making the callback to update the rmc state. If I send you a couple of files with some more debug, are you OK to ssh them into the custom components folder?

dlmorgan999 commented 3 weeks ago

I’m happy to copy debug files. 🙂On Jun 6, 2024, at 14:20, peteS-UK @.***> wrote: OK, I can see the problem (but not the cause). It's actually getting the responses OK, and parsing them (that's where it's listing the "unknown element" for elements not currently being tracked, but for some reason, it's not then making the callback to update the rmc state. If I send you a couple of files with some more debug, are you OK to ssh them into the custom components folder?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

peteS-UK commented 3 weeks ago

OK - overwrite these two in the custom_components/emotiva folder , restart HA (sorry, the integrations get loaded at boot, so you have to restart, not just reload the integration) and regather the logs. Just added a couple of quick messages to try and see what's not happening. debug.zip

dlmorgan999 commented 3 weeks ago

I was away from the house much of yesterday and didn't get those files installed. This morning when I woke up, I looked at the processor in HA, and all the attributes had values again (when it wasn't working, they were all "null").

I just did more testing with the processor, and it's all working again. I'm going to just use it for a few days, and if the problem reoccurs, I'll try to see if I can discern a pattern or something that triggered it.

If it does stop working again, I'll replace those files and send you the logs. If the problem doesn't happen again, I'll let you know. Thanks for the help!

On Thu, Jun 6, 2024 at 3:04 PM peteS-UK @.***> wrote:

OK - overwrite these two in the custom_components/emotiva folder and regather the logs. Just added a couple of quick messages to try and see what's not happening. debug.zip https://github.com/user-attachments/files/15686898/debug.zip

— Reply to this email directly, view it on GitHub https://github.com/peteS-UK/emotiva/issues/6#issuecomment-2153477419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2VNW4OAZ4FMQSALV4DTDLZGDMHZAVCNFSM6AAAAABI5DOCA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGQ3TONBRHE . You are receiving this because you were mentioned.Message ID: @.***>

peteS-UK commented 3 weeks ago

Hi @dlmorgan999 . When I was doing some testing, I saw the same problem in the logs when I was reloading the integration. It was a weird one to track down - running the notifier in its own class so I could in theory support multiple devices was creating a strange problem. Not sure if it was related to your problem, but it might have been. In any case, I'll post a new 1.7.2 in a few days once I've used it over the weekend. I suggest you pull this one when it's available as it may fix your problem, and it's definitely fixed another problem. If I get some time, I'll have another look at multiple devices as the current version will now defo only support a single emo processor, but I guess the audience of HA users who also have more than one emo processor is pretty small.

dlmorgan999 commented 3 weeks ago

Thanks a lot, Pete. Interesting to hear that you were seeing something similar. I'll definitely install the new version as soon as I see it, and let you know how it goes.

On Fri, Jun 7, 2024 at 3:37 PM peteS-UK @.***> wrote:

Hi @dlmorgan999 https://github.com/dlmorgan999 . When I was doing some testing, I saw the same problem in the logs when I was reloading the integration. It was a weird one to track down - running the notifier in its own class so I could in theory support multiple devices was creating a strange problem. Not sure if it was related to your problem, but it might have been. In any case, I'll post a new 1.7.2 in a few days once I've used it over the weekend. I suggest you pull this one when it's available as it may fix your problem, and it's definitely fixed another problem. If I get some time, I'll have another look at multiple devices as the current version will now defo only support a single emo processor, but I guess the audience of HA users who also have more than one emo processor is pretty small.

— Reply to this email directly, view it on GitHub https://github.com/peteS-UK/emotiva/issues/6#issuecomment-2155658354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2VNW62V3P2RFIILMJW2PDZGIYZLAVCNFSM6AAAAABI5DOCA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGY2TQMZVGQ . You are receiving this because you were mentioned.Message ID: @.***>

peteS-UK commented 3 weeks ago

I can only see it when I force a reload, but it might be a similar underlying cause to your problem. I'll ping a note here when I post it - assuming it doesn't cause me any problems over the weekend.

peteS-UK commented 3 weeks ago

HI @dlmorgan999 . I just posted 1.7.2. Fixes the reload issue for me. Give it a try when you get a chance, but not sure if your problem was the same. Reload will definitely have broken updates of state previously though.

dlmorgan999 commented 3 weeks ago

Thanks! I just installed it. I'll run it for a few days and let you know how it goes.

-- Dave

On Mon, Jun 10, 2024 at 1:06 PM peteS-UK @.***> wrote:

HI @dlmorgan999 https://github.com/dlmorgan999 . I just posted 1.7.2. Fixes the reload issue for me. Give it a try when you get a chance, but not sure if your problem was the same. Reload will definitely have broken updates of state previously though.

— Reply to this email directly, view it on GitHub https://github.com/peteS-UK/emotiva/issues/6#issuecomment-2159191276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2VNW2TDAQAJ23RLAYM65LZGYBL5AVCNFSM6AAAAABI5DOCA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJZGE4TCMRXGY . You are receiving this because you were mentioned.Message ID: @.***>

JoshMcWilson commented 2 weeks ago

Hi @peteS-UK , figured it might make more sense to add my update in this ticket since I am having hte same issue as well.

I installed the latest update today and it seems unfortunately the issue isn't completely resolved, at least for me.

I was able to turn the processor on and then off again through HA, then a couple hours later I was home for lunch and initiated my HT startup script. The processor turned on but didn't report the status change in HA. It was still responding to commands from HA such as changing HDMI inputs and such.

I restarted the integration and then the XMC-2 showed as "unavailable" which is the first time I've seen that happen. Then, I initiated my shut down script which turns everything off and the XMC-2 did turn off, but the state of the media player changed to "on" instead of unavailable at that time. I also noticed a new error in the logs which I've attached.

I may have some time this evening to do further testing if you'd like the debug logs.

Thanks! emo_log_error.txt

peteS-UK commented 2 weeks ago

Hi @JoshMcWilson. Well, that's actually good news. That error is around a sound mode ("Dolby ATMOS") that I haven't expected and is causing the crash. That one's easy to fix. If you want to edit it, change line 168 of emotiva.py to

                    "Dolby ATMOS": ["dolby", "mode_dolby", True],

The way they've implemented the mode names as just basically strings of text with no way to look them up and no linkage back to the actual modes is really crap.

If you can't edit it, I've attached the modified file in a .zip

emotiva.zip

Try this and let me know, but that should fix that problem. The DTS surround name may be wrong as well. These are the sorts of things I expected to need to tweak to get the XMC-2 and RMC running properly tbh.

JoshMcWilson commented 2 weeks ago

@peteS-UK knowing Emotiva that doesn't surprise me :)

Glad that was helpful, and thanks for the quick turn around!

I made the change and restart HA, so far it's looking good, but I've just been toggling the XMC-2 off and on remotely while I'm at work. I will test tonight and turn everything on so that I can do some further testing.

I'll let you know how it goes, thanks!

peteS-UK commented 2 weeks ago

@JoshMcWilson . That's good news. The problem is when you ask for the current mode, it gives you something like "Dolby ATMOS" (in this case), but if you try and set the mode, there's no such mode. It's actually 2 things - one call to set the mode to just "Dolby" and one set either "Movie" or "Music". The bit of text "Dolby ATMOS" is basically useless as an actual mode. I will take another look at doing the sound mode again but the API is really rubbish for this.

dlmorgan999 commented 2 weeks ago

I suspect I'm running into a similar issue. I just played with it for a bit. Initially, it was working great. Then I changed to some different content which I think changed the audio mode, and then I got into the same state where the commands were actually being executed, but the state wasn't updating in HA. The last value for "mode" was "Dolby Surround".

Additionally, the last time I tested this, I was having lots of problems trying to set the audio mode using the media player. I then tried to use send_command but that wasn't working either (I was trying to change between "Auto" (for movies) and "Stereo" (for music) modes).

On Wed, Jun 12, 2024 at 2:33 PM peteS-UK @.***> wrote:

@JoshMcWilson https://github.com/JoshMcWilson . That's good news. The problem is when you ask for the current mode, it gives you something like "Dolby ATMOS" (in this case), but if you try and set the mode, there's no such mode. It's actually 2 things - one call to set the mode to just "Dolby" and one set either "Movie" or "Music". The bit of text "Dolby ATMOS" is basically useless as an actual mode. I will take another look at doing the sound mode again but the API is really rubbish for this.

— Reply to this email directly, view it on GitHub https://github.com/peteS-UK/emotiva/issues/6#issuecomment-2163938742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2VNW22ZONC4BZHKKYSM4TZHC5CHAVCNFSM6AAAAABI5DOCA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTHEZTQNZUGI . You are receiving this because you were mentioned.Message ID: @.***>

dlmorgan999 commented 2 weeks ago

The plot thickens. I'm beginning to think that there may be some firmware bugs in the RMC-1 that are contributing to this. My processor is in an equipment room next to the theater, so I don't normally see it. However - as I was walking out of the theater, I glanced at the processor and it was showing some really strange values on the display.

After a bit, I decided to try power cycling it from the front, and it didn't respond at all (it stayed on). Eventually, I power cycled it using the switch on the back, and after it rebooted, the display was showing the correct values again. I have no idea what to make of this.

peteS-UK commented 2 weeks ago

I wonder if the API just doesn't work properly for the sound modes for XMC-2 and RMC - the API was written for the XMC-1 and hasn't been changed since. I guess some of the things (like setting the movie/music mode) just don't make sense for the later processors

I'm going to make some changes to the way the modes work - which will at least trap the errors so it doesn't crash, but also might improve things I think.

dlmorgan999 commented 2 weeks ago

Ok - thanks for all your work on this. It's really appreciated!

JoshMcWilson commented 2 weeks ago

Agreed! Having all of this functionality in HA is a huge game changer, thank you!

peteS-UK commented 2 weeks ago

OK @JoshMcWilson and @dlmorgan999 - give these a try... The modes in the media player will now show the same as the ones displayed on the screen, which I think will is nicer now and I've had to change the way things work anyway. The tricky bit is we now need a static list of all the mode names, since they're not in the api. If you pick a mode via the remote/ui etc. which isn't in the list at present, it should give you an error in the log "unknown sound mode" with the name of the mode, which I'll then add. I haven't been able to test it much, but I'll use it tonight and if you get a chance to try it out, let me know, and check the logs - it should be an error message, so you won't need to enable debug logging to see those "unknown" messages.

emotiva.zip

dlmorgan999 commented 2 weeks ago

Thanks much! I won't have time to test it today, but should be able to do so tomorrow. I'll keep you posted.

JoshMcWilson commented 2 weeks ago

So some good news, I put this through a torture test last night and overall it definitely was working more consistently! Unfortunately, the state of the XMC-2 did end up getting stuck on my very last shutdown of the system. I also had another issue, though not entirely sure if it was integration related, and may just be an issue with the unit itself.

I had power cycled the unit probably 10 times in total, and was changing inputs back and forth, trying to get my projector to sync (unrelated but just for context) and the unit did freeze up completely requiring a full power cycle.

But with that said, the entity did survive pretty much all of that, and then when I was done for the night I ran my shutdown script and it still is showing the unit is on and is not responding to commands any more.

Additionally, I noticed I kept seeing an error in HA, which I don't remember off hand, but something to the effect of the emotiva media player failed to send command. I would often see this after my phone had gone to locked and I'd pull HA back up and see that at the bottom of the screen.

Interestingly, at first all the sound modes displayed as I would expect, ie I could see the options for Dolby Atmos, DTSX, etc. But after a bit, the only ones that would show were those such as Direct, Auto, Surround, etc.

Anyways, it feels like we're getting closer, but due to the Emo API, or something, it still doesn't seem to be 100% yet. I didn't see anything in the HA logs when I had issues, but I also didn't turn on debugging, so can definitely do that if that would be helpful.

As always, thanks again for all you've done on this!

peteS-UK commented 2 weeks ago

So, that does sound better. With all of the power cycling, I do wonder if something had just got messed up on the unit - they're not the most stable in the world! If the state gets stuck, did you try reloading the integration - that should work now.

As part of the changes I made for the mode display, it's now only showing the modes which the processor thinks are applicable for the current source - the API gives me a flag to hide modes which don't make sense - e.g. Dolby ATMOS on a stereo signal etc.. I wondered if the weird problem @dlmorgan999 saw with his front panel was that you could try and select a mode which the processor thought was invalid. It ought to just ignore those commands, but I saw something odd when sending an invalid code to my xmc-1. So, if you weren't seeing Atmos when you had a stereo (or perhaps no) signal, it might be right.

I'd be curious how it behaves now in "normal" usage, but perhaps have debug on for now so we can try and keep and eye on anything odd. Also keen to know if we get any "unknown sound mode" messages in the log.

JoshMcWilson commented 2 weeks ago

I hadn't restarted the integration, just did and it's interesting, it seems the remote entity is no longer working, and the media player is still showing that it's powered on, but is not responsive to power commands:

image

Here is the only thing from the debug:

2024-06-14 11:06:31.858 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities media_player.emotivaprocessor are missing or not currently available

peteS-UK commented 2 weeks ago

Hmm - no idea what that one's caused by - that basically means loading remote.py crashed for some reason, but I haven't touch that one of late other than just some type stuff. I've reloaded mine a few times without any problems. Could you try the reload with debug enabled?

JoshMcWilson commented 2 weeks ago

Yes, very strange. That is actually the only ouput from debug whenever I enabled it and restarted the integration. I can send you the entire log file if it would be helpful, but I didn't see any other debug lines in it. I can restart HA completely and see what happens as a next step and try again.

After I restarted the integration is when the remote entity disappeared.

peteS-UK commented 2 weeks ago

Not very helpful of it. Could you give a restart of HA a try?

From: JoshMcWilson @.> Sent: Friday, June 14, 2024 5:43 PM To: peteS-UK/emotiva @.> Cc: peteS-UK @.>; Mention @.> Subject: Re: [peteS-UK/emotiva] Suddenly stopped working (Issue #6)

Yes, very strange. That is actually the only ouput from debug whenever I enabled it and restarted the integration. I can send you the entire log file if it would be helpful, but I didn't see any other debug lines in it. I can restart HA completely and see what happens as a next step and try again.

- Reply to this email directly, view it on GitHubhttps://github.com/peteS-UK/emotiva/issues/6#issuecomment-2168399986, or unsubscribehttps://github.com/notifications/unsubscribe-auth/API7QEP3XVYLQALLNGOKAQDZHMMQVAVCNFSM6AAAAABI5DOCA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYGM4TSOJYGY. You are receiving this because you were mentioned.Message ID: @.**@.>>

JoshMcWilson commented 2 weeks ago

Ok, restarted HA and it came back up. I did see this in the HA logs:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1354, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/emotiva/media_player.py", line 131, in async_added_to_hass await self._device.async_set_mode(self._device.mode) File "/config/custom_components/emotiva/emotiva.py", line 793, in async_set_mode raise InvalidModeError('Mode "%s" does not exist' % val) custom_components.emotiva.emotiva.InvalidModeError: Mode "Dolby Surround" does not exist

I will keep testing it to see if I can reproduce the issue.

peteS-UK commented 2 weeks ago

OK – that’s one of the sound mode missing things – although no idea how Dolby Surround got into the list for you to select if since I didn’t think it existed. Anyway, easy enough to add to the list. The annoying bit is that the underling mode command for all of the Dolby variants is actually the same, but just with lots of different bits of text displayed. If you say “what’s the mode” and get “Dolby ATMOS”, it’s bonkers that you can’t say “set the mode to Dolby ATMOS”, but hey ho.

If you want, add

                    "Dolby Surround": ["dolby", "mode_dolby", False],

to emotiva.py as a new line 170 - after

                    "dts Neural:X": ["dts", "mode_dts", False],

Now I'm dealing with the not available modes, I might be able to consolidate the list for all the processors into one longer list, but if you want to add that for now, it should get rid of that error.

peteS-UK commented 2 weeks ago

Ah - no, now I remember. I can't consolidate the list because the show/hide is done on the actual mode (e.g. just dolby), so if dolby is available (e.g. for me Dolby PLIIx), it also would show all Dolby Surround, Dolby ATMOS etc., and show PLIIx for you. Separate lists it is.....

JoshMcWilson commented 2 weeks ago

Gotcha, yeah that makes sense! Some more good news, that error did not appear after adding that line. Thanks for the quick response! I'll try and play around with it some more today and see what happens.

peteS-UK commented 2 weeks ago

I don't know which is the better way with the sound modes. Currently, I use the actual text, which is nicer from a UI perspective in some way. But, really there's only dolby as a mode and a command, with several text "tags" for it. I could just give a single mode "Dolby" and let the processor display the appropriate dolby mode for the current input type. But, that gives me trouble for the seperate Dolby PLIIx movie & music modes, which I don't think exist for later processors. If I display the "long" list with the actual text, you do have what are in effect seperate entries which duplicate each other, but they match up with the items you see in the screen.

What do you think? Which was do you both think is preferable?

peteS-UK commented 2 weeks ago

BTW

                    "Dolby Surround": ["dolby", "mode_dolby", False],

means

                    "Text mode display": ["command to send", "mode which contains name and visibility", current visibility (always force initially)],
dlmorgan999 commented 2 weeks ago

I've been testing the updated version for a few minutes, and so far everything is working very well. I did notice one thing so far. I updated another HACS integration and restarted HA. After I did that, the Emotiva integration said that the processor was off. I clicked the power button in HA and then the integration was in sync with the processor.

And one other thing that's specific to me, and that's that I have an "analog1" input. I'm using this for audio coming out of a high end DAC on a Raspberry Pi. I'm switching to it just fine using send_command, but I wondered if I could modify the media player code to support changing to that source (oddly, the only things I see on the Source list are HDMI 2, HDMI 6, HDMI 1, HDMI 4, and Balanced In)?

And that's a tough question, but my initial reaction is that using the "long list" for sound modes is a better user experience.

peteS-UK commented 2 weeks ago

Hmm - not sure why the integration wouldn't have seen the state on restart - the initial subscribe should have got the state, but I've seen it take a moment or two sometimes. It may be that the unsubscribe failed when you restarted, so the rmc didn't know to resend the notify. Anyway, as you say, doing anything makes the processor send out a status update so easy to get back in sync.

The source list is read from the processor, but it's the subscribe action that sends that, so it could be linked to the power thing above. Try turning on debug and reloading the integrtion. You should see something like ...

<?xml version="1.0" encoding="utf-8"?>
<emotivaSubscription protocol="3.0">
<property name="input_4" value="HDMI 4" visible="true" status="ack"/>
<property name="zone2_power" value="Off" visible="true" status="ack"/>
<property name="video_format" value="1080P/60" visible="true" status="ack"/>
<property name="input_1" value="SKY " visible="true" status="ack"/>
<property name="audio_input" value="HDMI 1" visible="true" status="ack"/>
<property name="power" value="Off" visible="true" status="ack"/>
<property name="input_2" value="OPPO " visible="true" status="ack"/>
<property name="input_6" value="" visible="false" status="ack"/>
<property name="input_8" value="TV Audio " visible="true" status="ack"/>
<property name="volume" value="-26.0" visible="true" status="ack"/>
<property name="audio_bitstream" value="PCM 2.0" visible="true" status="ack"/>
<property name="input_3" value="Squeezebox" visible="true" status="ack"/>
<property name="mode" value="PLIIx Movie" visible="true" status="ack"/>
<property name="input_5" value="Coax 2" visible="true" status="ack"/>
<property name="input_7" value="BalancedIn" visible="true" status="ack"/>
<property name="source" value="SKY " visible="true" status="ack"/>
<property name="video_input" value="HDMI 1" visible="true" status="ack"/>
</emotivaSubscription>

The input_ lines show the inputs that should be visible.

dlmorgan999 commented 2 weeks ago

Here's my log output:

2024-06-15 14:55:31.596 DEBUG (MainThread) [custom_components.emotiva.emotiva] _udp_client received: 
<?xml version="1.0" encoding="utf-8"?>
<emotivaUnsubscribe protocol="3.0">
  <mode status="ack"/>
  <input_2 status="ack"/>
  <zone2_power status="ack"/>
  <input_6 status="ack"/>
  <input_1 status="ack"/>
  <volume status="ack"/>
  <input_4 status="ack"/>
  <input_7 status="ack"/>
  <audio_bitstream status="ack"/>
  <video_format status="ack"/>
  <input_8 status="ack"/>
  <input_5 status="ack"/>
  <power status="ack"/>
  <video_input status="ack"/>
  <input_3 status="ack"/>
  <audio_input status="ack"/>
  <source status="ack"/>
</emotivaUnsubscribe>

2024-06-15 14:55:31.597 DEBUG (MainThread) [custom_components.emotiva.emotiva] _handle_status called
2024-06-15 14:55:31.598 DEBUG (MainThread) [custom_components.emotiva.media_player] Calling async_schedule_update_ha_state
2024-06-15 14:55:31.598 DEBUG (MainThread) [custom_components.emotiva.emotiva] Stopping Notify Listener
2024-06-15 14:55:31.605 DEBUG (SyncWorker_19) [custom_components.emotiva.emotiva] discover Broadcast Req: b'<?xml version="1.0" encoding="utf-8"?><emotivaPing protocol="3.0"/>'
2024-06-15 14:55:31.610 DEBUG (SyncWorker_19) [custom_components.emotiva.emotiva] Parsed ping response <Element emotivaTransponder at 0x7f026d922bc0>
2024-06-15 14:55:32.114 DEBUG (MainThread) [custom_components.emotiva.emotiva] Stripped Model RMC1
2024-06-15 14:55:32.114 DEBUG (MainThread) [custom_components.emotiva.emotiva] Sound Modes for RMC-1
2024-06-15 14:55:32.245 DEBUG (MainThread) [custom_components.emotiva] Adding 192.168.59.150 from discovery
2024-06-15 14:55:32.250 DEBUG (MainThread) [custom_components.emotiva.emotiva] Setting up Notify Listener
2024-06-15 14:55:32.264 DEBUG (MainThread) [custom_components.emotiva.emotiva] Subscribing to {'mode', 'input_2', 'zone2_power', 'input_6', 'input_1', 'volume', 'input_4', 'input_7', 'audio_bitstream', 'video_format', 'input_8', 'input_5', 'power', 'video_input', 'input_3', 'audio_input', 'source'}
2024-06-15 14:55:32.283 DEBUG (MainThread) [custom_components.emotiva.emotiva] _udp_client received: 
<?xml version="1.0" encoding="utf-8"?>
<emotivaSubscription protocol="3.0">
  <property name="mode" value="Stereo" visible="true" status="ack"/>
  <property name="input_2" value="HDMI 2" visible="true" status="ack"/>
  <property name="zone2_power" value="Off" visible="true" status="ack"/>
  <property name="input_6" value="HDMI 6" visible="true" status="ack"/>
  <property name="input_1" value="HDMI 1" visible="true" status="ack"/>
  <property name="volume" value="-16.0" visible="true" status="ack"/>
  <property name="input_4" value="HDMI 4" visible="true" status="ack"/>
  <property name="input_7" value="Balanced In" visible="true" status="ack"/>
  <property name="audio_bitstream" value="Analog 2.0" visible="true" status="ack"/>
  <property name="video_format" value="2160P/60" visible="true" status="ack"/>
  <property name="input_8" value="" visible="false" status="ack"/>
  <property name="input_5" value="HDMI 5" visible="true" status="ack"/>
  <property name="power" value="On" visible="true" status="ack"/>
  <property name="video_input" value="HDMI 1" visible="true" status="ack"/>
  <property name="input_3" value="HDMI 3" visible="true" status="ack"/>
  <property name="audio_input" value="Analog 1" visible="true" status="ack"/>
  <property name="source" value="Analog 1" visible="true" status="ack"/>
</emotivaSubscription>

2024-06-15 14:55:32.285 DEBUG (MainThread) [custom_components.emotiva.emotiva] _handle_status called
2024-06-15 14:55:32.285 DEBUG (MainThread) [custom_components.emotiva.media_player] Calling async_schedule_update_ha_state
2024-06-15 14:55:32.286 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.286 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.290 DEBUG (MainThread) [custom_components.emotiva.remote] Calling async_schedule_update_ha_state
2024-06-15 14:55:32.293 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.293 DEBUG (MainThread) [custom_components.emotiva.media_player] mode in async_added Stereo
2024-06-15 14:55:32.293 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.303 DEBUG (MainThread) [custom_components.emotiva.emotiva] _udp_client received: 
<?xml version="1.0"?>
<emotivaAck>
  <stereo status="ack"/>
</emotivaAck>

2024-06-15 14:55:32.303 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.450 DEBUG (MainThread) [custom_components.emotiva.emotiva] Received notification: 
<?xml version="1.0"?>
<emotivaNotify sequence="185">
  <property name="mode" value="Stereo" visible="true"/>
  <property name="selected_mode" value="Stereo" visible="true"/>
  <property name="center" value="None" visible="true"/>
  <property name="subwoofer" value="None" visible="true"/>
  <property name="surround" value="None" visible="true"/>
  <property name="back" value="None" visible="true"/>
  <property name="width" value="None" visible="true"/>
  <property name="height" value="None" visible="true"/>
  <property name="mode_auto" value="Auto" visible="true"/>
  <property name="mode_music" value="Music" visible="false"/>
  <property name="mode_movie" value="Movie" visible="false"/>
  <property name="selected_movie_music" value="Movie" visible="true"/>
  <property name="mode_direct" value="Direct" visible="true"/>
  <property name="mode_surround" value="Surround" visible="false"/>
  <property name="mode_ref_stereo" value="Reference Stereo" visible="true"/>
  <property name="mode_dolby" value="Dolby" visible="true"/>
  <property name="mode_dts" value="DTS" visible="true"/>
  <property name="mode_all_stereo" value="All Stereo" visible="true"/>
  <property name="mode_stereo" value="Stereo" visible="true"/>
</emotivaNotify>

2024-06-15 14:55:32.450 DEBUG (MainThread) [custom_components.emotiva.emotiva] Notify Handler called
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] _handle_status called
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: selected_mode
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: center
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: subwoofer
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: surround
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: back
2024-06-15 14:55:32.451 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: width
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva] Unknown element: height
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_auto to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_direct to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_surround to false
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_ref_stereo to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_dolby to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_dolby to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_dts to true
2024-06-15 14:55:32.452 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_dts to true
2024-06-15 14:55:32.453 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_all_stereo to true
2024-06-15 14:55:32.453 DEBUG (MainThread) [custom_components.emotiva.emotiva]  Changing visibility of mode_stereo to true
2024-06-15 14:55:32.453 DEBUG (MainThread) [custom_components.emotiva.media_player] Calling async_schedule_update_ha_state
2024-06-15 14:55:32.453 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.454 DEBUG (MainThread) [custom_components.emotiva.emotiva] Current sound mode Stereo
2024-06-15 14:55:32.459 DEBUG (MainThread) [custom_components.emotiva.remote] Calling async_schedule_update_ha_state

I see analog1 in the list, but it's not showing up in the Source dropdown.

dlmorgan999 commented 2 weeks ago

It looks like maybe the processor is only changing the audio input and not the video one (which corresponds to the fact that I still see the video from whatever I was watching but I hear the audio from the analog1 input). I'm guessing this is a use case that the integration doesn't currently handle. The way I'm doing it now works fine, so probably not worth the effort to add that functionality.

dlmorgan999 commented 2 weeks ago

This is what the developer tools states shows for the processor:

source_list: HDMI 2, HDMI 6, HDMI 1, HDMI 4, Balanced In, HDMI 5, HDMI 3
sound_mode_list: Stereo, Direct, Dolby, DTS, All Stereo, Auto, Reference Stereo, Dolby Surround, dts Neural:X
volume_level: 0.7
is_volume_muted: false
source: Analog 1
sound_mode: Stereo
mode: Stereo
input_2: HDMI 2
zone2_power: Off
input_6: HDMI 6
input_1: HDMI 1
volume: -21.0
input_4: HDMI 4
input_7: Balanced In
audio_bitstream: Analog 2.0
video_format: 2160P/60
input_8: null
input_5: HDMI 5
video_input: HDMI 1
input_3: HDMI 3
audio_input: Analog 1
device_class: receiver
icon: mdi:audio-video
friendly_name: RMC-1
supported_features: 69004
peteS-UK commented 2 weeks ago

No, that's actually doing what it's supposed to, assuming the RMC is the same as the xmc1. To select the sources, you need to configure one of the inputs to be your analogue input - I do this for spdif inputs from my pi dac. So, input 1 isn't fixed to hdmi1, it's just configured to that. You need to set the button for the analog input to be something eg button 8, and you can give it a name as well , eg my input called squeezebox is digital 2.

If that doesn't make sense, I'll try and ping you the bit from the manual, but the good news is the functionality is there, you just need to configure the RMC input

dlmorgan999 commented 2 weeks ago

Ah - ok. Thanks for the info. Unlike many people, I actually do read manuals for everything I buy 😉, and I have the PDF for the RMC-1. I just need to dive in and take another look.

dlmorgan999 commented 2 weeks ago

The analog input is working perfectly now - thanks again for the pointer! I should have caught that, although in my defense, for most of the time I've owned the processor, an nVidia Shield was the only source I had, so I never changed inputs. 😂 I recently added the Pi as a streamer to the mix, and you getting me to read the manual allowed me to address a couple of minor annoyances I've had since adding the Pi.

peteS-UK commented 2 weeks ago

Glad you got it sorted. It's actually a nice feature. I used it previously to have an hdmi video input associated with a (better quality) optical digital input from a pi. I'll add a note to the doc to setup the inputs.

You can also hide inputs you're not using, although I can't remember if I read that in the addin.

Do we think this version is good for release and fixes the original issues ok?

JoshMcWilson commented 2 weeks ago

I was waiting until I could put the latest changes through the paces, and I can say after today, it's working perfectly! I haven't had an issue all day and I've been doing all the things I normally do that would cause it to stop responding. The only issue I had, and I'm not sure if it would have resolved itself had I waited a bit longer, was that I had to do another full restart by unplugging the unit from power and plugging it back in to try and resolve an issue I was having with no video to my projector. Anyways, after I did so, the state showed that the unit was off, which was true, and then when I turned it back on in HA it did not update that it was online. So I restarted the integration in HA and it was working again. But I don't know if maybe I hadn't given it enough time for HA to pick up that it was powered on. I'll probably have to do that again soon, so we'll see. If these Emo processors didn't have all these little quirks they would be an amazing value, but they just have so many bugs like that it would be hard to recommend it to anyone....sorry a bit of a rant there.

Anyways, really glad this seems to be working flawlessly. Thanks again for all your hard work on this!

Also, as to your previous question about the sound modes, I'm still undecided on the best option there, so I don't have a strong opinion one way or the other. If I had to pick, I think I like the way the options are displayed as is but I could see the pros and cons of each option.

peteS-UK commented 2 weeks ago

Agree completely on the emo processors. I've stuck with the XMC1 since I only have 5.1 speaker setup, so Atmos isn't an option and most of the quirks were worked out over the years and the XMC2/RMC still had so many quirks. Their processors sound great when they're working, but the software just isn't at the same level. I'd only recommend to someone who's OK with "oh, it's not working again, I'll need to restart it" type thing rather than just expecting it to work all the time. Having said that, they do sound great and are good value, so YMMV I guess.

OK - I'll likely post the version we're using to HACS later, so expect an update, which will be the same as what you have but worth updating so that you're getting the HACS updates.

peteS-UK commented 2 weeks ago

Posted 1.8.0 to fix these issues. Also added a Select entity for source selection as requested by @JoshMcWilson. Feel free to open new issues if you find things. I expect to need more items added to the sound mode lists

dlmorgan999 commented 2 weeks ago

Thanks much for all your work on this, Pete! And while I was updating the settings on the RMC-1, I did in fact hide all the inputs I'm not using (and the integration did pick up on that), plus I gave them names. Much nicer now! And while I agree that there are some issues with these processors, I personally have had very little issues with them. Maybe I'm just lucky?

peteS-UK commented 2 weeks ago

Glad to hear it 😊

I think they’re fine so long as you do the same things all the time, but they can get unpredictable – there’s just some bad code in their base – for example the fact they’re still using an API designed for XMC-1 with RMC even though they’ve changed the way speaker presets are completely different.

My only ongoing problem is it often won’t sync to the input from my digital dac – I have the automation switch to the right input, switch off it, then switch back again to make it sync reliably…