Onion Omega microcomputer publishes itself as network pulseaudio server. Onion itself controls power line of amplifier turing it on and off when music is playing or stopped. Mopidy running on another OrangePi Zero minicomputer is used as frontend to music server (jukebox).
Motivation:
* I have large speakers connected to amp, that i want to use from multiple devices
* On of those is jukebox that me and my family use today, that should work with new setup
* Amp itself is hidden and i want it to turn on and off automatically
Want to advertize evolution of this design in new project of mine Onion Omega Hi-Fi Dock. In this new run i want to connect proper I2S DAC to Onion. PCM5102 seems to be perfect candidate. See you there:)
After being used for several month, here are some reflections
1) For some audiotracks audio getting distorted after some playback time (sounds like vynil sound), after i press stop and play again - it gets better. I guess that's an indication that some issue with pulseaudio is there. I would like to upgrade pulse from version 6 to 9, but for now i have kernel panic with latest and not able to solve it yet.
2) I have a feeling that wifi is not the best option. I would like to replace it with ethernet, but for now don't have time to assemble ethernet connector.
3) I will try to assemble orange-pi version of the same, eventually i want to have hi quality DAC attached to it, instead of sound card, and i failed to make it work with Omega. Seems that omega is quite troublesome in terms of sw, i really wish to keep it for it's low power consumption and low hw (and therefore no hw underutilization), but i don't have time and competence to solve those issues with sw.
4) Sometimes i see that connection to pulse from my laptop is lost, and pulse restart helps. I guess i should be fixed by running it via ethernet.
After pulse restart i can select network card in my audio settings and test that audio works fine
6) Add following script at /sbin/pa-monitor
#!/bin/ash
GPIO=19
function main {
while (true); do
state=$(pactl list sources short | awk '{print $7}')
if [ $state = "SUSPENDED" ]; then
off;
else
on;
fi
sleep 1
done
}
function init {
gpioctl dirout $GPIO
}
function on {
echo"ON"
gpioctl dirout-high $GPIO > /dev/null
}
function off {
echo"OFF"
gpioctl dirout-low $GPIO > /dev/null
}
main
Add startup script at /etc/rc.local
/sbin/pa-monitor > /dev/null &
enable /etc/rc.local
chmod a+x /etc/rc.local
After that relay should automatically swith on amp as soon as audio start playing, when audio switched off after ~15 seconds relay shuts off.
I used two storey perfboard to assemble together following components
1) Onion Omega node
2) micro usb power connector
3) 5v to 3.3v linear power convertor to power onion node
4) Conexant usb sound card (just what i had laying around). Originally i was planning to use I2S DAC but i found issues firing it up with onion node and downgraded to this simple usb card. One day i might fix it up and get back to DAc that i have prepared for that
5) Small schematic to power relay switch
This sandwich assembled on the back panel of my amp, which is hidden inside my couch and have no direct access. Relay module controlled by Omega replaces power switch inside my amp. This allows me to have it off when i don't need it and save some considerable amount of electricity.
Relay module is taken from pretty standart arduino relay module. I changed schematics with the one proven to work more reliable from 3.3v level line.
Whole Omega sandwich eats around 300mA of usb power.
How?! I tried getting this to work myself some time ago but I got stuck with "Client sent non-aligned memblock" errors which is apparently a bug in PulseAudio 6.0. You sure you didn't do anything special to get it to work?
It's not just a warning, unfortunately; it can cause the sound loop to lock up completely. If you only get one or two then you're fine, but on mine, 9 times in 10, it spews out a bunch of these messages and then just stops: whatever I'm playing even stops, waiting for a response from the PA server that is never coming.
There's an official bug report about it, and it was patched with 6.99, but by then they had already moved on to 7 which doesn't have the problem. For you not to get the lock up suggests that you're either very lucky, or that there's something different about your setup. What version of pulse do you have on your client? I've got 12.2. Maybe there's a version between 6 and 12 that I can downgrade to that'll work.
I meant what version is on your laptop. You mentioned testing it on a laptop on the same network. Even though the bug report indicates failure even between a 6.0 client and 6.0 server I'm wondering if whatever version you have on your laptop is more compatible than what I've got installed.
How?! I tried getting this to work myself some time ago but I got stuck with "Client sent non-aligned memblock" errors which is apparently a bug in PulseAudio 6.0. You sure you didn't do anything special to get it to work?