Onion Omega based pulseaudio server
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
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.
I created Mopidy docker image to utilize network audio server with my audio collection
Docker is hosted on OrangePi Zero mini computer. I will not cover docker configuration since it is not part of the project.
Sources can be found here
To install this as a service create file /etc/systemd/system/mopidy-docker.service with following content (please change settings where necessary)
[Unit]
Description=dockerized mopidy
Requires=docker.service
After=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm -f mopidy-instance
ExecStartPre=-/usr/bin/docker pull andreymalyshenko/mopidy:armhf
ExecStart=/usr/bin/docker run --name mopidy-instance -p 6680:6680 -p 8011:8011 -v /data2/muzlo:/media:ro -v /var/lib/mopidy:/var/lib/mopidy -e PULSE_SERVER=192.168.1.80 andreymalyshenko/mopidy:armhf
ExecStartPost=/bin/sh -c 'while ! docker ps | grep mopidy-instance ; do sleep 0.2; done'
ExecStop=/usr/bin/docker rm -f mopidy-instance
TimeoutSec=0
RemainAfterExit=no
Restart=always
[Install]
WantedBy=multi-user.target
then execute
sudo systemctl daemon-reload
sudo systemctl start mopidy-docker.service
if you see it is running OK and available at http://host:6680 enable service startup
sudo systemctl start mopidy-docker.service
After I start it up and followed initial configuration (manual) I did following steps
0) Assign fixed ip on my router
1) Added pub key to /etc/dropbear/authorized_keys - so i can ssh to it without password, saves a lot of time
2) Install pulseaudio version 6 (warn: version 9 gives me kernel panic), please check your sources list to be sure
opkg update
opkg install bluez-libs bluez-utils pulseaudio-daemon pulseaudio-tools alsa-lib alsa-utils
3) change pulseaudio start script at /etc/init.d/pulseaudio
procd_set_param command $PROG --system --disallow-exit --no-cpu-limit --realtime
#procd_set_param command $PROG --system --disallow-exit --no-cpu-limit -v --log-target=file:/tmp/pulse.log
first line - realtime flag solved some sound distortion issues for me
second line is for debug, you can trace issues in the log file
4) change pulse config at /etc/pulse/system.pa
add these lines
### PulseAudio available over the network
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.1.0/16 auth-anonymous=1
i had no issues with sound drivers, sounf card just started to work out of the box so to speak
End result:
pactl list sinks short
1 alsa_output.default module-alsa-sink.c s16le 2ch 44100Hz SUSPENDED
5) At this point it is possible to test network audio from laptop within same network
copy system config from /etc/pulse/default.pa to ~/.config/pulse/default.pa
Add these line
load-module module-tunnel-sink-new server=192.168.1.80 sink_name=onion
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.
Create an account to leave a comment. Already have an account? Log In.
As far as i can understand, it's not really an error but rather warning. I have it as well, but it works
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.
Currently i have installed from opkg
pulseaudio-daemon - 6.0-2
pulseaudio-tools - 6.0-2
Version 9 s also available there but as mentioned - i have kernel panic.
Here is the link, all versions from my setup also mentioned there:
https://community.onion.io/topic/2910/kernel-panic-with-pulseaudio
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.
On my laptop i have
Package: pulseaudio
Architecture: amd64
Version: 1:8.0-0ubuntu3
On headless jukebox no pulseaudio installed, it works through gstreamer-pulseaudio plugin
Become a member to follow this project and never miss any updates
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?