This article documents how to run the Windows version of Spotify in Linux, using Wine. The installation instructions are specific for Debian, but might work without problem in Ubuntu and the general instructions might apply for all system capables of running Wine. It runs fine on FreeBSD 7 too.
$ sudo aptitude install wine
Spotify is known to work with Wine 1.0 or later, but older versions may work as well. If your distribution doesn’t come with a version that is new enough, you can download the latest at http://www.winehq.org/site/download.
Start winecfg and make sure your audio works.
$ winecfg
Go to the Audio tab in the program and click on Test Sound. If you hear something, then you are all set, if an error message appears you have to configure it. Make sure the ALSA checkbox is checked and press OK and restart winecfg (it needs to re-initialize sound drivers) and click on Test Sound again. When you hear something you can continue. If you can’t get sound to work, it is unlikely you will hear anything in Spotify.
In the DirectSound frame at the bottom enter the following for best sound.
Hardware Acceleration: Emulation Default Sample Rate: 44100 Default Bits Per Sample: 16 Driver Emulation: unchecked
Download and install the Windows version of Spotify.
If you are running Gnome or KDE or some other desktop environment, you can probably install by double clicking on the Spotify Installer.exe icon and then start it from the application menu.
Otherwise, to install
$ wine "Spotify Installer.exe"
and to start
$ wine "C:\Program Files\Spotify\spotify.exe"
If you have problem with the installer, you can download spotify.exe directly.
If Spotify still doesn’t work after following the procedure above, here are a few things you may wish to try:
Check your wine version. Run
$ wine --version
If this is significantly older than 0.9.49 you must update wine.
If you can start spotify, but you get an error message when you try to play tracks, there might be another program that has exclusive access to the audio device. Wine also writes an error message to stdout
err:wave:wodOpen Error open: Device or resource busy
In Linux this is usually a bug in alsa or an audio device driver. There is no workaround possible for spotify, this has to be fixed in your system.
To make it easier to see serious error messages, you can remove the fixme messages with the environment variable WINEDEBUG.
$ WINEDEBUG=fixme-all wine spotify.exe
As a last resort, try with a clean .wine directory. Run
$ mv ~/.wine ~/.wine_old
to move your current .wine directory to a new place and then repeat the steps from the beginning.
This has been tested and works with Firefox (Iceweasel), Epiphany and Opera 9.5.
To be abe to open spotify URIs you first need a simple script:
echo '#!/bin/sh' > ~/.browser2spotify echo 'exec wine "C:\Program Files\Spotify\spotify.exe" /uri "$@"' >> ~/.browser2spotify chmod 755 ~/.browser2spotify
(Change the path to the spotify executable if necessary)
In Epiphany enter the following in the URI field:
about:config
Right click and select New > Boolean and name it network.protocol-handler.external.spotify and set it to True
Right click and select New > String and name it network.protocol-handler.app.spotify and set the name to ~/.browser2spotify
In the menu, open Tools/Preferences. Pick the advanced tab and then the programs tab. Click “add” and choose “spotify” as protocol and select the .browser2spotify program as the handler program. Note that the file selection dialogue does not list files starting with a dot, so it’s easiest to write the full path manually.