Wednesday, January 31, 2007

Amarok Music Manager


History Lesson

I am currently running Ubuntu Edgy (6.10). As stated in the previous article, I have a Creative Zen Xtra PlaysForSure (MTP) device. PlaysForSure started out as a strictly Microsoft-only thing, but then an open-source library called libmtp came into the scene.

Fact:
Amarok rocks your face off.

Another Fact:
Amarok supports almost every type of portable music player. Including PlaysForSure devices.


Why I'm writing this:
I have just recently installed the latest version of Amarok from source into my Ubuntu distribution (Edgy). The latest and greatest version supports all of these portable devices, whereas the one in the Ubuntu repositories does not. To see a full feature list, visit Amarok's main site.

The rest of this article will focus on how to set up and install the latest version of Amarok from source into Ubuntu Edgy (6.10).

The next release - Feisty (7.04) - will come with a version of Amarok that will support PlaysForSure (MTP) devices.

For each of the command's given, copy and paste each line into a terminal window.

i) You must have the repositories enabled to do anything else. Note that you will need the administrator password for all of this as well.
- Click on System --> Administration --> Software Sources
- Make sure all of the check in the first tab under "Internet" are checked.


1) First we must make sure you do not already have Amarok installed.
sudo apt-get remove amarok amarok-xine

If you have previously installed amarok with checkinstall and a different package name, use Synaptic to find it and remove it.

2) Installing the necessary tools to build Amarok
*NOTE - this step will require approximately 160mb of hard disk space.
*Thanks Cigar_Jack on the correction.
sudo apt-get install build-essential checkinstall
sudo apt-get build-dep amarok


2a) Installing the latest version of libmtp from source.
- Travel to http://sourceforge.net/projects/libmtp and download libmtp to your desktop.
- Right-click the archive and select "Extract here"
- Then do these commands:
sudo apt-get remove libmtp2 libmtp-dev #Thanks to oxyrosis at ubuntuforums!
cd /home/$USER/Desktop/libmtp*
./configure
make
sudo checkinstall #I named it libmtp-built, to avoid any problems


2b) Installing the latest version of libgpod from source.
- Travel to http://sourceforge.net/project/showfiles.php?group_id=67873&package_id=156254 and download libgpod to your desktop.
- Right-click the archive and select "Extract here"
- Then do these commands:
cd /home/$USER/Desktop/libgpod*
./configure
make
sudo checkinstall #I named it libgpod-built for the same reason as above.



3) Download the file.
- Browse to http://amarok.kde.org/wiki/Download:Source
- Click on tarball
- Click on a local mirror.
- Create a folder on your desktop called Amarok
- Click on the file "amarok-1.x.x.tar.bz2" and save it into the folder
- Browse to the folder, right-click the file, and click on "Extract Here"

4) Install the program
- For the last command, make sure you rename the package before hitting enter the third time. Don't leave the package named as "amarok" - Ubuntu will "update" it to the older version. Instead, rename it to "amarok-built" or something different than "amarok". Just follow the on screen directions and you should be ok.

sudo chown -R $USER:$USER /home/$USER/Desktop/Amarok
cd /home/$USER/Desktop/Amarok
cd amarok*
./configure --with-libnjb --with-libmtp --with-libgpod --prefix=`kde-config --prefix`
make
sudo checkinstall




This how-to was written with the help of this how-to at ubuntuforums:
http://ubuntuforums.org/showthread.php?t=316246&highlight=amarok+mtp

43 comments:

Anonymous said...

nicely done!

John said...

Sweet How To!!! I really used it to set up support for my Karma (adding libkarma) to your instructions. But using this I was able to get MTP device support as well as Karma device support built!

Thanks for the help

Anonymous said...

if I use 'sudo aptitude purge amarok amarok-xine', aptitude wants to remove kubuntu-desktop and the rest of kde with it. Is there a way to remove just amarok and amarok-xine? Thanks in a advance.

Senturion said...

anonymous...

Yes, you could try

"sudo apt-get remove amarok amarok-xine"

I believe it would still ask to remove kubuntu-desktop, but the rest of the kde stuff should be left.

That command was primarily for Ubuntu (Gnome) users. Try the command and tell me what it wants to remove.

Anonymous said...

Thank you.. that did it. It still removed kubuntu-desktop, but that is easily re-installed.

Senturion said...

Cool, I'm glad it worked!

Anonymous said...

I am running into a Qt dependency problem. I thought I needed to install kubuntu-desktop, but that didn't solve it. I get this: checking for Qt... configure: error: Qt (>= Qt 3.3 and < 4.0) (headers and libraries) not found. Please check your installation!
For more details about this problem, look at the end of config.log.
Any help would be appreciated. Sorry if it's noob. :|

kuriharu said...

Doesn't work for me. When doing the ./configure for amarok, I get "Can't find X libraries. Please check your installation and add the correct paths!" and it aborts.

Anybody have any clues? I just love installing from source.....

Raag said...

Hi!

I did install it as instructed. However, when started Amarok says unable to initialize any Xine audio drivers (I have no idea what that means), and as soon as I click on All Collection in playslists, the program exits without warning.

Anonymous said...

First, I read your profile, keep struggling friend.
Second, I tried MANY different "how to's" to get my Zen Vision M working with Amarok and YOURS was the one that finally made it work.
I think it works. It reads my device but will NOT play any of the music on it. I get a message that "some media could not be loaded (not playable)"
Now I'm not sure just what i CAN do with Amarok and my "M".
Can I transfer from it?
Can I transfer to it?
Can I create play lists?
Should I be able to play from it?

This is a very good "how to", THANK YOU

Senturion said...

anonymous,

if you are referring to playing music straight from ur vision m, then to my knowledge you cannot do it. but you CAN transfer the music on it and create playlists and such - at least on my zen xtra i could.

let me know if you can transfer music or not.

Anonymous said...

Hey, Great how-to. i just finished installing it, and now ubuntu is pushing me to upgrade to the newer version (its 2.4 or somehing). I was wondering if it will affect the mtp support? For now , ill just ignore the upgrade icon until i find out.

Senturion said...

When you run the command:

"sudo checkinstall"

you must read what you are doing carefully. One of the times you hit enter, it asks if everything is ok, like the name, description, etc. Press the number next to the name and hit enter. Then enter a new name like amarok-built or something crazy. Whatever you like. Then hit enter, and you should be good. You MUST read what you are doing during that point.

So anonymous, type in "sudo apt-get remove amarok" and then rebuild it, and name it to something other than "amarok" - the name in the repositories. Leaving that name will confuse Ubuntu and undo all that you did. Don't do it.

Anonymous said...

hi, i'm really noob in linux...
first of all thank you so much for writing these "how to", they're really helpful for us...
I've got 1 question for you, and i'm pretty sure it will be easy for you to answer :)
when i did

sudo apt-get install build-essential checkinstall libmtp2 libmtp-dev

AND

sudo apt-get build-dep amarok

I got 160 mega installed in my pc...as i'm not using amarok anymore, can u please tell me how to safely remove that stuff? 160 MB are important for me, as my linux partition in pretty small...thank you so much!!!

Senturion said...

henry, that 160 mb install was from all of the kde pieces being installed. Amarok was built for KDE - a desktop environment like Gnome - and to run Amarok, it needed the essential pieces of KDE to run. Since you no longer are using Amarok (and provided you are not using any other KDE application), first try

sudo apt-get autoremove

If that doesn't get rid of those KDE libs, try this

sudo apt-get remove kde*

The second option will get rid of most, if not all, of the KDE pieces. Then after doing that, do

sudo apt-get autoremove

again.

Good luck!

Unknown said...

I feel like kissing you!!! I have tried and tried and tried a few times more to get my Vision M to work with something other than stone-age-GUI gstreamer. Your how-to finally worked. Multiple, oh so many thanks.

chris said...

kuriharu said...

Doesn't work for me. When doing the ./configure for amarok, I get "Can't find X libraries. Please check your installation and add the correct paths!" and it aborts.

Anybody have any clues? I just love installing from source.....

chris said...

:) bad post, what I meant was that I am having the same problems as kuriharu

-----
kuriharu said...

Doesn't work for me. When doing the ./configure for amarok, I get "Can't find X libraries. Please check your installation and add the correct paths!" and it aborts.

Anybody have any clues? I just love installing from source.....

-----

Unknown said...

Instead of

sudo apt-get build-essential checkinstall

should it be:

sudo apt-get install build-essential checkinstall

Just curious, thanks.

Anonymous said...

Anyone else getting this with Kubuntu Edgy?

/usr/bin/ld: BFD 2.17 Debian GNU/Linux assertion fail ../../binutils-2.17/bfd/elflink.c:6261
/usr/bin/ld: .libs/amarokapp: hidden symbol `__fini_array_end' in .libs/amarokapp is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[4]: *** [amarokapp] Error 1

I've tried uninstalling everything I can think of and then reinstalling the latest versions. I installed this distro just recently.

Senturion said...

chris and kariharu, cigar_jack pointed out a small (but big) typo in the install instructions. I accidentally left out the word "install" from step two entirely. I added it now. Try the steps again and tell me if it works this time. I am also sorry about my absence - I've been very busy with many other things not pertaining to computers.

Brandon said...

This doesn't seem to be working for me :-?
Here's what it says:


Copying files to the temporary directory...OK

Striping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package... FAILED!

*** Failed to build the package

and the log says:

dpkg-deb: parse error, in file `/var/tmp/pdcXLoXqWnJRLQJilNiCS/package/DEBIAN/control' near line 8 package `a
maroks':
newline in field name `3.5.6'
/var/tmp/pdcXLoXqWnJRLQJilNiCS/dpkgbuild.log

any help would be much appreciated. I'm a total linux/ubuntu noob.

Anonymous said...

Ah well, Feisty will be out soon...

Sergio said...

Hi! and thank you for this guide. I a newbee in Linux so maybe my question is quite stupid but here is my problem. All the installation process was ok until I came to the "install the program" moment. The ./configure command worked fine but when I did the "make" command I get this message:

make: *** No targets specified and no makefile found. Stop.

Did I miss something? Please, help me! ;-) Thanks in advice

Senturion said...
This comment has been removed by the author.
Senturion said...

troski, can you give a better detailed explanation as to what happened?

Sergio said...

Hi Jonathan! Thank you very much in advance!!
I'm using Ubuntu 6.10 Edgy with a Pentium III (1Gh), 256 RAM, Nvidia G-force MX and a C-Media PCI CMI8738 soundcard.
I've tried again to follow this guide step by step. When I try the 4th step (install the program), after the ./configure ...--prefix` command I get this message:

checking for X... configure: error: Can't find X libraries. Please check your installation and add the correct paths!

The entire result of that step can you read here: http://troski76.blogspot.com/

I guess that I'doing something wrong but what? The first time I didn't notice that error and tried to to do the "make" command but it didn't work (make: *** No targets specified and no makefile found. Stop.).
Thanks for all once again.

Senturion said...

troski,

can you tell me if you have kdelibs installed? (type "sudo apt-get install kdelibs")

also, are you sure you typed "sudo apt-get build-dep amarok" and when you configured, you typed:

"./configure --with-libnjb --with-libmtp --with-libgpod --prefix=`kde-config --prefix`"

i'm currently on my windows box, but i'll get back to you shortly if this still doesn't work.

Anonymous said...

you can also use the ad/remove program to help and make it less painful

Couts said...

LOL my installation did not go really far after

sudo apt-get install build-dep amarok

I've got the error message :
E: Impossible de trouver le paquet build-dep

Senturion said...

couts, my mistake!

type this:

"sudo apt-get build-dep amarok"

Dave said...

I'm consistently getting the error:

dpkg-deb - error: (upstream) version (`built') doesn't contain any digits
dpkg-deb: 1 errors in control file


any ideas? thanks

Senturion said...

That's a very odd error.

I'm afraid i do not know what that means.

If you already haven't, post that in www.ubuntuforums.org. I'm sure there's somebody who knows their stuff on dpkg to know what went wrong.

Anonymous said...

hey there, i just moved to edgy. but im still new to linux

i followed the instructions above on edgy and wroked perfectly.

i was wonderin if i have to follow the same instructions to make it work on feisty.

thanks in advance =)

Senturion said...

joel -

you will not have to do any of this in feisty. The application repositories will have the already newer version of Amarok, so all you'll have to do is tell it to install.

When you're in feisty, make sure you type "sudo apt-get remove amarok*"

and then type "sudo apt-get install amarok"

You should be good then

Anonymous said...

For all you GNOME lovers out there, rhythmbox now supports mtp devices. Get it while it's hot from svn trunk.

Anonymous said...

In response to "Can't find X libraries. Please check your installation and add the correct paths!"

After looking into the config.log file generated by configure it became clear that "X11/Intrinsic.h" was missing. A search on
http://packages.ubuntu.com/ for contents of packages (Intrinsic.h) revealed I had to install a package named libxt-dev

...now to get all the Qt-libraries installed :)

taylor sparrow said...
This comment has been removed by the author.
taylor sparrow said...
This comment has been removed by the author.
taylor sparrow said...

getting stuck at "make" on amarok.
error messages look like:
/usr/local/include/libmtp.h:521: error: too many arguments to function 'int LIBMTP_Create_New_Playlist(LIBMTP_mtpdevice_t*, LIBMTP_playlist_t*)'
mtpmediadevice.cpp:916: error: at this point in file
make[5]: *** [mtpmediadevice.lo] Error 1
make[5]: Leaving directory `/home/billy/Desktop/amarok/amarok-1.4.9.1/amarok/src/mediadevice/mtp'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/billy/Desktop/amarok/amarok-1.4.9.1/amarok/src/mediadevice'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/billy/Desktop/amarok/amarok-1.4.9.1/amarok/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/billy/Desktop/amarok/amarok-1.4.9.1/amarok'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/billy/Desktop/amarok/amarok-1.4.9.1'
make: *** [all] Error 2

total novice and stumped now.

Senturion said...

Taylor, if you are running Ubuntu Feisty, you can just install Amarok using Synaptic and it will include support for PlaysForSure devices. This article was written for older versions of Ubuntu. I would recommend upgrading to a newer version of Ubuntu.

Anonymous said...

nice post

Senturion said...

Thanks!