May 092011

As many of you know Spotify crashes when showing the new EULA under Wine.

The “fix” is quite easy to do:

Step1: Do a clean install of Spotify under Windows
Step2: Accept the new EULA under Windows
Step3: Copy the files c:\users\\Application Data\Roaming\Spotify to ~/.wine/drive_c/users//Application Data/Spotify
Step4: Copy the files c:\users\\Application Data\Local\Spotify to ~/.wine/drive_c/users//Local settings/Application Data/Spotify
Step5: Start Spotify and crash
Step6: Start Spotify and all is good.

ps. if it doesnt work, try and copy both the windows folders, to both of the wine-application data folders.

See my other post How i made Spotify 0.4 play local mp3 files on Linux
Update: A lot of you have commented that facebook connection also have to be turned off.

Dec 272010

I have lately noticed that my Ubuntu crash when unplugging the power cord from my Laptop. This seemed to have something with the disk or disk controller since i would get ATA and file system kernel oops, and eventually a full crash.

After a bit testing i found that this came from acpid calling pm-utils (power management utilities) when unplugging the power cord.
A bit more testing revealed that it was the sata_alpm script which was the problem.
From the sata_alpm file it says it does the following:

This hook tries to save power by allowing SATA controllers to
reduce power usage when the SATA subsystem is otherwise idle.
This adds a little bit of latency to drive accesses in
exchange for moderate power savings if you are not using the drive.

I was able to circumvent this issue by doing sudo touch /etc/pm/power.d/sata_alpm.
Immediately after this i am able to unplug my power cord just as i please.

I have not given any time to solving the underlying cause for the freeze in the first time, as this lies in the part of the kernel telling the OS and file system that the drive has gone away sleeping.

Some information about the commit causing this problem:

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: (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:

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/ 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.

Apr 062009

For some time now i have been searching for a way to use the GPS on my Windows Mobile HTC Touch Diamond on Linux.

I tried several solutions to make it communicate and send raw NMEA output to the Linux gps-daemon.
Even wrote some small programs to read directly from the raw serial port on the HTC, but that was just crashing.
Then i found gps2blue which is a small program running under Windows Mobile and reading raw data from the GPS, and sending the data either over TCP/IP or Bluetooth.
Since my main laptop doesn’t have Bluetooth i use the TCP/IP options. Here, there are several choices how to connect the phone to your computer. Either by using RNDIS and a USB cable, or WIFI network.
You can even create a AD HOC network on Linux and have the phone and computer communicate where there are no other available WIFI network.

But then again i had the problem of getting gpsd to read that data, since gpsd mainlyread its data from a serial device.
I searched a bit around and found a tool called socat
Description: multipurpose relay for bidirectional data transfer
Socat (for SOcket CAT) establishes two bidirectional byte streams
and transfers data between them. Data channels may be files, pipes,
devices (terminal or modem, etc.), or sockets (Unix, IPv4, IPv6, raw,
UDP, TCP, SSL). It provides forking, logging and tracing, different
modes for interprocess communication and many more options.
It can be used, for example, as a TCP relay (one-shot or daemon),
as an external socksifier, as a shell interface to Unix sockets,
as an IPv6 relay, as a netcat and rinetd replacement, to redirect
TCP-oriented programs to a serial line, or to establish a relatively
secure environment (su and chroot) for running client or server shell
scripts inside network connections.

So to use this with gps2blue i ran the following command socat tcp4-listen:31873 pty This will create a new device in /dev/pts/.
Atleast with my udev enabled ubuntu.

Then i could fine run gpsd /dev/pts/3 and use what client i wanted.

The same principle also works on Windows, but there you need to use HW VSP instead of socat.