I bought an XMS amplifier from a friend years ago and although it was serving it's purpose I got quite frustrated with having to toggle the loudness feature every time the input was changed. This was the beginning of what has now become my network enabled amplifier. Initially, I had set out to automatically toggle the loudness feature permanently on when the amplifier's input was switched so I bought a USB-UIRT so that I could use it (via infrared) to change the amplifier input and then toggle the loudness feature in one single command. I entertained the fact that I could perhaps trigger the command from a computer / mouse click etc. Then I opened the amplifier and to my delight found the main audio processor / mixer to be an i2c enabled 4-channel PT2314! This was a game changer since now, not only was I able to do as I originally wanted, I could now take total control of the amplifier via i2c and simply remove the original control board and display altogether. A Raspberry Pi was a natural choice for the project since it natively supports i2c and doesn't need more than a USB WiFi dongle to allow it to be networked enabled.


The main i2c control software is written in Python and uses separate threads for updating the 16x2 LCD and gaining positional information from the rotary encoder used for volume control (salvaged from the original control board). The excellent Python Twisted web server is used to act as a REST server that responds with JSON. There is also a HTML page served on port 80 that anyone connected to the local network can use to control the amplifier. This was the first major milestone, I had network control of my amplifier!


The next improvement to the project was creating an Android app that would communicate with the amplifier via the REST web server. I completed this but was unimpressed with the overall look / feel as it lacked a lot of design flair. It was at this time that I secured the services of a designer that helped me gain a more acceptable controller look / feel. Armed with SVGs and screenshots from the designer, I had a Javascript enabled web page up after a short time that now could control the volume, bass, treble and toggle the mute. 


Being an engineer, I couldn't stop here, not now that I had a way of adding more features via HTML / Javascript on the frontend and adding more Python on the backend. The next addition was to install MPD (music player daemon) on the Raspberry Pi and using the MPD API to communicate to and from the HTML frontend. The analog audio output of the RPi is connected to one of the original amplifier inputs. This now enabled the amplifier to now also be a convenient music player, connected to both my NAS for the music file(s) source and connected to my main living room speakers. Now if only I could add a radio...


Adding a radio to the list of features was next, this consisted of a Si470x i2c radio module. The addition of this module was relatively simple with the Raspberry Pi but for some reason, the two i2c devices were not playing nice with each other. I researched the fact that the PT2314 was being logic level converted to 5v (from 3.3v) while the radio module was not. In the end I ended up enabling the second i2c port on the RPi (which btw disables the use of the RPI's native camera slot) and thus kept the two totally separate from one another. As with the music player (MPD) addition, the analog output of the radio module is connected to yet another input of the original amplifier. This overall has been one of the best features added yet as I switch to radio all the time during TV ad breaks.


The latest feature added was to connect the last original amplifier audio input to a standard RCA to 3.5mm stereo cable that is used as an Auxiliary. Adding this was trivial compared to the other more complicated features already added. Friends that come over can now easily connect their audio source to the main speakers.


From the electronic side, as mentioned above the PT2314 is coupled to the RPi using a 5v <--> 3.3v logic level converter. A 16x2 LCD display (with backlight) is used to show the current amplifier input selected and inputs such as the music player has scrolling text showing the currently playing song on the second line. This LCD was originally controlled (via 4 wire data + 1 enable control lines) directly via the RPi. Additional features added since then has seen the LCD controlled via a 74HC595 shift register which reduces the total IOs needed to just three. The volume control rotary encoder is coupled directly to the RPi and the movements are interpreted via software. There are only two buttons on the front panel as I wanted to keep the physical control as minimal as possible. Both buttons have an LED on the button to indicate that the button has been pushed, this of course required two more IOs from the RPi. The top button toggles the Mute feature and the bottom button cycles through the available inputs. One particular function that I wanted the Mute feature to have was that it is NOT affected by a volume change when the amplifier is muted. The feedback from friends has been that this function alone is worth the hack! How many times have you muted a device (e.g. TV) because it's just too darn loud only to have to deal with the same level of audio when turning the volume down as doing so un-mutes the device. The power supply to the RPi is a re-purposed Samsung charger that has enough current to run the RPi, USB WiFi, LCD, logic level converter, shift register, button LEDs and the i2c radio module. The front panel is laser cut from acrylic totally replacing the original panel and the (original) metal cover has been painted black (originally a 80's style silver).


What's next? Well, I am already working on adding more. I have purchased a cheap HDMI switcher from eBay that I can use to switch HDMI inputs such PS4 / TV / XBox etc. The RPi has the ability to send and receive HDMI-CEC commands so this is going to be utilised as soon as I upgrade my TV so that it will be able to take such commands to switch TV stations / change the TV input etc. I considered adding a USB-DVB-T to the mix but felt that this was getting into different territory for the amplifier since it would not only require more power to run, it would mean adding an X session to the RPi which at the moment is just working fine running the excellent Linux distro that is Arch Linux. On that note, the original amplifier build was using the Raspbian distro but the boot time was in excess of 120 seconds! Unacceptable for a hardware device of this nature, switching to Arch Linux has brought the boot time to a respectable 15 seconds, WiFi connected and Twisted web server (ready to accept commands) included.