How to run volumio and CoreELEC together

Hi again,

When you have installed CoreELEC, mounted your NAS/Samba with music-collection, and would like to add volumio

But CoreELEC does not have a package manager and can not add nodejs which is required to server volumio.

Luckily, you can untar an archlinuxarm rootfs on /storage/alarm, then you can mount bind proc sys and chroot into it, there you can do normal pacman -S nodejs and install and configure volumio.

Another option is to not use archlinuxarm but just extract the squashfs of volumio and use it as chroot, run the volumio services - CoreELECs systemd can do containerization. Sweet. You only need to let volumios pulse speak to CoreELECs pulse.

Next up, you write a systemd service file and place it in /storage/.config/system.d/volumio.service
and in a systemd service you can say “use this chroot please and restrict its fs view to /storage/alarm”

How awesome isnt this! You can run any rootfs from CoreELEC, and by writing a systemd service, have it start on boot and be managed by systemd as normal.

But wait there is more. In the volumio.service on CoreELEC host, you can also specify CPU and Memory Limits to apply - to never let nodejs/volumio hog up or lag the hosts kodi.bin process.

1 Like

Nice write up.
But I have to correct you in one point:
There is a package manager included in CoreELEC:

And you can even install node-js with it using the following command:
opkg install node-js

Just found if a few seconds after writing that post. Sweet will try this now too, maybe it already contains the upmpdcli package

How would you access the Volumino GUI. I am very disappointed by the whole Kodi music player since its a pain to navigate around to find the tunes you want so would love to have a better player to access.

Shoog

I just did systemd-nspawn into volumio rootfs

CoreELEC does not have systemd-nspawn, luckily it was in my archlinuxarm rootfs, so lol, run it like this,

# export LD_LIBRARY_PATH=/storage/alarmroot/usr/lib:/storage/alarmroot/usr/lib/systemd/
# /storage/alarmroot/usr/lib/ld-2.28.so /storage/alarmroot/usr/bin/systemd-nspawn --hostname=vol -M volm --register=no -D /storage/.volumio/ /sbin/init

and it boots a volumio. Have to disable a bunch of services not needed, dhcpd, dhcpcd, rpcbind, its samba server. Hm, possibly I should systemd-nspawn into it without booting it fully, just start or rewrite teh mpd volumio related services (to not require network.targeet and or such).

Will experiment more and easiest method.

But yea with this systemd-nspawn (better chroot), the volumio will be available on the same IP as Kodi is, if there is port conflicts for 8080 or 8000, ill just move one of them.

But yeah this should work.

Now I got to the UI of Volumio2, its on :3000 of the coreelec IP, and I had to edit http/www/app/local-config.json to tell its IP for socket.io and other websockets to work well, then I also had to disable /opt/odroiddac.sh as it was trying to load/unload modules, ugh. And disable avahi/mdns, by uncommenting it in some js file.

Overall, sigh, when simple web-apps or programs assume they own the operating-system and are the user, instead of doing one thing well and letting the rest be.

Also, volumio has by default spying by Google, by including google-analytics in its index.html, WTF.

My plan is to test this, and then make a .tar for others to untar and place a systemd service file to have volumio right next to CoreELECs Kodi. Like a “Volumio packaged for CoreELEC” thing.

3 Likes

Just tried Volumio, was disappointing UX, its nodejs was using more CPU than kodi even after all indexing/updating. Its UI was buggy.

Then I realized, volumio is just a frontend for mpd in this case, through upmpdcli, which itself is upnp media renderer over mpd.

So now I setup a mpd in archlinuxarm root, started by this systemd service placed in /storage/.config/system.d/

[Unit]
Description=mpd archlinuxarm
Requires=network-online.service pulseaudio-load.service
After=network-online.service pulseaudio-load.service

[Service]
Type=forking
RootDirectory=/storage/alarmroot
ProtectSystem=yes
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=yes

Environment=PULSE_COOKIE=/var/run/pulse/.config/pulse/cookie
ExecStart=/usr/bin/mpd
Restart=always
RestartSec=15

[Install]
WantedBy=kodi.target

The pulse_cookie thing and using pulseaudio over sockts, is overoptimization, to avoid small tcp buffers if I had to place server “127.0.0.1” in mpd.conf.

The pulseaudio-load.service just does pactl load-module module-alsa-cards and alsa-sink and sets output device to be in hdmi stereo mode. This is the file

[Unit]
Description=Load PulseAudio Modules
After=pulseaudio.service
Requires=pulseaudio.service

[Service]
Type=oneshot
ExecStartPre=/usr/bin/pactl load-module module-alsa-card
ExecStartPre=/usr/bin/pactl set-card-profile 0 output:hdmi-stereo
ExecStart=/usr/bin/pactl load-module module-alsa-sink device=hw:0,1
ExecStartPost=/usr/bin/chmod g+rw,o+rw /var/run/pulse/.config/pulse/cookie

[Install]
WantedBy=multi-user.target

It is important for the mpd.conf to have

bind_to_address “0.0.0.0”

user “mpd”
group “audio”

audio_output {
type “pulse”
name “coreelec pulseaudio”
}
filesystem_charset “UTF-8”
zeroconf_enabled “no”

And now, there is a multitude of web clients for mpd to choose from. Most simple seems to be https://www.ympd.org/ Ive tried rompr and its, meh, not finessed UI.

Now todo: send “mpc pause” command when kodi receives any play event, to mute mpd. Maybe even try the mpd client in kodi.

Illl most likely end up using mopidy since it has better web-frontends to chose from and simpler lower-latency API than mpd. Then finally, CoreELEC on odroid c2 can be both Mediacenter and BetterThanSpotify music discoverer and player.