About fixing Bluesound playlists after CIFS migration

November 2nd, 2014

I recently wiped TomatoUSB and installed OpenWRT Barrier Breaker on my Linksys E3000 based router. In that process I also migrated our FLAC collection from my x86 based server edison  to the OpenWRT router. Life was good….. until my wife complained that the her Bluesound playlists had stopped working.

Luckily I have root access to my Bluesound and can fix stuff like this. Heres the issue and the fix.

After the switch to OpenWRT the world look like this as seen from the Bluesound:

[code]
root@Stue /tmp/var/data$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               903080    342168    515040  40% /
tmpfs                   127488        48    127440   0% /tmp
tmpfs                   127488        36    127452   0% /dev
/dev/mmcblk0p3         2778768     86668   2550944   3% /tmp/var/data
shm                     127488         0    127488   0% /dev/shm
//192.168.1.254/flac 153703308  74379356  79323952  48% /tmp/var/mnt/OPENWRT-flac
[/code]

But a peek inside the playlist.db on the Bluesound shows the following

[code]
‘StoredPlaylist::files’ => ‘/var/mnt/EDISON-flac/Arvo Part – Alina/01-Spiegel im Spiegel (Version fur Violine und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/02-Fur Alina (fur Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/03-Spiegel im Spiegel (Version fur Violoncello und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/04-Fur Alina (fur Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/05-Spiegel im Spiegel (Version fur Violine und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/03-Spiegel im Spiegel (Version fur Violoncello und Klavier).flac’
[/code]

Notice how the name of the CIFS server is part of the playlist entry. After figuring out the format of the playlist.db, it was trivially easy to write a little perl program to convert them. I did have to take care of some latin1 to utf8 as well, but that was also easy. For anyone who cares:

[code]
#!/usr/bin/perl -w
#
# convert_playlist.pl – version 1.0 gamma. Project hours: 1
#
# —————————————————————————-
# “THE WISHLIST LICENSE” (Revision 42):
# <zensonic@zensonic.dk> wrote this file.  As long as you retain this notice you
# can do whatever you want with this stuff.
#
# If you feel it saved your world a gift from http://amzn.com/w/2Y27QA7V5FUGU
# is highly appriciated
# —————————————————————————-
#
# Copyright 2014.11.01 by Thomas S. Iversen (zensonic@zensonic.dk)

use strict;
use Storable qw(nstore retrieve);

die “$0 <path_to_playlist> <regexp_match> <regexp_replace>” if(!($#ARGV+1 == 3));
my $filename = $ARGV[0];
my $regexp_match = $ARGV[1];
my $regexp_replace = $ARGV[2];
my $storable;

die “$filename does not exist\n” if(! -f $filename);
$storable = retrieve($filename);
foreach my $playlist (@$storable) {
my $name=$playlist->{‘StoredPlaylist::name’};
print “Converting playlist ‘$name’\n”;
$playlist->{‘StoredPlaylist::files’}=~s/$regexp_match/$regexp_replace/g;

# capital danish
$playlist->{‘StoredPlaylist::files’}=~s/\xc5/\xc3\x85/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xc6/\xc3\x86/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xd8/\xc3\x98/g;

# lower danish
$playlist->{‘StoredPlaylist::files’}=~s/\xe5/\xc3\xA5/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xe6/\xc3\xA6/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xf8/\xc3\xB8/g;

# lower swedish
$playlist->{‘StoredPlaylist::files’}=~s/\xe4/\xc3\xA4/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xf6/\xc3\xB6/g;

# capital swedish
$playlist->{‘StoredPlaylist::files’}=~s/\xc4/\xc3\x84/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xd6/\xc3\x96/g;
}

my $filename_new=$filename . “.new”;
print “Saving playlist as $filename_new\n”;
nstore($storable, $filename_new);
[/code]

Which I then ran as

[code]
root@Stue /tmp/var/data$ ./convert_playlist.pl stored_playlists.db EDISON OPENWRT
Converting playlist ‘Svensk jul’
Converting playlist ‘Hvid januar’
Converting playlist ‘Lektier’
Converting playlist ‘Moderne salmer’
Converting playlist ‘Total afslapning’
Converting playlist ‘P�ske’
Saving playlist as stored_playlists.db.new
[/code]

And then the last part

[code]
mv playlist as stored_playlists.db.new playlist as stored_playlists.db
reboot
[/code]

And restart the Bluesound app on the phone (it caches). Happy wife 🙂

BluOS 1.12.1

November 1st, 2014

Yet another version with support for more streaming services. And yet again I found myself looked out of my player. I am getting faster and faster at regaining root on the player :-).

Cool that new features keep being developed!

Upgrading crucial M4 SSD firmware from grub2

October 28th, 2014

The download page for firmware for the Crucial M4 SSD have three options

  • One for windows 7
  • One for windows 8
  • One generic .iso for mac and windows

Lets for arguments sake think that someone have an x200s (no cdrom) with linux, then what? Actually not that hard:

[code]

sudo mount -o loop crucial-m4-070h-07-00.iso /mnt

sudo cp /mnt/boot/isolinux/memdisk /mnt/boot/isolinux/boot2880.img /boot/

sudo umout /mnt

sudo vi /etc/grub.d/40_custom

menuentry ‘Firmware Upgrade’ {
linux16 /memdisk floppy raw
initrd16 /boot2880.img
}

sudo update-grub2

sudo reboot

<hold shift for grub2 menu>

select ‘Firmware Upgrade’

[/code]

Non-disruptive in my end, going from 0009 to 070H, but if you break anything, I will yell unicorns at you and let you keep the pieces. Because a crazy dane decideds to do this without backup, you should not do the same!

BluOS 1.12.0

October 17th, 2014

A new BluOS for my Bluesound. Version 1.12.0 brought Murfie and HDTracks support. And I almost trashed it in my attempt to gain root on the device after the upgrade. They have a bad habbit of shutting me out 🙂

Barrier Breaker on my Linksys E3000

October 15th, 2014

I finally got the time after the release of Barrier Breaker to install it on my Linksys E3000. I have been really happy with the Tomato USB by shibby that I installed back in february.

TomatoUSB is a lean mean router distribution, actively developed and work really well. So why did I switch then? To a less polished, more do it yourself router? Mainly due to the fact that it turns my router into a generic linux distro. It gets more versatile. I can install whatever I pleases. At the cost of ease of use. An ok tradeoff when you are an fulltime Unix administrator at work.

[code]

edison% ssh root@192.168.1.254
root@192.168.1.254’s password:

BusyBox v1.22.1 (2014-09-21 02:05:47 CEST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______                     ________        __
|       |.—–.—–.—–.|  |  |  |.—-.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
|__| W I R E L E S S   F R E E D O M
—————————————————–
BARRIER BREAKER (14.07, r42625)
—————————————————–
* 1/2 oz Galliano         Pour all ingredients into
* 4 oz cold Coffee        an irish coffee mug filled
* 1 1/2 oz Dark Rum       with crushed ice. Stir.
* 2 tsp. Creme de Cacao
—————————————————–

[/code]

BluOS 1.10.2

July 17th, 2014

Another small update to the Bluesound. I also noticed that someone has beenplaying around with Filter::Crypto::Decrypt in the source

[code]

root@Stue ~$ ls -al ms.pl
-rwxr-xr-x    1 root     root        164749 Jul 15 15:53 ms.pl
root@Stue ~$ wc ms.pl
1         3    164749 ms.pl
root@Stue ~$ cut -b 1- ms.pl
use Filter::Crypto::Decrypt;
ab176d4898affa5dcb8882cb377cfac18ee9bf79d1ccb3d50d7cebb3891….
[/code]

That should actucally be fun to reverse engineer.

BluOS 1.10.1

July 2nd, 2014

Another BluOS update for my Bluesound N100. This time the major new thing is support for spotify. Good for Bluesound and the young generation. Not a biggie for me. I am old skool and have ripped all my CDs to .flac.

I love the Bluesound, but still miss stuff in the interface towards it. Mots notably I miss custom tagging of music (albums, songs, artists wise). ‘her music’, ‘his music’, ‘kids music’. And then being able to see only music that I care about in the interface.

But I am really being nitpicky now. Bluesound is about streaming quality. The interface is only next in priority :-).

The old king is dead (NAD 3020i) ….

June 28th, 2014

….. long live the new king (NAD C356BEE)!

Our old NAD 3020i died. Or rather it could still amplify our music, but it started to smell when it was on and the smell of burnt electronics inside the house is neither normal, nor healthy. So we went looking for a replacement…. Rotel ra-11 looked nice. So did the pioneer A-70. And the NAD C326BEE … We also had a very very serious look at NAD D 3020. The latter was discared due to

  • us being in doubt about the D 3020’s ability to deliver the same power as the NAD 3020i, even though its specs was 50% better.
  • reviews stating that the sound was actually better when feeding it an analog source as opposed to a digital one. Then it did not make much sense to feed it with the output of the Bluesound N100 we own.

My wife, who brought the NAD 3020i into our relationship preferred NAD over the competition and in the end we had to choose between the C326BEE and the C356BEE. Being marginally more expensive, we went with the bigbrother and are happy about it.NAD_C356BEEI will have to play around with the serial port of the 356BEE and maybee put a usb2serial in the back of the Bluesound and do some magic there. But that will have to wait until later.

BluOS 1.8.2

April 4th, 2014

Once in a while you get an unexpected present. For me that present can be related to IT and wierd enough for most people, the present can be as simple as a firmware upgrade. This time it was for my  BlueSound Node (N100).

I quickly updated the node and after gaining root access to the box

edison% ssh 192.168.1.119 -l root
root@192.168.1.119’s password:

I noticed that stuff is actively being worked on by the chief developer. I would like him to write changelog in the header of the files though :-). I have run a diff against the previous codebase and besides the visible changes with support for a couple of more services, a lot have been done, under the hood. I would like the lead developer to keep a changelog inside the files for us hackers to read :-p

Upgraded my routers to run Tomato by Shibby today.

February 23rd, 2014

I upgraded my routers today. I ran EasyTomato v8.0 and 8.1 for a while on my Asus RT-N16 and had my Linksys E3000 laying dormant after I got the Asus RT-N16.

EasyTomato wins for having a porn/adult filter, and that was actually the reason for bying the Asus RT-N16 in the first place and running EasyTomato, but after some months I came to the conclusion, that the firmware lacked in the geek/hackability area.

After a bit of investigation, I have switched to Tomato by Shibby and both my Asus RT-N16 and my Linksys E3000 now runs Tomato Firmware 1.28.0000 MIPSR2-116 K26 USB Big-VPN.

The firmware works fine, have a lot of bells and whistles  and is actively developed as well with full sourcecode provided. If only I could read and write polish now :-).