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

Hi, sorry to hear that. Can you report the Volumio version you are on? I tried to replicate your problem with the fresh install and noticed that I was still on a rather old version of Volumio (3.2xx) and thus updated to 3.396 today.
Now none of my Serialampcontroller Plugin versions is working anymore, even the very old ones. I also get the rotating cycle and it looks like there is an endless loop now.

Probably something has changed in the way Volumio handles volume. I need to check the next days, why this endless loop occurs (looks like the plugin calls a function in volumio and then volumio calls a function in the plugin which calls again the function in volumio and so on).

I’ll let you know, when I fix this new problem - sorry, this came unexpected. Do you remember, which version you were on when we started the investigation? Maybe this was also one part of the different behavior between our systems. I’ll fix it the next days for the most recent version.
Let’s target that you get a working volume control for Christmas latest :santa:

I see! that must have been the problem! I just had the Volumio-3.378-2022-09-30-pi version installed. So I think we might have to wait a bit to get back to your work on my Amp :stuck_out_tongue:

Hi, I think I managed to fix the issue with the endless loop, just broke it by splitting my function into two.
I have version 2.0.7 now working with 3.396 of Volumio. I’m just listening via PC-USB and it is working (still making the pop-noise when I skip tracks).
You can try it out from the beta channel.
Italian is now integrated (thanks for the translation) - let me know if anything needs to be changed.
During setting up, the order is important:

  • First make the settings for the ‘Playback Options’ under settings
  • Then enable the plugin

If the order is not obeyed, I sometimes get strange volume effects (very low volume or no volume at all). Reason is, that the settings also configure the Volume control but they are not recognized by the amp. It seems to be important, that the plugin is configuring the volume control last.
Below my settings again.

Let me know how it goes…

Playback Options Settings in Volumio:

Plugin settings:

It works!

Gr8 job Tom!

I still have not had time to test it well with my flac music, but with volumio’s radios playback is a bit odd, it doesn’t skip from a radio to another, etc… but I think it depends on Volumio being buggy.

The only difference is that I left mixer on none and saved plugin settings last

Skipping web radios does not work by design. I remember there was a long discussion somewhere between people who wanted that and others who did not like it. Can’t find it back.
However, skipping does not have anything to do with my Plugin (it just ignoring forward and backward commands and not sending them either)

I also left the USB cable connected to PC-USB for testing and also sometimes observe some strange behavior. Still trying to pin it down. I also have set the mixer in the ‘Playback Options’ to ‘None’ now. ‘Hardware’ is not working reliably, since it seems to fight with the plugin over who is the Mixer. When I set it to ‘None’ it works, but there sometimes seems to be an issue when Volumio starts or when I switch the Amp on and off. Need to monitor that a bit more - looks like a timing issue. Will try to improve user experience a bit more.

1 Like

Gotta say it, you’ve done a great work so far!

Not sure what I see on the video - does the volume move because you increase volume on the Amp?

yes, gotta do a better video, but the forum had it cut at 11MB…
Btw ito goes both ways, if u increase on the app or on the amp you always get the same result! so it really works.
Btw the problem with skipping, play, and stop is there also with music from the internal folder, must be a bug of the new version…

I’m still testing a bit more. I still see an issue when I power down the amp and power it up again.
The Mixer setting to “none” is not persistent and the amp always takes back the mixer role. But it is not working, so I have to implement a way for the plugin to recognize that and get the Mixer role back.
When the RPi stays on and I switch the amp off and then on again, I first have to set Mixer = “None” again and disable/enable the plugin to make it work again. Annoying. Is it the same for you?

More or less same here. When I power it on it seems like the plugin is off, so I just enter settings and hit save. After that it works back fine

Made a quick and dirty fix:
Issue is that Volumio needs some time to recognize and setup the DAC after Amp is switched on.
I just added a 10s delay after the plugin gets the Amp=on info via RS232. At least you do not need to restart the plugin.
The auto-play function is not working for some reason - but could not figure out why. The track that played last before the Amp is switched off cannot be restarted. But pressing the “Next” button starts the next track in the playlist.
Since this is only an issue when using PC-USB and not with other setups, I’m tending to leave it like that for the moment.
You can try v2.0.8

I see the improvements here! So, now the plugin doesn’t need to be restarted when I turn on the amp back again.
Last track bug is pretty annyoing, I thought it was connected with volumio and not with your plugin.

On the request side do you think it will be possible to add a MUTE button and on/off button so that when I end listening to music I can switch the amp off without being forced to get the remote?

sorry for the rustic example, limited graphic capabilities here… (whatch bottom right corner) :slight_smile:

1 Like

forza Roma! :rofl:

BAN subito! :joy::joy::joy:

Problem is:

  • when the amp gets switched off, it is detached from the USB, when switched on again, it is attached and Volumio takes 10s to detect and configure it. The Amp sends a power=on announcement via the Serial, but that is much earlier than the USB detection and DAC configuration. So I basically wait for 10s for the USB to catch up. I have not found a way yet, how I can monitor the status of this auto-detection (it is not announced via websocket, the “channel” the Plugin is communicating with Volumio)
  • The last track bug is also related to this (it does not occur when I use the Hifiberry Digi HAT instead of the USB)
  • my personal motivation to further improve the USB is limited, since it anyway produces the click noise with the A-12 when I skip tracks forward and backward (something I really dread as a HiFi enthusiast) - only reason I moved to Hifiberry Digi
  • Timing related issues between Plugin/Amp/Volumio are lengthy to debug (because I need to reverse engineer and understand how Volumio kernel and backend work on this and interact including variations) - so developing a working solution would require quite some research in the Volumio source-code (ALSA integration, USB integration etc.) for which I do not have sufficient time. Maybe, if somebody familiar with the Volumio internals could give me hint of a module I could hook up to (similar to CoreCommandRouter) which announces the status or at least can be polled, that might make things easy. I tried polling the AlsaCards until the Amp appears, but that is not reliably working.
  • Mute button integration: In the “contemporary” user interface there is a mute button and it is working with the plugin. The new “manifest” user interface design does not have a mute button as it seems (just tried the manifest UI after seeing, that I can use it now - think it was only for premium users in the past). I am not a web developer and do not plan to start working on the GUI - but you can probably request, that a mute button is added to the “manifest” GUI on the right channel in this forum - should be a no brainer for an insider.
  • Power button: Would also require, that I start GUI development and look into how to add a websocket event to Volumio - not something I have time for at the moment. But if somebody adds the button and implements a websocket event to signal power down, I could easily integrate this into the plugin. I personally just stop playback and the A-12 will anyway go to Standby after 20 Minutes (setting in the Menu of the Amp)

Long story short, I am currently not able to make further improvements. Maybe I find some motivation to look into some of the things over the holidays, but this is a hobby and I only have a few hours a month for those hobbies.
I hope, what we achieved so far is still useful to some extent - main functionality is there.

You have achieved so much! Really tankful for your work Tom!
C

Hello,
Thanks for sharing your work! I would like to work on your plugin to make it works with a Cambridge CXA61 but I fail installing it with SSH. I can only install it form the Volumio plugin collection.
I’m not sure I’m using the good version. Where can I download the last version? I think there is something wrong with the node modules…
Thanks again.

Hi, welcome here! Had a look at the available spec online. It should be doable, but may require a few modifications of the code.
In principle, you do not need to install the plugin via SSH, unless you really want to start coding in Java-Script.
After installing the plugin via the plugin store, the files are installed under /data/plugins/system_hardware/serialampcontroller/ /data/configuration/system_hardware/serialampcontroller/.
There is a file called ampCommands.json which contains the commands to send to the amp wrapped inside an JSON object. You can add a new object in that file and just modify the commands. After doing that, you can select the amp from the settings in the plugin and try, if it works.
Let me know, if you need help with the JSON.

If you want to use a more “professional” approach, there is information about plugin-development available here.

Please keep in mind, that there may be some modifications in the Plugin required after the ampCommands.json was modified, because Cambridge seems to use slightly different implementation of the Serial interface.

One more question:
In the PDF on the Cambridge homepage, it does not show any commands for setting the volume… There is only mute change and source change explained. Not sure, if there is much added value of the plugin, if you cannot set the volume.

one more thing: before trying to modify the JSON file, you may want to try, if the readings from the Amp are coming in (and find out, whether volume information is also transmitted, even if not documented).
I wrote a small “how to” in the topmost post of this thread - it is in one of the collapsible sections named “Low level function check of the serial interface”.

Thanks for your answer!
I checked the serial interface, it works fine but there is no code when the volume is changed by the button or the remote… I don’t understand why they don’t use it like the other brands…
Anyway, I would like to use your code and modify it to power up the amp when Volumio start playing.
And, you’re right, the plugin is not working with Cambridge yet, I’ll try to make it work and I’ll let you know.

1 Like