Apr 272010

This is a very short, and “simple” explanation how i made Spotify 0.4 play local MP3 files under Linux with Wine.
I have not tested this elsewhere, and i can not guarantee that everyone has to do the same steps as me.

If you want to try my finished file you can download it here: winemp3.acm.so (x86 only)
Place it in /usr/lib/wine/ (x86) or /usr/lib32/wine/ (x64).

Or if you need to do things a tad more automatic you can try this script which will do everything automatically for the ones of you on x86: winefix.sh

For those of you who want the technical details: continue reading 🙂

You should try and skip step 3 if possible, but if Spotify just hangs and max out your CPU you should do step 3.

You can also use an hex editor to change WINE-MPEG3 to LAME-MPEG3 in /usr/lib/wine/winemp3.acm.so to try before doing the, for me, crucial step number three.

Step 1: Download the wine source code.
Step 2: run configure to create the appropriate Makefiles
Step 3: edit dlls/winemp3.acm/mpgl3.c and change the following:

if (dpos > *ndst) break;
} while (ret != MPG123_ERR && ret != MPG123_NEED_MORE);
*ndst = dpos;

To this:

if (dpos >= *ndst) break;
} while (ret != MPG123_ERR && ret != MPG123_NEED_MORE);
*ndst = dpos;

Step4: Change the following:

add->cFilterTags = 0;
add->hicon = NULL;
MultiByteToWideChar( CP_ACP, 0, "WINE-MPEG3", -1,
add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) );

To this:

add->cFilterTags = 0;
add->hicon = NULL;
MultiByteToWideChar( CP_ACP, 0, "EFO", -1,
add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) );

Step 5: Run make to compile the new codec.
Step 6: copy the codec to /usr/lib/wine/ (ubuntu atleast)
Step 7: Run Spotify and enjoy.

This worked for me, but it is not recommended as i changed some code in the MP3 library in Wine.
If you use Wine with other programs which utilizes the mpeg3 library they might break.

UPDATE 1: It seems like my hack will give some problems with automatic changing of songs. The codec does not understand that the song is finished, and will just generate noise.

UPDATE 2: Ok, new fix. This time it does infact end where it should, and continues to the next track. Step 3 is updated. Same with the binary file, and scripts.

UPDATE 3: Moved around some text in this post.

Share Button
  • Pingback: Tweets that mention How i made Spotify 0.4 play local mp3 files on Linux with Wine | Yonder thoughts -- Topsy.com()

  • Gunnar

    Thanks for publishing this! I haven’t tried out yet but hope to be able to test it soon!

  • Martin


    I have opened the file winemp3.acm.so in an HEX-editor, but how do you mean I should change WINE-MPEG3 to LAME-MPEG3, I can’t even find something that looks like WINE-MPEG3?

    • espen

      Martin: Here, the value was at offset 0001:2A08.
      Search for WINE-MPEG3.
      It is towards the end of the file after a big gap of nothing (00000000) and some binary data.

  • Andy

    I love you!
    Thank you so very very much, now everything is just perfect. =)

  • John

    I have to say script is not working for me, Spotify’s error message:” there’s a problem with your sound decoder”.

    Anyways, Good Job!!!

    • espen

      John: That error comes when wine have problems finding an mp3-library at all.
      What version of wine are you running?
      (dpkg -l wine).

  • Patrik

    Great, thanks! On my Ubuntu 9.10 64-bit system I had to change the name “lib” to “lib32”, it worked with this command:
    sudo wget http://blog.mrfjo.org/winemp3.acm.so -O /usr/lib32/wine/winemp3.acm.so

  • John

    Espen: I’m running this wine version: 1.0.1-0ubuntu8 on Ubuntu 9.10. Before using the script at least I could listen “streaming-songs” and if I reinstall wine , spotify runs like before : sound in “streaming-songs” but no sound in local. Any suggestion?

    Thanks for all and have a nice time.

  • John

    I have solved the problem using another way, I know it’s not the best one but it has solved my problem 🙂 Here is :

    “Another solution is to replace the built-in winemp3.acm.so with another driver. Use with caution. Some MP3s will consistently crash Spotify, because either the length of the track or the position is misreported. So when you reach the end of some songs, Spotify hangs in a busy wait loop, expecting more data from the codec, ending up eating all your CPU.

    Here’s the override if you don’t mind some crashing:

    1. The easiest way to get the driver is to install WMP10: http://www.microsoft.com/windows/wind
    2. Copy ~/.wine/drive_c/windows/system32/l3codecp.acm to ~/.wine/drive_c/windows/system32/winemp3.acm
    3. Open Wine Config. Go to the Libraries tab. Under “New override”, enter “winemp3.acm” and click Add.

    Start Spotify. Now your local files should play. ”
    It’s taken from: http://getsatisfaction.com/spotify/topics/spotify_under_wine_unable_to_playback_local_files#reply_2336829

    Thanks for all and have a nice time

  • Thomas

    Thanks! The automatic fix worked for me on Debian unstable 32-bit.

  • RKV

    Works.. !
    Thanks a LOT man!

  • tom

    This sounds really odd, but this workaround worked properly this morning, but now it suddently stopped working. Same error message is showing up in spotify again, and I have to switch between Spotify and Rhythmbox again to listen to tracks on my computer -.-

  • tom

    Oh… I forgot to add, that .mp3 files still work but .m4a files stopped suddently playing after several hours of listening to them.

  • OJ

    Managed to get Wine to play local files on OpenSUSE 11.2 using your solution. Great!

    BUT, it did not work on Ubuntu. I found this:


    It works great, and is a much easier solution. If you already have a Windows-partition you already have the file “l3codecp.acm” in system32 so just copy it and rename it as described.

  • Mikael

    Thanks. It worked fine, although I had to add the file to /usr/local/lib/wine instead of /usr/lib/wine because my Wine was built from source

  • http://www.carlssons.se Alfred

    Ubuntu 10.04 64 bit here. Your file worked fine.
    I get a very short (~0,1 sec long) static noise before each local file starts playing, but beyond that it’s all good. Does anyone else get that too?
    Anyway… this is waaaaaaay better than not being able to play local files at all! 🙂


    • Magnus

      I get that short noice before starting a song as well. I’m running Ubuntu 10.04 32-bit.

  • Pingback: Divide and Conquer » Blog Archive » Spotify 0.4 in WINE: “File is an unsupported format”()

  • http://mastropino.deviantart.com/ MastroPino

    Thanks this worked for me! 😉

  • http://spotify-ripping.com/ spotify ripper

    thanks, i will try it

  • BroX

    Works for me!

  • http://insearchoftux.blogspot.com grindboy

    Script didn’t work for me but doing it manually using your file has worked perfectly.

    (Fresh install of 10.10)

  • http://www.uwsp.edu/athletics/mbb/roster.htm Team Roster

    Best you could change the page name How i made Spotify 0.4 play local mp3 files on Linux with Wine | Yonder thoughts to more specific for your blog post you create. I enjoyed the post nevertheless.

  • Cewan

    Wow, thanks!! Finally I can play my local files.

  • scabby

    Yess! Thank you so much! I couldn’t believe it when it worked first time. I was expecting hours of pain and drama. You rock.

  • http://www.twitter.com/PeggyBrentley Peggy Brentley

    Detailed post would it be OK if i translate into German for my blogs viewers? Thanks

    • espen

      That is ok 🙂

  • http://www.laszlo.nu André Laszlo

    Great! Works like a charm!

  • sjommi

    Copied your file to /usr/lib/wine/winemp3.acm.so. Works great on OpenSuse 11.3

  • Ben

    Maverick 10.10 working, respect!

  • Vitor

    Just worked on a 64-bit Ubuntu 10.10! Thanks, man!

  • http://geekery.lovepain.info billythekid

    Thanks so much for this… was beginning to be a right PITA this!

    Any idea how to stop the linux client from just crashing out on local play?(or am I the only person experiencing this)

  • Pingback: How I made Spotify 0.5 work under wine 1.3 | Yonder thoughts()

  • Pingback: payday loans vancouver()