Tag Archives: Ubuntu

Using an Orange Pi Zero as Airplay Speakers…

… and redirecting all sound from desktop Ubuntu to them.

Note that this system isn’t working perfectly for me and I’m finding the sound drops out about once a minute. I’m looking into other methods using pulseaudio.

On Orange Pi Zero

Set up an Orange Pi Zero and boot it using an Armbian installation (it will say “Welcome to ARMBIAN” when you log in).

sudo apt update
sudo apt upgrade armbian-config
sudo armbian-config

armbian-config Main Menu
armbian-config Main Menu

Wait until it loads, then select “System” (arrow keys to move up and down, Enter to select).

armbian-config System Menu
armbian-config System Menu

Scroll down to “Hardware” with the arrow keys and press Enter.

armbian-config Hardware Menu
armbian-config Hardware Menu

Use arrow keys to select “analog-codec” (if it isn’t already) and then press space so that a “*” appears between the square brackets (if it isn’t there already).
Press Enter to Save.

Right arrow to select “Exit” and press Enter.

Right arrow to select “Cancel” and press Enter.

Right arrow to select “Cancel” and press Enter.

You have now enabled the audio output.

sudo apt install shairport-sync

You now have the sound server program running. Lets name it something different.

sudo nano /etc/shairport-sync.conf

Use the arrow keys to move the cursor to the start of the first line after “general =” that starts with a “//”. Press return to add a new line above it.

On the new line you created, press tab and then type (for example) :

name = “Sitting Room Speakers”

The part of the file should now look like this :
________________________________________________________________________________
// Sample Configuration File for Shairport Sync
// Commented out settings are generally the defaults, except where noted.

// General Settings
general =
{
name = “Sitting Room Speakers”
// name = “%H”; // This means “Hostname” — see below. This is the name th$
________________________________________________________________________________

Press Ctrl+x
Press y
Press Return

On mine I found that it was turned down really low, so had to turn it up. Run the following command to set the volume levels :

alsamixer

Left and right arrows select the “fader” – you want to push “Line Out” and “DAC” up. Push them both up until they start turning grey instead of green – you might want to return to this later to fine tune levels once you have music playing.

Restart the Orange Pi Zero :

sudo reboot

On Linux Desktop Computer (e.g. BeeLink S2)

sudo apt update
sudo apt install paprefs pulseaudio-module-raop

Search for an application called “PulseAudio Preferences” (press the windows key and start typing)

Check “Make discoverable Apple AirTunes sound devices available locally” and click “Close”.

Restart the computer.

Launch the “Settings” application and go to “Sound”. You should see your Orange Pi listed under “Output”. I have two versions appearing, one has what looks like a MAC address after it, the other my Orange Pi’s ip address. Use the latter.

Note there is usually a couple of seconds of latency due to the buffering, but this is fine with music (not so much with video).

If the audio drops out once in a while…

The following command increases the priority of the shairport-sync server running on the Orange Pi Zero by setting all process run by the user (-u) “shairport-sync” to be very important. Hopefully this will help. Another option might be to increase the buffer size, although this would increase latency.

sudo renice -n -19 -u shairport-sync

Fan control on the UDOO x86

The other day I got myself an UDOO x86 (specifically the penultimate “Advanced Plus” model). An interesting device that sits between most of the ARM SBCs and an older PC in performance. Steam games such as Bastion, Rogue Legacy and Super Meat Boy seem to work OK, Youtube plays fullscreen just fine although Steam game preview videos lag – watching processor usage I suspect that the graphics chipset (Intel 400) is not providing any acceleration in this context. I was not impressed by the fact that the quoted CPU frequencies are a misleading “Up to 2.24Ghz”, which really means, “2.24Ghz boost, 1.7Ghz operation” – I have not seen the board exceed 1.7Ghz while running Linux.

UDOO x86 Top
UDOO x86 Top

Another unusual feature of the board is that the built in eMMC shows up as an SD card. Probably unrelated, but I had more difficulty installing dual boot Linux on the internal eMMC and a plugged in M.2 drive than I ever have had on any machine – many of which weren’t even intended to run Linux! The main issue related to an error when installing GRUB

UDOO x86 Bottom
UDOO x86 Bottom

I spent a huge amount of time looking for a 2260 M.2 ssd (60mm length) and couldn’t find one in stock anywhere of a brand I’d trust. Suddenly I realised that the offset between the two sockets meant that a 2242 (42mm) board would fit in the top slot using the 30mm screw fitting for the lower slot (intentional I’m sure, but not obvious!). 42mm boards seem to be more common and so I was able to get a 64GB Transcend part.

I got the offered fan with my device, but it really isn’t needed. Getting the fan to start with the default settings is difficult as even at full processor usage (all cores) I wasn’t able to get the processor hot enough to need it. I poked the internet and found the instructions for the BIOS. There was a section that mentioned editing the default fan temperatures and speeds so I did a bit of a tweak. The fan now starts at a lower temperature, and runs at a lower speed.

BIOS Top Level Menu
BIOS Top Level Menu

To change your fan settings, press escape as soon as the board powers on to get to the bios homescreen. Selecting the SCU option leads to a detailed settings page which looks like the following screen :

BIOS SCU Page
BIOS SCU Page

Selecting the “Power” section from the options at the top, you are presented with various options including one called “Thermal Zone Configuration”. As per page 54 / section 4.5.3 of the manual you can edit various settings, I’ve changed “AC1 Temperature” to 55°C and “FAN Duty Cycle (%) Above AC1” to 50%. This means the fan is nice and quiet when it does start.

I’ve yet to experiment with much on the board. I’m interested in having a look at the Arduino capabilities – care should be taken as next to the Arduino headers are some lower voltage (1.8v) pins for the main chipset. Wiring something into these accidentally would likely cause damage.

UDOO Arduino Pinout
UDOO Arduino Pinout
UDOO Main Processor Pinout
UDOO Main Processor Pinout

More details about the connectors are available here for the Arduino connectors, and here for the main processor connectors.

(Pictures used in this post are all from the UDOO website)

Ubuntu Gnome 17.04 Regular Error

Update 9/11/17

Updating to 17.10 appears to have cleared the error, although it was a 1.3GB download and changed a huge amount of stuff. Hopefully it hasn’t broken compatibility with anything I use.

____________________________________________________________________________________________________

Update 5/11/17

The error described within this post has now returned to all of the devices I have Ubuntu Gnome installed on following some updates I ran. Sadly, this fix doesn’t seem to work any more. I’ll update this post if I spot another way of fixing it. Searches are made more difficult by the fact that this error seems to have a long history and comes and goes with time right back into the distant past. Original post follows, as it still might be useful to some people and doesn’t do any harm.

____________________________________________________________________________________________________

A few months back I got a new desktop computer. As it was based around a Ryzen chip, I needed to use a bleeding edge Kernel to take full advantage of some CPU features. While these days I usually default to using Linux Mint, there was not a version which used the required Kernel 4.10 minimum.

Ubuntu Gnome

The Ubuntu Gnome Desktop

I resigned myself to switching to a more conventional Ubuntu install, but decided to do some reading first. At about the same time, announcements were made by Canonical that they would be moving away from Unity in the future – this suits me just fine, as I have to admit that I’m not a fan of Unity (probably mainly prejudice resulting from issues I experienced on barely supported hardware the first time I tried it). My reading informed me that 17.04 would be the last version of Ubuntu to use Unity and that moving forward Ubuntu would most likely move to Gnome.

I decided to try Ubuntu Gnome 17.04 as it would be the way things were going anyway.

Installation was simple enough, I ended up following some instructions to update the kernel slightly for which unfortunately I didn’t make a note of the source.

One issue I’ve noted with this install is that with fresh installs I get an error every time I boot, along the lines of “system program problem detected”. I’ve noted using :

ls -l /var/crash/

… that the error seems to be referred to as “_sbin_plymouth.0.crash”

Over time this issue went away – I think I’ve installed or updated something along the way that has fixed the issue, or it has just stopped telling me for some reason. It hasn’t caused any issues anyhow. Several months on, I have re-used the same installer image and have had the same issues, this time on an UDOO x86 SBC.

Poking around the internet offered a few solutions, the one I have used and appears to have work is to install plymouth-x11. The following command was used to do so :

sudo apt-get install plymouth-x11

This seems to have solved the problem – hopefully it will do so for anyone else with the same issue. While it doesn’t seem to be a show stopper, it is nice not to start every login with an error telling you something has crashed! I would include a screenshot or detailed contents of the error… but I forgot to do so before I fixed it!