• To be continued

    andriy.malyshenko07/08/2020 at 20:42 0 comments

    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:)

  • Some reflections

    andriy.malyshenko09/20/2018 at 07:27 0 comments

    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.

  • Jukebox configuration

    andriy.malyshenko08/22/2018 at 20:18 0 comments

    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

  • Onion Omega configuration

    andriy.malyshenko08/22/2018 at 20:06 0 comments

    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. 

  • Onion Omega hardware

    andriy.malyshenko08/22/2018 at 19:26 0 comments

    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.