Category Archives: Linux

Internet Radio with an Orange PI Zero

I had build an Internet Radio with an ESP32 and a VS1051 MP3 decoder, but I was not happy with the sound quality. So I am now trying it with a Orange PI Zero board and an USB DAC.

USB Sound DAC for Internet Radio

Currently I have an USB headphone connected to the PI, but I have ordered a Lusya SA9023A + ES9018K2M USB Portable DAC HIFI External Audio Card Decoder from Aliexpress.

On the Orange PI Zero I installed MPD and MPC for the sound deamon and the controller.

apt install mpd mpc

I also installed apache2 and php to run the web based front end from.

apt install apache2 php
Orange PI Zero

The Orange PI Zero is an Older SOC with WiFi and an USB port, just the things you need for this project. You can buy it for around 18 Euro from Aliexpress.

Plug  your USB DAC in the Orange PI Zero and check the card id.

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

Here it shows that your hardware card ID = 1.
Use this number to edit /etc/mpd.conf and scroll down to the audio_output section. Here you can change the line with device from hw:0,0 to the below :

audio_output {
type "alsa"
name "My ALSA Device"
device "hw:1,0"

After making changes to mpd.conf you will need to restart mpd

service mpd stop
service mpd start

To add Internet Radio station use the following command:

mpc add

You can add as many stations you want with the above command.

mpc -f "%file%" playlist

To list all the radio stations you added with the mpc add command.

For the web frontend I combined two setups into my setup.
The two sources are:

I added below radio stations with mpc

mpc add #1 NAXI LOVE RADIO
mpc add #2 Easy Hits Florida
mpc add #3 Radio 10
mpc add #4 Magic Oldies Florida
mpc add #5 Qmusic Pop
mpc add #6 Veronica Pop Nonstop
mpc add #7 Radio 1, NL
mpc add #8 Sky Radio
mpc add #9 Veronica Top 1000
mpc add #10 538 Hitzone
mpc add #11 538 Non Stop
mpc add #12 538 Party
mpc add #13 538 Verrückte Stunde
mpc add #14 Radio Noord Holland
mpc add #15 Reggae 1
mpc add #16 Reggae 2
mpc add #17 Reggea 3
mpc add #18 Reggae 4
mpc add #19 Reggae 5
mpc add #20 Reggae 6
mpc add #21 Reggae 7
mpc add #22 Oldies
mpc add #23 Candlelight
mpc add #24 Radio 10 60' 70' Hits
mpc add #25 Radio 10 80' Hits
mpc add #26 Radio 10 90' Hits
mpc add #27 Classic Hits
mpc add #28 JUKE Nederpop
mpc add #29 Juke Cafe Genee Nederlands Muziek
mpc add #30 Juke Levenslied Nederlands
mpc add #31 Juke Zomer Lounge
mpc add #32 greatest hits a la Joe
mpc add #33 Cabaret
mpc add #34 Deutsche Hits
mpc add #35 Hit Radio FFH
mpc add #36 Radio Paloma Deutch
mpc add #37 Wunschradio FM
mpc add #38 Antenne Niedersachsen Deutsch
mpc add #39 BB Radio
mpc add #40 Neue Welle
mpc add #41 Radio Brocken
mpc add #42 Radio Paloma Kultschlager
mpc add #43 Concertzender Klassieke Muziek
mpc add #44 Classic FM

Download here the radio.css file for the web frontend

ZIP file with radio.css file

And here the actual web page index.php

ZIP file with index.php file

Unzip the above two files  and put them in your apache web directory.

Setting up the Orange Pi Zero with XFCE Desktop


I am playing a bit with the Orange Pi Zero.
I want to use it as an internet browser with Firefox to surf on the Internet, without any problems to get an virus on my main PC.
Orange Pi Zero
Check which packets are already installed

dpkg-query -l
// or
apt list --installed
// or
dpkg --get-selections
// or
dpkg -l
Show all available packets
apt-cache search .
// or with search
apt-cache search vnc
Handy tools to install on Orange Pi Zero
apt-get install screen
apt-get install locate
Setup XFCE GUI on the Orange Pi Zero
apt-get install xfce4 xfce4-goodies
// Install missing fonts for the vncserver
apt-get install  xfonts-base
// Install the missing Icons for the Desktop
apt-get install gnome-icon-theme tango-icon-theme
// Install a VNC server to get remote access
apt-get install tightvncserver
apt-get install firefox-esr
Add swap space
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
// add  following line to /etc/fstab
/swapfile none swap sw 0 0
// Set it up to aggressively swap 
sysctl vm.swappiness=80
Enable and setup the WiFi with the command prompt
use commandline program 'nmtui'
To add keepalive to your SSH sessions:
Add the following line to /etc/ssh/ssh_config file:
ServerAliveInterval 60

When trying to copy some data (About 25Mb) the connection over the WiFi , it suddenly stopped. When using the fixed Ethernet the problem does not show.  When using the WiFi without big data transfers the problem also does not show. Even not when running for a longer time with total more then 50Mb.