Joggler Squeezeboxes (part ii)

After a lot of trial and error, I now have the Jogglers able to cope with WMA streams, which is to say that they can now play the BBC iPlayer Internet Radio streams. There are a few limitations, but I finally feel like I’m getting somewhere with the problem.

The solution is (as expected) to transcode at the Squeezebox server, converting WMA streams destined for the Jogglers into PCM streams. However, working out exactly how to do that has involved quite a lot of trial and even more errors. Ultimately, on my Ubuntu based server, I only needed to create a single file – /etc/squeezeboxserver/custom-convert.conf.

The content is as follows:

#
wma pcm * 00:0E:8E:22:9B:52
   # FR
   [mplayer] -really-quiet -vc null -vo null -cache 128 -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/1 $FILE$
#
wma pcm * 00:0E:8E:25:09:ED
   # FR
   [mplayer] -really-quiet -vc null -vo null -cache 128 -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/1 $FILE$

That may be hard to read due to the formatting, but this is really 2 sets of 3 lines, where each set of 3 lines relates to one of my two Jogglers; those lines describe:

  1. the transcode that I am describing, and the device for which this must take place. So, WMA to PCM, for a device with a given MAC address.
  2. the capabilities of the external transcoding application described in line 3. Refer to the comments in the convert.conf file in the same directory for what the codes mean; in this case, that this transcoder can cope with both files and remote streams.
  3. the command line to do the actual transcoding. The syntax is a little odd, as mplayer has no obvious way to write PCM to stdout (which is what is required), but using /dev/fd/1 as the output file achieves this admirably. $FILE$ is substituted with either a filename or a URL depending on the source of the WMA that needs to be transcoded; either is acceptable to mplayer.

The only issues I’ve found so far are that:

  1. Squeezebox server doesn’t seem to correctly clean up the transcoding processes, and leaves them running in the background. It’s not clear to me when (or even if) they ever get terminated, and if so, by whom?
  2. It seems to me that when playing back a “listen again” stream, I ought to be able to seek backwards and forwards in it. Unfortunately, this doesn’t work. The stream simply restarts from the beginning, which is frustrating. Adding the additional substitution code into the custom-convert.conf file to enable start time offsets to mplayer doesn’t improve the situation, and in fact, seems to usually break the (currently working) transcoding of the WMA streams. I’ve exhausted my debugging of this, and posted for assistance on the Squeezebox server forums – I’m beginning to suspect that it may be a limitation.

For reference, here are the same lines as above, but with what I think are the correct substitution lines to enable seeking. They don’t work for me under Ubuntu 9.10 and Squeezebox Server 7.5.1:

wma pcm * 00:0E:8E:22:9B:52
# FRT:{START=-ss %s}
[mplayer] -really-quiet -vc null -vo null -cache 128 $START$ $DURATION$ -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/1 $FILE$
#
wma pcm * 00:0E:8E:25:09:ED
# FRT:{START=-ss %s}
[mplayer] -really-quiet -vc null -vo null -cache 128 $START$ $DURATION$ -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/1 $FILE$

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s