-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 STR pre-amplifier and integrated amplifier #40
base: master
Are you sure you want to change the base?
Conversation
Don't hardcode the supported attenuation range as -90dB to 0dB. Instead make it a property of the AVR class. Note that we now treat the attenuation value as a float with 0.5dB precision.
Only one zone. Only four listening modes. Attenuation range from -96dB to +7dB in 0.5dB steps. The BRT command, which means query bitrate in most devices, is changed to move the left/right balance to the right. Z1BRT0 is equivalent to moving balance 0.5dB to the right, Z1BRT50 moves it by 2.5dB and Z1BRT100 by 5dB. When we send Z1BRT? to query bitrate, we actually shift the balance 0.5dB to the right, which is probably a bug on the device. Simply using this API would inadvertently adjust the balance fully to the right over time!
HTB is Input 32. A name isn't returned but you can tell it to switch to 32 and it does work. I'm working on a fork of your code to add this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's looking good. When I have a chance, I'll try this version with my MRX 520 to make sure it still works.
I've opened a PR on this PR (maybe there was a better way to do that..) but you can find it here. iain-cx#1 |
Executive summary: input 32 doesn't work for me. I actually came to the conclusion that Anthem doesn't want us to go into the menu and set up an input for HTB. When you configure bypass in the settings, you choose either an RCA or XLR jack to use for it, and HTB will then work regardless of whether or not you configure an input. In fact you can't actually configure an input using a jack that you already configured for HTB, and if you do configure one first, then subsequently configure the jack, the input shows up with the All of this leads me to conclude that you aren't supposed to set up an input at all, although the documentation doesn't make that clear, given that you and I, amongst others, read it and thought that we were supposed to. Right now I don't have an input configured for HTB, and when I tried to select input 32 nothing happens. If I telnet to port 14999 and send I'm on firmware 1.8.30. Maybe it's different on older versions but I'm not sure that special casing input 32 is the right thing to do. |
Heh, I don't know what the best way to handle a PR on PR situation is, either. But I would propose that we discuss the changes here, for clarity. Regardless of what I wrote above about HTB, the float handling stuff looks good and I can certainly merge it and repush here. |
I reached out the Anthem support ages ago about this and they said it was definitely possible to switch to HTB. My guess is it depends on which I put you select? Can you try RCA4 and see if that makes it 32? If not could you start up the monitor in this code and switch to HTB to see which input it reports? |
I set it for subwoofer bypass, since only RCA3 can be set for fronts, but even then there was no difference. The input appeared in the list with
It reports the input it was on before I tried to switch, because I can't switch. |
Huh so how do you get into HTB? Which equipment are you using? I can certainly switch to the input on the front panel. |
The front left/right channels from my AV receiver is connected to RCA3, which is configured for HTB Fronts. I only have one subwoofer, so its output from the receiver is connected to RCA4 left, and RCA4 is configured for HTB Sub. To enter bypass, I switch the pre-amplifier to standby mode, which flips the relays to connect RCA3 and RCA4 directly to the device outputs, ie my power amplifier and subwoofer. That's the way the documentation says to do it, as I recall. |
Do you have the separates or the integrated? I think that may be the difference? For me (integrated) I can only pick a single input as HTB. To switch to it I have to power on the integrated (obviously since if it was off the power amp would be off) and switch to the input labeled HTB RCAX (or XLR). It does seem to be 32 regardless of which input I pick to be HTB. It sounds like we may need to special case the integrated and the pre-amp since they handle this differently? |
Aha that's the difference. Yes, I have the separates. |
Yep! |
@iain-cx I updated my PR real quick. Could you test when you get some time on your PA? |
Add HTB and parse volume as float
Looks good. |
Sorry for the delay. I'm concerned that this won't work with HA properly. It looks like you ignore the MAC command, but this commands (or any other command to get the mac address) is required for the HA integration. This is how we define the unique device ID. While it could work in theory with 1 unit, you would run into issues if you have a second unit. Is there any command that can return the MAC address of the device? |
The supported way to get the MAC address on these devices (as well as on x20 receivers and other devices) is to send |
Addresses #38.
The STR pre-amplifier supports four listening modes: Stereo, Mono, Both left and Both right.
It only has one zone.
Minimum and maximum volume is -96.0dB and +7.0dB. Volume can be set in 0.5dB increments. This PR reworks
volume_to_attenuation()
andattenuation_to_volume()
to handle this case, while preserving the -90dB to 0dB range of other devices. Note that in doing so we change the type ofvolume
fromint
tofloat
. Regression testing is advised.The device supports Home Theatre Bypass mode AKA HTB, in which the output from a separate AV receiver can be connected to the pre-amplifier, which will pass through the signal to the connected power amplifier when the pre-amplifier is in standby mode. HTB inputs are discussed in #38, however they are not able to be selected independently. The official Anthem app does show them in the input list, but fails to switch to them. They don't show up at all on the device front panel. It is therefore probably not a bug that this library cannot select them.
Several commands which apply to AV receivers are not supported by the STR. In particular,
BRT
is the read-only bitrate property on a receiver, but the read/write left/right channel balance adjust on the pre-amplifier. TheZ1BRT0
commands adjusts balance to the right channel by 0.5dB,Z1BRT50
adjusts by 2.5dB andZ1BRT100
adjusts by 5dB (the maximum), At startup most devices would receiveZ1BRT?
to query the current source bitrate, but the STR (probably incorrectly) interprets the command asZ1BRT0
. After instantiating theAVR
class ten times, you would see your pre-amplifier shift the balance fully to the right. We now avoid doing that by addingBRT
to the list of commands which should not be sent at connection startup, as well as other commands which are not mentioned in the documentation from Anthem.