Author Topic: Roll Your Own Squeezebox transport and/or server using a Wandboard  (Read 8544 times)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Shamelessly stolen from Scarfussi's post Wandboard Quad Archlinux LMS. 7.8 Squeezelite and adapted/ expanded for ease of use (and my understanding).

Since Logitech's discontinuance of the Squeezebox family of network music players the Squeezebox user community has made great strides in leveraging an alternative hardware platform to fulfill the role of a Squeezebox transport.  In a nutshell this means that if you're looking to leverage Logitchemediaserver and the great controller apps that exist for Android and iOS (SqueezeCommander/ OrangeSqueeze and iPeng) as your digital playback backbone you're in luck.  The community has built a ready-made Linux distribution called CSOS that can be installed on a Wandboard and turns it into a Squeezebox transport and/or server for Logitechmediaserver's purposes.  You can then output the digital stream from the Wandboard to your DAC using its asynchronous USB input.  Whilst CSOS is based on Fedora and does all that's required, I prefer to roll my own using Arch Linux - the principle reason being that Arch Linux is a pretty lean OS, meaning it's less resource intensive and runs noticeably faster than CSOS.  The downside is you need to put in the effort to "roll your own" so to speak.  You can configure the Wandboard to simply act as a transport or alternatively you can configure the Wandboard as a standalone Logitechmediaserver and Squeezebox transport.  To turn the Wandboard into a Squeezebox transport and/or player both CSOS and this RYO solution leverage an application called Squeezelite.  I'm going to post the guide in parts to deal with different aspects of rolling your own transport/server so please bear with me because some of it is a work in progress.  There's enough in the first post to turn a Wandboard into a fully functional Squeezebox transport.

What you'll need:
- Wandboard Dual or Quad
- 8GB micro SD card -- get as quick a card as you can as its speed affects bootup time and load time of anything not in RAM.
- Micro SD card reader/ writer to write the OS image to your micro SD card
- if you want to configure your Wandboard from your regular PC / Laptop you'll need to connect the Wandboard to your home network
- a SSH client to login to the Wandboard from your desktop/laptop.  If using Linux, use ssh.  If Windows, install and use putty
- a DAC that has an asynchronous USB input

Installation:
The first thing you need to do is install Arch Linux to a micro SD card (8GB minimum).  I highly recommend that you ensure the microSD is high-speed.  To prepare the microSD and install Arch Linux CLICK HERE then click on the installation tab and follow the instructions.   Before rebooting your Wandboard, connect it to your home network and your ADSL Router's DHCP (or whatever DHCP server you're using) will assign the Wandboard an IP on reboot.

When you're done with that you have a working Arch Linux install on your Wandboard.  All that remains now is updating OS components, customising a few things and finally installing and configuring Squeezelite and optionally Logitechmediaserver (should you want to use your Wandboard as a standlone transport with HDD attached).

Determine the Wandboard's IP using your DHCP server or use nmap if running *nix (replace 192.168.168 with the subnet you're using):
Code: [Select]
nmap -sP 192.168.168.0/24The Wandboard is the device named 'alarm'.

Login using SSH [username = root; password = root] (Windows users use putty):
Code: [Select]
ssh root@wandboardIP
Update OS, change hostname and install audio components:
Code: [Select]
pacman -Syu
hostnamectl set-hostname SqueezeWand
pacman -Sy faad2 libmad mpg123 libao alsa-utils avahi wget

Configure alsa - asound.conf file:
Code: [Select]
nano /etc/asound.conf
Paste in the following:
Code: [Select]
pcm.!default {
    type plug
    slave.pcm "softvol"
}
pcm.dmixer {
       type dmix
       ipc_key 1024
       slave {
           pcm "hw:0"
           period_time 0
           period_size 4096
           buffer_size 131072
           rate 41100
       }
       bindings {
           0 0
           1 1
       }
}
pcm.dsnooper {
       type dsnoop
       ipc_key 1024
       slave {
           pcm "hw:0"
           channels 2
           period_time 0
           period_size 4096
           buffer_size 131072
           rate 41100
       }
       bindings {
           0 0
           1 1
       }
}
pcm.softvol {
       type softvol
       slave { pcm "dmixer" }
       control {
           name "Master"
           card 0
       }
}
ctl.!default {
    type hw
    card 0
}
ctl.softvol {
    type hw
    card 0
}
ctl.dmixer {
    type hw
    card 0
}

Install Squeezelite:
Code: [Select]
mkdir -p /usr/local/bin
cd /usr/local/bin
wget -O squeezelite http://squeezelite-downloads.googlecode.com/git/squeezelite-armv6hf
chmod a+x squeezelite

Configure Arch to fire up Squeezelite on startup:
Code: [Select]
nano /etc/systemd/system/squeezelite.servicePaste in the following:
Code: [Select]
[Unit]
Description=Squeezelite lightweight headless squeezebox emulator
After=sound.target
Requires=avahi-daemon.service
After=network.target
After=avahi-daemon.service
 
[Service]
ExecStart=/usr/local/bin/squeezelite -n SqueezeWand
Restart=always
 
[Install]
WantedBy=multi-user.target
Configure Arch to autostart squeezelite and avahi-daemon on boot:
Code: [Select]
systemctl enable squeezelite avahi-daemon
Connect the Wandboard to your DAC using a suitably insulated USB cable and ensure your DAC is powered up.

Now reboot:
Code: [Select]
reboot
Following reboot your Logitechmediaserver should have a SqueezeWand entry in its players list (refresh your LMS browser window if necessary).  All that remains now is to obtain your DAC string from Squeezelite, add it to the startup configuration and you're in business.

Login using SSH [username = root; password = root] (Windows users use putty):
Code: [Select]
ssh root@wandboardIPHave squeezelite list output devices:
Code: [Select]
squeezelite -l
You'll see a listing along the lines of the following (specifics will change based on the capabilities of your asynchronous USB DAC):

Code: [Select]
Output devices:
null                           - Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=sgtl5000audio  - sgtl5000-audio,  - Default Audio Device
sysdefault:CARD=imxspdif       - imx-spdif,  - Default Audio Device
sysdefault:CARD=imxhdmisoc     - imx-hdmi-soc,  - Default Audio Device
sysdefault:CARD=Vivere384PCMDSD - Vivere384PCM-DSD, USB Audio - Default Audio Device
front:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - Front speakers
surround40:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - 4.0 Surround output to Front and Rear speakers
surround41:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - 4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - 5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Vivere384PCMDSD,DEV=0 - Vivere384PCM-DSD, USB Audio - IEC958 (S/PDIF) Digital Audio Output

Identify your DAC from the abovementioned output and edit the startup command line to have Squeezelite stream to your DAC:
Code: [Select]
nano /etc/systemd/system/squeezelite.serviceChange the line
Code: [Select]
ExecStart=/usr/local/bin/squeezelite -n SqueezeWandto incorporate reference to your DAC and set the real time priority of the output thread at high priority:
Code: [Select]
ExecStart=/usr/local/bin/squeezelite -n SqueezeWand -o hw:CARD=Vivere384PCMDSD,DEV=0 -p 1
Reboot for the last time and in a minute or so you should be good to start playing files via Logitechmediaserver using the Wandboard.
Code: [Select]
rebootIn time I'll include more detailed guidance re adding Logitechmediaserver to the install and using the Wandboard as a standalone music server and transport.
« Last Edit: April 29, 2014, 09:29:23 AM by audiomuze »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #1 on: April 13, 2014, 06:09:36 PM »
 

Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline GearSlave

  • Peacekeeper Extraordinaire
  • Trade Count: (+3)
  • AVForums Veteran
  • *****
  • Posts: 8,796
  • Ohm's Law has no business in Audio
    • Studio B
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #2 on: April 13, 2014, 06:10:17 PM »
Excellent, excellent guide!
Resistance is not futile; it is voltage divided by current (R=V/I)

Offline lanties

  • Trade Count: (+1)
  • AVForums Veteran
  • *****
  • Posts: 1,847
  • Cape Town - Bellville - Protea Valley
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #3 on: April 13, 2014, 06:16:10 PM »
Fantastic work Evan. Thank you for taking the time to do this.
The correct statement of individual rights is that everyone has the right to an opinion, but crucially, that opinion can be roundly ignored and even made fun of, particularly if it is demonstrably nonsense! - Brian Cox

Offline gavinbirss

  • Trade Count: (0)
  • AVForums Veteran
  • *****
  • Posts: 1,062
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #4 on: April 20, 2014, 09:28:21 PM »
@audiomuze,
Great guide, thanks.

Works equally well on the SolidRun CuBox-i (quad-core in my case) as the hardware is very similar to the WandBoard. Graphics Engine seems only GC2000 and infrared is added.

http://imx.solid-run.com/wiki/index.php?title=CuBox-i_Hardware


Quote
In time I'll include more detailed guidance re adding Logitechmediaserver to the install and using the Wandboard as a standalone music server and transport.

I found the CPU underpowered and it could not decode/play 192Khz 24bit FLAC, even from WAVE without skipping...


Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #5 on: April 21, 2014, 02:02:04 AM »
I don't recall having any issues with playback when I'd previously gone down this road. I needed to implement conditional mounting in fstab in the event a HDD is present but switched to ARCH before making that work.  Will check when able.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline GearSlave

  • Peacekeeper Extraordinaire
  • Trade Count: (+3)
  • AVForums Veteran
  • *****
  • Posts: 8,796
  • Ohm's Law has no business in Audio
    • Studio B
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #6 on: April 21, 2014, 05:04:13 AM »
@audiomuze,
Great guide, thanks.

Works equally well on the SolidRun CuBox-i (quad-core in my case) as the hardware is very similar to the WandBoard. Graphics Engine seems only GC2000 and infrared is added.

http://imx.solid-run.com/wiki/index.php?title=CuBox-i_Hardware


I found the CPU underpowered and it could not decode/play 192Khz 24bit FLAC, even from WAVE without skipping...

Good find! Ive been itching to find a proper XBMC capable embedded platform for a while. It seems this one is almost there.
Resistance is not futile; it is voltage divided by current (R=V/I)

Offline gavinbirss

  • Trade Count: (0)
  • AVForums Veteran
  • *****
  • Posts: 1,062
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #7 on: April 21, 2014, 12:19:34 PM »
Apologies for going off topic...

Quote
Good find! Ive been itching to find a proper XBMC capable embedded platform for a while. It seems this one is almost there.

Twin brother has the Xtreamer SideWinder4 and seems to have the most complete plugins for XBMC with added DVBT capability. May be a better option for XBMC. Not that the Cubox-i is not. Check http://liliputing.com/, for fresh news as I believe there might be an updated version soon.

http://www.xtreamer.net/SideWinder4/

Seems high time for Tergra 4 devices to be available..

Offline scrarfussi

  • Trade Count: (+20)
  • AVForums Veteran
  • *****
  • Posts: 5,766
  • Quantum In Me Fuit
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #8 on: April 22, 2014, 06:45:22 PM »
seriously arch is king i am using it as a standalone music server and transport
on a wand dual with external hdd connected .
the speed is like  :pleasant:
just a issue of creating duplicates of some files
but i must say if you have a wandboard  arch is king
suum cuique pulchrum est


"I refuse to prove that I exist,'" says God, "for proof denies faith, and without faith I am nothing."

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #9 on: April 29, 2014, 09:25:48 AM »
Ok, to make things simple for the lazy, technically challenged and those running Windoze I've created a disk image of my 8GB microSD that has Arch Linux and Squeezelite installed.  The image has been compressed by piping through gzip so the resulting download is only 311.1MB.  Use your favourite archive manager e.g. WinZip, 7Zip etc. to unpack the downloaded image file.  Use Win32DiskImager to write the unpacked image to your 8TB microSD - basically the same instructions as that for writing CSOS.  Insert the microSD into the Wandboard (Dual or Quad should work just fine) and boot it up.  It's configured to expect a DHCP server on your network and I've not (as yet) activated Wi-Fi - I'll get round to this.

L/P = root

The archive is hosted here: SqueezeWand
I've also shared the folder housing the file should I add any additional files or delta updates in future.

Should you wish to confirm the authenticity/integrity of the .gzip file the md5 hash is:
1d69a0a13ac54ae732c049ea06e18775 *SqueezeWand.img.gz

The only thing you will need to do is run squeezelite -l and edit /etc/systemd/system/squeezelite.service to reference your own DAC - see instructions beginning with "Have squeezelite list output devices:" in my first post in above.  If you own a Vivere, there's nothing else to do as the DAC string already references it.
« Last Edit: April 29, 2014, 09:50:23 AM by audiomuze »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline IvMan

  • Trade Count: (+12)
  • AVForums Veteran
  • *****
  • Posts: 1,368
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #10 on: July 24, 2014, 02:40:10 PM »
Setup squeezelite on a raspberry PI using this guide!
Thanks  :thumbs:
 
Anyone who wants an IMG file to setup a PI, drop me a PM and I can put on dropbox

Offline BWS

  • Administrator
  • Trade Count: (+1)
  • *****
  • Posts: 15,607
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #11 on: July 30, 2014, 12:48:19 PM »

In time I'll include more detailed guidance re adding Logitechmediaserver to the install and using the Wandboard as a standalone music server and transport.

How much time do you need?  :baseball: :please:
Whoever originally coined the word 'Lisp' and put an 'S' in it's spelling, is a Douchebag !!

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #12 on: July 30, 2014, 12:52:01 PM »
Never going to happen - squeeze on arch has it covered, not so?
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline BWS

  • Administrator
  • Trade Count: (+1)
  • *****
  • Posts: 15,607
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #13 on: July 30, 2014, 01:10:01 PM »
Never going to happen - squeeze on arch has it covered, not so?

 :facepalm: What's one more Linux distro to the list  :point:
Whoever originally coined the word 'Lisp' and put an 'S' in it's spelling, is a Douchebag !!

Offline lanties

  • Trade Count: (+1)
  • AVForums Veteran
  • *****
  • Posts: 1,847
  • Cape Town - Bellville - Protea Valley
Re: Roll Your Own Squeezebox transport and/or server using a Wandboard
« Reply #14 on: July 30, 2014, 01:48:54 PM »
:facepalm: What's one more Linux distro to the list  :point:

Yup also gave up on mine months ago. Easy to do for oneself but huge pain to do it for other. SoA is answer to world peace.
The correct statement of individual rights is that everyone has the right to an opinion, but crucially, that opinion can be roundly ignored and even made fun of, particularly if it is demonstrably nonsense! - Brian Cox