Wednesday, May 23, 2012

Running Spotify on Fedora 16

Huzzah! There's a Linux version of the famous music software Spotify. However installing it on your distribution of choice might not be as easy as it sounds.

At the moment there are only packages for Debian and Ubuntu. Though there are a few "hacked" version circling around. Here I'll describe how to do it yourself.

Note that the Linux version doesn't support free accounts atm.
The following guide assumes you are using the terminal as root, use
$ su root
to switch or use "sudo" if you have set it up.
If you're using the 32bit version some file locations may vary. Use the "locate" command to find the files you need and make sure to download the correct versions for your architecture when using the download links in this guide.

  • Step 1: Download "Alien". It's a piece of software we will use to convert the debian package of spotify into a rpm package for fedora 16.
    You can download the latest version here. If the "unstable" label frightens you you can try it with the latest stable version here, though I haven't tried it and don't know if it will work.
    The reason I went with the latest "unstable" release was because that was the one linked from the Alien website.
     
  • As Alien also is available only for Debian (sigh) we will have to start by compiling it. First, unpack the tarball you just downloaded (to download through console use wget):

    $ tar -zxvf alien*

    (If you have more than one file in that location starting with "alien" you might want to type the full filename.)
    Now, browse to the folder with the unpacked files. If you type:

    $ cat INSTALL

    You will see the command for installing Alien. However, if you haven't got the necessary libraries it will simply give you an error stating such. To install these type:

    $ yum install perl-Ext-Utils*
  • Now it's time to download spotify. Go to:

    http://repository.spotify.com/pool/non-free/s/spotify/

    Download the version for your architecture (i386 for 32bit and amd64 for 64bit). The file should be around 30MB.
  • Now we'll need something called "rpm-build" in order to successfully convert the .deb package to .rpm. We install it with:

    $ yum install rpm-build
  • Now we can convert the package! Run:

    $ alien -r spotify*.deb

    Again, if you have multiple files in that folder starting with "spotify" you might want to type the full filename.
  • Install the converted package with:

    $ rpm -ivh spotify*.rpm --nodeps
  • Almost there! Now we just need to create some "symlinks" for Spotify to correctly find some of your libraries. I found an excellent tutorial on how to do this for RHEL 6 here. I modified it slightly for Fedora 16 so type the following commands:

    $ ln -s /usr/lib64/libnss3.so /usr/lib64/libnss3.so.1d
    $ ln -s /usr/lib64/libnssutil3.so /usr/lib64/libnssutil3.so.1d
    $ ln -s /usr/lib64/libsmime3.so /usr/lib64/libsmime3.so.1d
    $ ln -s /lib64/libplc4.so /lib64/libplc4.so.0d
    $ ln -s /lib64/libnspr4.so /lib64/libnspr4.so.0d
  • Now run Spotify (not as root - for some reason that makes it complain about the process already running).
  • If for some reason songs won't play try rebooting your machine. I had this problem at first and am not sure what finally solved it.
That's it, GLHF!

Sunday, May 13, 2012

Feeling Blue?

Problem: Color issue with Flash videos using nVidia driver.
Solution: None.
Possible Temporary Fix: Switch to noveau drivers or disable hardware acceleration.

If you, like me, are running Shockwave Flash version 11.2 r202 along with a nVidia card and the proprietary drivers in Linux you might have noticed a lot of blue skinned people posting in Youtube videos.

No, it's not a new race. For some reason the colors get screwed up and the resulting video has a lot more blue in it than intended.

After reading about the issue over at these forums I found out that I, like others, had a wrapper installed for running browser plugins not intended for my architecture. As my browser and plugins are all 64bit this "nspluginwrapper" could be safely removed. However this had nothing whatsoever to do with the problem at hand. Still it was a nice discovery.

Back to the issue at hand, it seems like it can be reproduced under the following conditions:
  • Running Fedora 16 x86_64 (64bit).
  • Using the propretiary nVidia drivers.
  • Using Shockwave Flash version 11.2 r202 (Adobe Flash Plugin).
Testamonials from above linked website say that disabling hardware acceleration or switching to the noveau (open source alternative) driver "solves" the issue.

If that's not an option then here you have another solution submitted by StephenH over at fedoraforum.org who in turn refers to this source.
As root, enter the following into a terminal.

$ mkdir /etc/adobe

$  su -c 'echo EnableLinuxHWVideoDecode=1> /etc/adobe/mms.cfg; echo OverrideGPUValidation=true >> /etc/adobe/mms.cfg'

This will create a directory called "adobe" within the /etc directory. The second command will create a file called mms.cfg with the lines:
EnableLinuxHWVideoDecode=1
OverrideGPUValidation=true

However this solution was reported by another member as causing problems such as instability and very long load times for flash applets.

One user suggests removing the line "OverrideGPUValidation=true" from the file, thus having mms.cfg containing only:
EnableLinuxHWVideoDecode=1

I'm going to give the last suggestion an attempt and post the results...


...and it didn't do anything at all.

I guess I'll just stick with watching Avatars over at Youtube on a daily basis for now as I don't feel like switching drivers to noveau and there's no way I'm disabling hardware acceleration on my Intel Atom machine (without the ION chip I won't be watching much of anything).


Update Monday, May 14 2012
New nVidia drivers today, however the problem remains.

Kernel 3.3.5-2 of Doom

Problem: Linux Kernel 3.3.5-2 won't boot. Freezes at "sendmail transport agent".
Solution: Update your video card drivers. If it isn't working, simply use an older kernel while waiting for a driver update. The official nVidia driver is confirmed working as of 295.49-1 (with kmod on x86_64).

New kernel released today for Fedora 16 x86_64.

Great! Now my system won't even boot... For some reason it keeps locking up on "sendmail transport agent".

Haven't got a solution right now so Imma stick to 3.3.4-3 at the moment.

I'll get back when I've got more information.


Update Monday, May 14 2012
I found the solution! After reading this page I found out that there was an incompatibility with the new kernel and my current nVidia drivers.
Since I a little while ago ran a "yum update" and received the latest nVidia drivers I simply booted into the new kernel and it works like a charm.

Saturday, May 12, 2012

Where are my frelling window borders?

Problem: Lost window borders and workspaces. Inability to click options in pop-up menus.
Solution: Clear the session cache.

After shutting down my PC to move to the other side of the table before booting it up again I discover to my frustration that my beautiful Fedora 16 Xfce desktop has become a pile of dren (if you haven't noticed yet I'm a Farscape fan).In addition I couldn't click and pop-up menus as they would disappear when hovered upon, as well as all my workspaces save for the first being gone as well.

I googled for quite some time reading various information on console commands and configuration settings in packages I don't even have installed(!)

Finally I find this, the wonderful solution:

  • Open up a terminal and go root if needed ("su root" or "sudo" if you have it set up). navigate to /home/[Username]/.cache (this is a hidden folder).

    You could also open up the folder within the window manager if you prefer working with GUI's (use Ctrl+H to display hidden folders).

    $ cd /home/[Username]/.cache

    (remember to replace [Username] with your actual username.)
  • Then simply delete all the files within that folder ("rm -rf *" ftw).

    $ rm -rf *

    (this is one of the most DANGEROUS commands in Linux and should be used with EXTREME caution as it will delete ALL your files in the current location without prompting you at any time after you press enter.)
  • Now just reboot your system (make sure to uncheck the remember session option just in case). Relogging might work as well but I felt safer doing a full reboot.

There it is. Hopefully it'll help someone else. Apologies to the original discoverer as I lost the link to the forums where this solution was posted. I'll keep a look out and update this blog entry with a link to the aforementioned forum thread if I find it again.


Update Monday, May 14 2012
The solution above describes how you clear your entire cache. To only clear your sessions cache (which should be enough to solve this issue); delete ONLY the files within the "sessions" folder that resides within the ".cache" folder instead of removing all contents from the ".cache" folder.