Search This Blog

Loading...

Thursday, May 29, 2014

Ride my Truck

After fiddling around with the Squeezebox Touch for years it finally broke. Thx G... ;)

To be honest. The Touch did a real great job for years. And still does a good job in many homes out there. However. Time goes on.

I wanted to replace it with an embedded ARM board. First I had a look at the Wandboard, which was chosen by the folks at Squeezebox forums who are developing the Community Squeeze OS. I didn't really like it due to several reasons. (Note: Community Squeeze OS is no more (5/2014) available btw!)

I've then been trying (Raspberry PI and UDOO (same Freescale processor as Wandboard) ) and comparing this or that ARM board featurewise as replacement for my SB Touch (which is nothing else then an embedded board and a well done customized Linux).

The Cubox-I family was also based on the Freescale processor. Then there was a new Humminboard and a Banana Pi.  A friend of mine refered to the Odroid boards.   Hmmh. No. Not any of these really convinced me.

By coincidence I stepped over the Cubitruck. That one looked really interesting on a first glance, regarding price and features. 





I then analysed what's going on in the related user and customer forums
of most of above mentioned boards. I also had a look at Rune and Volumio to find out about this or that showstopper.

This activity is IMO one of the key activities if you look for an ARM board !!

Even if a board comes with a great set of features, it doesn't mean these are all working properly.
If drivers are not available or flawed, it can take forever to get things going.
You might never manage to get this or that feature going or properly going.

An active and large community makes such a board a success and NOT its great HW features. At least that's my experience.

Not to forget. Companies or product families known for short lifecycle products will not attract the community and related involvement either.

Best example is the Raspberry PI. A rather crappy board performance and a limited set of features (compared to e.g. CT), but a huge  and  great community supporting it. It's long lifecycle not only attracts developers in writing software, patches, etc., no even on the hardware side there are numerous small companies, developing nice little gadgets for the Raspberry Pi.

With all that in mind I still went for the Cubitruck. It gave me the best of two worlds.
A rather active community, great HW features and useful software.
It's lifecycle will probably be on the short side.  Solid-Run got a lot going on around Cubox-I, Humminboard etc. . It doesn't look to me that these folks will have a long lasting focus on the Cubitruck.

However. I'll take that risk, since all audio related features I'm focused on are working quite well already.



Below a list why the Cubitruck won over above mentioned boards:

1. Nand Flash  - OS can reside onboard  -- no more corruption of SD cards
2. Reasonably fast (Udoo and other Freescale i.MX.6 boards are faster on paper and even got 4 processors. However the devices I tested didn't really work smooth - that might have changed nowadays)
3. 2GB RAM
4. Gbit Lan
5. Battery management and on-board battery supply option (works like a tablet),
    you could skip a linear supply.
6. Programmable GPIO pins
7. I2S and SPDIF output
8. A rather active community (not comparable to the Raspberry crowd
    though)
9. Several OS images available already
10. 5V supply voltage
11. Case included
12. Sata
13. And more stuff like, Infrared, programmable status LED, Wifi&BT
      onboard,.....

and all that @ around 90$/€.

That's IMO a much much better value then a Raspberry PI or the other boards I had a look at.


As I mentioned earlier. The key issue is to find the best software package for your board.

There are several projects ongoing, which provide headless OS server images for several boards. A quality streaming client should in any case be headless!

And there are SD card images, which focus on audio only.

Volumio just (07/2014) released an image for the Cubitruck. Rune and Community Squeeze OS (no longer available ??!!??) might come up with an image for the Cubitruck sooner or later.

These distros don't really add value to me. I don't need a Web interface for setup and configuration or player control (and related overhead) and I don't use MPD (I made my experiences running MPD for a while some years back!).

What I need though is a stable minimal image and just Squeezelite, no add-on bloatware. The best image I could find is a Debian Wheezy Server Image over at Cubieforums. It has the newest CT kernel and drivers, incl. I2S driver. Now you'll also find a Debian Jessie image. The Jessie image though comes with a Perl version that is not supported by the LogitechMediaServer! I still have to stick to
the Wheezy image.

My installation runs headless, a typical server installtion. There are some optimizations built-into this package. It's been continuously updated until now (07/2014). It also comes with a Nand installation option. Beside that I can quite easily do some kernel hacking myself.
You basically generate the entire SD card image yourself by running a single script on e.g. an Ubuntu Intel machine.
Then you just copy the image to SD card and you're ready to go.
I did change the script to avoid any installations that are not required. I also use a different kernel configuration.


I'm using Squeezelite as streaming client.
Squeezelite and several OS and audio related optimizations will be put on top of the OS image of choice. Just recently I also managed to get the Logitechmediaserver going.
I then apply pretty similar mods that you'd find in my Touch Toolbox, as well as some platform specific mods.


My earlier Arch Linux installation was running from  January till May without any issues on the NAND-flash. Even hard-powering the CT off every night didn't cause any OS corruption.
I'll keep such a setup for my Debian Wheezy (or Jessie=new Debian Testing release) installation.


There are some little downsides. You will not find many gadgets for the Cubitruck. The Raspberry Pi universe offers e.g. all kind of piggy-back I2S DACs etc... .

However.

There is an I2S output and there's also an I2S driver coming with above mentioned Wheezy image. People are running I2S DACs on the CT. It's a little more complicated to get things going though, since it requires a little soldering to activate the I2S bus.
See Annex 2.


I lately tried several USB DACs (Joro_S DSD DAC, Teac UD501, AQ Dragonfly 1.2, M2Tech USB DAC, iFi Nano DSD)  on the CT and they all performed really well.

I do have a favorite. The iFi Nano DSD DAC is a real nice one at 190$.
It sounds extremely well. It performed better then any other above mentioned DAC.
I do think there's no need to go the I2S route, if you have such a device at hand. You'll always be much more flexible with an USB audio device.

Basically with the Cubitruck plus the iFi DAC you'll be in the pricerange of a Squeezebox Touch.  With these two devices though, we're IMO talking serious audio performance in comparison to the good old SBT.
Obviously there is no display. Who needs that? You'll need iPeng(iOS) or Orange Squeeze (Android) to control your client.

Bottom line.

I highly recommend to have a look at this board. With this setup you'll easily be able to compete with commercial streaming clients that sell at a much higher pricetag.




Just a word about the server. The server needs to run the free LogitechmediaServer (LMS) package and might have to handle thousands of CDs and coverarts as well as challenging DSP processing (resampling/convolution) and multiple streams.
Putting the LMS on one of these ARM boards, even on a 4CPU UDOO or Wandboard might not be the way to go.
I did try it and never really was absolute happy with the performance.
Database actions and albumart updates can get really slow, even annoying.
Beside that many of these boards don't even come with Gbit ethernet.
However. Currently I have the LMS 7.9 server package and squeezelite running on the CT.
My data is stored on an external SATA drive. This setup works. And it can save you and me a separate server. Beside that the overall power consumption gets close to nothing (2-3W) !?!?

By using a powerful Intel machine though, with plenty of horsepower to handle multiple demanding server duties such as resampling, image and video realtime conversions as well as handling multiple clients (streams), you might consider
such a high performance solution.
However. The CT manages to handle the LMS and squeezelite. Under normal conditions (playback) you won't see a higher processor load then 1% (squeezelite = 0,3%). But if you scan your drive or if you start a song, the CPU load can jump temporarily up to the roof.


Bottom line: For now I'll use just the CT for audio server and player duties.

However. Those of you who might want to follow my trail be aware that my
approach needs some modifications and in-depth Linux knowledge.
The whole thing is not plug'n play!!
Therefore I strongly recommend to try Volumio for Cubitruck first.

I do have an image available, but do hesitate to open it to the public.
It would generate a hell lot of extra work on my side.
Beside that the Community Squeeze OS story in mind does not really motivate
to provide such a "valuable work".

I'll keep you posted.

Enjoy.

################################################
################################################

Annex 1:  HW List BoQ

This is what you need to get going.

1. Cubietruck board
2. Cooling
3. SD card (*2 for backup)

Optional:

4. USB Power supply 2.5A (1.5A will easily do if you don't power a Sata HDD)
    You might use a standard charging adapter.
5. (micro-) SD card reader for your PC to write and backup SD-cards
6. Li-Po battery 3.7V
7. Sata cable

Note: The better the 5V supply the better your CT will perform. 


Annex 2: I2S


To make I2S output work 4 resistors need to be soldered from one position into another position. Over here you'll see how it is done.

This action requires solid soldering skills!


Annex 3: CT - Debian Wheezy/Jessy + DAC + LMS + Squeezelite Installation/Integration

I might consider an article and building a public image in the future.

However. If you're interested in getting a fully integrated and tested setup,
that includes also many of my Touch Toolbox optimizations I might be able to
support you. Just PM me.


Annex 4: Binaries for CT - Debian Jessie (Wheezy)


If you try to run LMS on the CT with a Debian Wheezy ARM image, you'll find out that flac,faad and sox as supplied by LMS won't work.
Neither the Debian supplied LMS, nor the LMS nightly build .debs  come with working binaries.
(Note: LMS won't work on Debian Jessie at all due to Perl incompatibility!)

Basically your CT Wheezy LMS server won't be able to decode or transcode most of your music files.

You can't just use standard flac and faad binaries that come via Debian.
Logitech and some community members make patches available to e.g. allow fwd and rew functions. These patches also correct some bugs.


Beside that Triode (the man behind squeezelite) is not offering a squeezelite binary for the Allwinner A20 (arm7hf) (Cubitruck) for download.
I prepared  a binary with resampling enabled and another without.

The binaries are all built on Debian Jessie (the most current testing release).
I havn't tested them on Debian Wheezy for now!


If you run into problems, please let me know!

#####################################

Please, make a backup of your SD-card first!!!!!!!!!!!!!


You install and run the supplied SW at your own risk!

#####################################

Login to your CT via ssh as root first .
All you need to do now is following (copy/paste below commands):

apt-get install wget

wget --no-check-certificate https://googledrive.com/host/0BwPQKbfk8zfHRjduTkJ1MnVIcXM
mv  0BwPQKbfk8zfHRjduTkJ1MnVIcXM jessie-083014.tar
tar xvf jessie-083014.tar
cd jessie-083014
./setup-lms
./setup-sl

shutdown -r now

Note:
You can skip the setup scripts if you know what you're doing. You'll find the binaries in the jessie-083014 folder.
During the next days I'll add an start script and config file for squeezelite.

Enjoy.


....







4 comments:

  1. Hi soundcheck,
    Thanks you for a very interesting post.
    I will read around to see whether it is doable with my limited linux knowledge.
    i am awaiting your impressions of the UD80 FDA from hifmediy!!

    kp93300

    ReplyDelete
  2. Hi Klaus,
    eagerly waitimg for your progress reports. We are playing with CT for some time now and are quite happy as well. Just some minor issues with the LMS, but we'll get these sorted out.

    Cheers: Holger

    ReplyDelete
  3. Hi soundcheck. I agree with must of your points. Cubietruck is an excellent platform, even if I prefer IMX6 based solutions (I did some tests and somehow they sound better, probably a more strict application diagram results in less crosstalk).
    I just released a new version of Volumio for cubietruck
    http://volumio.org/volumio-audiophile-music-player-for-cubietruck-is-out/

    Let me know what you think

    michelangelo

    ReplyDelete
  4. Hi,

    Thanks for this informative entry. A few days ago, I recommended a non-Linuxer friend a Cubietruck for an almost identical usage scenario (running LMS and squeezelite in one box; only difference: his audio files are on an old NAS).

    It's gonna be my job to configure the OS and the software. Hope I'll figure it out even without the Wheezy installation guide you're thinking about ;)

    ReplyDelete