[PLUGIN] SerialAmpController - Control Amplifiers with Serial Interface from Volumio (e.g. ROTEL A12/A11/A14)

Hello! I have a question for the creator of the plugin. Can this plug-in be adapted to amplifiers that do not have an rs-232 bus? For example, most amplifiers have a remote control input on the RCA connector. And they support control through this input. Any thoughts?

Hi Dev1d!
If they use Audio Signals that the Raspberry Pi‘s Sound Chip is able to generate it may be possible (if you think about using the Pi‘s Headphone Jack).

But:

  • I‘m not aware of a documented standard that describes the communication protocol
  • It is probably a proprietary system for each vendor - a quick and dirty Google search produced nothing
  • If I am correct with these assumptions, you would first need to reverse engineer the communication protocol
  • Then you need to implement the protocol on the Pi‘s Hardware or some utility device
  • Then you may need to program a driver for the output
  • Finally it needs to be implemented in the plug-in

Long story short: I have no time and no interest in diving into this, but if you can demonstrate, that you have a working version of a control from the Pi, I may be able to support with the integration and finally merge it into the plug-in.

Greetings! Can you take a peek? I found an example of controlling using the RI bus for Onkyo devices for an example. Moreover, the logic is similar, as I understand it, and the adapter can be made easily (RS232 pins DCD, GND apply to a 3.5 mm pin.)
https://lirc.sourceforge.net/remotes/onkyo/Remote_Interactive

Ok, seems I did not google enough :wink: My brother used to own the same Onkyo CD player the French page used for reverse engineering - we were kids back then… long time ago.

However, I still do not think it is straightforward, here’s why:

  • the French link says, that Onkyo uses TTL level, i.e. 5V, RPi uses 3.3V on the signal pins, so you need a level shifter, not just a simple cable, if you do not want to roast the Pi (the project uses an Arduino board, which can drive TTL). TTL was hip in the 80s and 90s, RPi uses a modern mobile phone processor, which runs at lower voltage levels.
  • supposing you do not want to write your own serial driver, the next step is to try to read and write from the interface using a serial driver in the Raspbian disti of Volumio
  • at first sight it is not a standard serial protocol - not sure if the serial driver can decode it. You could try to get it working from the command line of the RPi with stty, cat and echo (I give an example in the first post: “Low level function check of serial interface”). To get to this point, you do not need any Volumio code modifications, just basic Linux command line stuff.
  • Next step is a JS implementation - I basically use serialport.io for the communication with the serial port.
  • If you get it working and can send and receive commands from the Onkyo device it is quite easy to implement the same functions I have implemented already (basically editing a config file)
  • BUT: In the document you post, there seems to be no command to increase or decrease the volume of the Amp via the RI interface (and that is the main purpose of my plugin). And additionally, there are no buttons in the Volumio GUI that allow you to control other components of your HiFi (e.g. CD, Tape, CDR, MD (?) etc.) - so there is not much you can control from the plugin.

So: an awful lot of work for a minimum gain from my point of view (after all the work, pausing Volumio would mute the amp).
If your idea is, to control Volumio from the RC of your Amp, that might be easier, but it also requires getting the communication to work and that would then rather need to be implemented in one of the remote control plugins or maybe the existing Onkyo plugin (my plugin is using Volumio to remote control an amp, not vice versa). A programmable remote and one of the already implemented IR-control units would probably do the job (sending volume commands to the amp directly and other commands to Volumio).

Long story short: It might be an interesting project from hacking point of view, but I cannot devote my limited spare time to this. But if you want to dive into it, feel free to fork the plugins repo and start developing and if you succeed, you can either create a pull request or make it a new plugin. Occasional questions can be answered, but I cannot do step by step guidance.

One more thing:
Found this project on GitHub.

It looks like it doesn’t use a level shifter, but if the Amp is really TTL, that violates the RPi spec and is bad engineering. (Small sitze level shifter boards are available starting from a few bucks).
However it does not use Serial interface of the RPi, but directly „bit-bangs“ a GPIO pin, so it requires significant changes in the plug-in.
But good news is: there seems to be a volume control function.
So it seems doable and would be possible to include in the plug-in. But I still have no time to support this. If you get a running JS implementation done (module or function) I can possibly help to integrate it into the plug-in instead of the serial.

I generally have a Marantz model 30 amplifier. Onkyo was just the first to get search results in Google, but I also found Marantz later. The funcional needs the same as in your plugin, no more. Auto-turn on the amplifier, connecting the corresponding input automatically when turning on Volumio, and adjusting the volume of the amplifier from the Volumio application. This is basic.
I will try soon according to your advice on my amplifier, I will unsubscribe with the results!

1 Like

Continuing the discussion from [PLUGIN] SerialAmpController - Control Amplifiers with Serial Interface from Volumio (e.g. ROTEL A12/A11/A14):

Good day, T0MR0, thank you for the great job you did with serialampcontroller plugin. Last week I made a succesfull modification of this plugin for working with Anthem STR Integrated Amplifier. The first task was a renovation of ampCommands.json. It was easy, because Anthem issued a good understandable document with serial codes. Right after that I had an ability to regulate volume synchronously on both devices.
But there was two problems. The first one was the process of powering down an amplifier. When the ‘PowerOf’ command emitted Anthem STR is shutting down whithout giving the response about it. So plugin was never informed about power changed from ‘power up’ to ‘standby’. I solved this with some corrections in index.js file. I wrote “if (data.status == ‘play’)” instead of “if (self.ampStatus.power == ‘standby’)” in line 60.
Now plugin must send ‘powerOn’ command every time I pushed ‘play’ button in Volumio.
From this point I faced the second problem. Changing volume event now come with ‘powerOn’ and ‘inputSource’ comnands. It’s not so bad, but every new ‘input’ command causes annoying flicks on Anthem STR display. From volume digits to input picture and back to volume in a short time and many times.
I read a logs and found the message “[SERIALAMPCONTROLLER] on.pushState: undefined - 'play’” issued when changing volume. It means that plugin cannot manage the perfect status of Volumio.
Then I tried 2.0.9 version whithout timer and ‘powering up - down’ status. Nothing realy changed, so I modified index.js again. There was three different variables - ‘self.status’; ‘self.status.status’ and ‘data.status’ in lines 60 and 67. I left there only two of them - ‘self.status’ as previous Volumio state and ‘data.status’ as a new Volumio state and inserted “self.status = ‘stop’” after line 52.

Now I reached a good functionality. Plugin emitting ‘powerOn’ and ‘input’ commands once as the ‘play’ button touched. Volume moves synchronously on both devices.
So, again many thanks for T0MR0 for the great initial work.

ampCommands.json (7.9 KB)
config.json (1013 Bytes)
index.js.txt (48.2 KB)

Hi, sorry for the late reply. I‘m currently absorbed by urgent family topics.
I‘ll check your files an integrate them if it makes sense, but not before mid or end of April, as far as I can say.

OK, don’t worry. If somebody need to control Anthem STR, there is raw files in my topic. I had to write a different config.json, it is for Anthem initial settings. Anthem amplifier use negative volume settings, so when plugin start with volume 0 it is very very loud.
Your work was fine, and very usefull for me. Thank you again.
P.S. I used 2.0.9 version for index.js, not 2.0.11, it was easyer.

I have a Rotel RA-1592 amplifier, it has the ability to control via TCP/IP protocol via Ethernet RJ45 connection.
T0MR0 is it possible to add control via this protocol to your PLUG-IN?

I managed to run the plugin for Rotel RA-1592 via TCP/IP connection by creating a virtual com port using socat. I understand that this is a hack and you need to do quite a lot of actions, and also you need to change the plugin code a little to work with the virtual port, but I did not have enough knowledge for anything else, although I understand that it is not so difficult to add functionality for processing TCP/IP packets, who understands this. If anyone is interested in the plugin’s work via TCP/IP protocol, let me know, I will write instructions.

Really would like to know more about it!

First we need to create a virtual com port that will work with the tcp/ip protocol, I did it through “socat”.
First we need to install it:

sudo apt-get update
sudo apt-get install socat

Create a new file for the systemd service:

sudo nano /etc/systemd/system/socat.service

with the following content:

[Unit]
Description=Socat virtual serial port
After=network-online.target
Wants=network-online.target

[Service]
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/socat PTY,link=/home/volumio/ttyS0,raw TCP:xxx.xxx.xxx.xxx:9590 # xxx.xxx.xxx.xxx - ip address of your Rotel
Restart=on-failure
User=volumio

[Install]
WantedBy=multi-user.target

Save the file and close the editor.

Activate and start the service:

sudo systemctl enable socat.service
sudo systemctl start socat.service

Reboot the system and check if the virtual port appears.

cat /home/volumio/ttyS0

This method should reliably start socat after every reboot.

Now you need to replace the main plugin file index.js which is located in /data/plugins/system_hardware/serialampcontroller/ with the one I attached in this post.

index.zip (8.5 KB)

Restart the Volumio interface:

volumio vrestart

Go to the plugin and select the “Virtual Serial Port” device.

All fixes were made based on the plugin version 2.0.11, if you have a different version, update it to the current one.

Unfortunately, this is not quite the correct method, but it works, I couldn’t do it any other way, since I don’t have enough knowledge to add a method for working with tcp/ip to the plugin itself, maybe the author will appear and will be able to add such an opportunity, for now it’s like this.

Older Rotel models, for example Rotel RT-09 - Rotel RT-1080 - RDG-1520 have an RS-232 interface.
This is implemented on the RJ-45 connector.

Schematic in PDF file:

More information about RS232 communication:

You can also control it by commands

More information here:

There is a new version 2.5.0 of the plugin in the Beta Channel for both Volumio on Buster and on Bookworm.
It now has support for Rotel Amps with TCP/IP interface and the code has been reworked and behaves more stable - feel free to try it out - let me know, if you run into issues. It may require to uninstall the old plugin first and reinstall.

2 Likes

Have tried both Serial amp control 2.5 and 2.6 on my Rasperry pi 4. Have tried reinstalling volumio but everytime i install these any of these versions when i try to go to the settings the settings page does not show anything, just a blank page. Tried different browsers and from different computers and phonesm but can´t find what is the problem. Anyone else experience this problem?

There’s an issue with opening the settings window in the plugin on Buster. I reported it to the developer, but it seems they don’t have time to fix it right now. There are no such problems on Bookworm—the plugin works well there.

Hi - was out the last weeks - but I just tried to verify on my system. I did some small modifications, please try v2.6.2 from the beta-channel.
Let me know, how it goes…

1 Like

Hi T0MR0,
With version 2.6.2 beta, it work great - thanks you!

Special thanks for the Russian and Ukrainian localization!

1 Like

Thank you for the translation!

1 Like