<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

WMA

From SqueezeboxWiki

Revision as of 09:47, 7 November 2011 by Inomine (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

WMA on Linux:

First make sure that you have both FFMpeg and LAME installed. These may come pre-packaged and configured for your particular flavour of Linux, or else they can be compiled from source from the individual projects' websites.

Once you have those installed and are sure they are available in your path, create, or add the following lines to, the convert.conf file:

  • usually: /usr/local/squeezecenter/squeezecenter-convert.conf (path is your installation path for slimserver)
  • Ubuntu: /etc/squeezecenter/squeezecenter-convert.conf
  • Gentoo: /etc/squeezecenter/convert.conf (most of the time this mod is done by default in the ebuild)

Most distributions will not overwrite this file upon upgrades to slimserver.

wma mp3 * *
	[ffmpeg] -v 0 -i $FILE$ -f wav - | [lame] -x -m s -r -S -q 5 -s 44.1 - -

Note:

After doing this, I still was only getting alot of click click click sounds when I played the WMA files. I 'downgraded' my version of ffmpeg and it worked fine after that. Unfortunately I did not keep track of which version worked and which didn't. Keep this in mind if you have similar symptoms.

Note:

Lossless WMA is not currently supported on Linux. But it is possible to get it to work, see below.

Alternative with mplayer

I could never make the above method work with mms://-urls. I wrote the following wrapper-script around mplayer instead:

#!/bin/bash
FIFO=`mktemp -u`
mkfifo $FIFOmplayer $1 -really-quiet -vo null -vc null -ao pcm:fast:file=$FIFO > /tmp/mplayer.out 2>&1 &
cat $FIFOrm $FIFO

I named it mplayer-fifo, put it in /usr/local/bin/ and added the following to convert.conf:

wma wav * *
	[mplayer-fifo] $FILE$

I can now listen to streaming wma via mms://-url on my Squeezebox.

Alternative with mplayer without wrapper

wma wav * *
	[mplayer] -really-quiet -vc null -vo null -cache 64 -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/4 $FILE$ 4>&1 1>/dev/null


AlienBBC might be required

As suggested here, installing the AlienBBC extension might be required. Only after the installation of AlienBBC, both mplayer conversion methods outlined above worked for me.

Getting WMA Lossless working on Linux

With a little bit of effort it's possible to get this to work. We use a combination of the above with an extra plugin for mplayer that allows it to playback WMA lossless. All this is done on SC 7.6, with a SB 3, running on Ubuntu Oneiric Ocelot.

The instructions differ depending on whether you are running Ubuntu 64 bit (amd64) or 32bit (i386). Other architectures will not work with this method.

32 bit

This is nice and easy, we will be using the provided packages

Start with making sure that mplayer is installed. On Debian/Ubuntu this should be as simple as:

sudo apt-get install mplayer

and answering yes.

We are now going to need to install the Win32 DMO decoder dlls. Again, on Ubuntu 32 bit this is easy, we're going to get them from medibuntu, here:

http://www.medibuntu.org/

Add the repository:

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

and then just run:

sudo apt-get install w32codecs

This should allow mplayer to playback wma lossless. So go ahead and check. Running:

mplayer -ao null -vo null file.wma

Should result in something that looks like

MPlayer SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team

Playing 01 La Femme d'Argent.wma.
ASF file format detected.
[asfheader] Audio stream found, -aid 1
Clip info:
name: La Femme d'Argent
author: Air
==========================================================================
Opening audio decoder: [dmo] Win32/DMO decoders
AUDIO: 44100 Hz, 2 ch, s16le, 1152.0 kbit/81.63% (ratio: 144000->176400)
Selected audio codec: [wma9dmo] afm: dmo (Windows Media Audio 9 DMO)
==========================================================================
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  10.2 (10.2) of 434.0 (07:14.0) 16.3%

You won't hear anything, as we're using null outputs here, but the presence of the dmo lines should indicate that it works.

64 bit

A workaround is required. Have a look at the instructions at:

http://vvishnyakov.blogspot.com/2011/11/32bit-mplayer-on-64bit-ubuntu.html

for how to get 32 bit mplayer, and the codecs, onto a 64 bit system.

Both 32 and 64 bit

Next we need to add some lines to:

/etc/squeezeboxserver/convert.conf

I went ahead and commented all lines containing wmal so that my mapping was always used, and added:

wmal pcm * *
    [mplayer] -really-quiet -vc null -vo null -cache 64 -af volume=0,resample=44100:0:1,channels=2 -ao pcm:nowaveheader:file=/dev/fd/4 $FILE$ 4>&1 1>/dev/null

Note that we are using pcm here and now wav as above, for some reason wav didn't work for me. If you're using the above 64 bit instructions the mplayer command will also need to be changed to mplayer32

And that's it, a restart of the server software and everything works :) I'm sure this can be improved, as I don't think things like skipping currently work, but otherwise my entire library of losless WMA is now accessible.