Setting up Amarok Media Player

Now that I have a bunch of new audio files, I wanted to be able to organize and play them in an efficient way. I've heard that Amarok is a really nice audio player, similar to iTunes but a little more powerful. Also, a nice feature is that you can store your music library information in MySQL database, making it quicker than other audio players, particularly if you have a very large music library.

Since I know amarok uses mysql, and it isn't installed on my system, I ran
sudo emerge -av mysql

When it completed installing, I ran
sudo emerge --config dev-db/mysql

(Found on the Gentoo MySQL Guide)
This allowed me to set up the root password.



Checked to make sure it starts normally with
sudo /etc/init.d/mysql start

When it started normally, I added it to the boot sequence with
sudo rc-update add mysql default

Now that MySQL is installed and running, it's time to install Amarok:
sudo emerge -av amarok

Once Amarok was done compiling and installing, I opened it up from the application menu, but nothing happened... When opening from a terminal window I got the following error:

"amarok: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory"
I went ahead and ran revdep-rebuild:
sudo revdep-rebuild

to see if that would fix the problem. It's generally one of the first things to try when running into a missing dependency on Gentoo. It scans for missing dependencies and re-compiles files as needed. Missing or broken dependencies are an unfortunate scenario that occasionally comes up with Gentoo. You wouldn't normally see such issues on a binary based distro like Ubuntu or Fedora.

Once the rebuild finished, I ran
sudo etc-update

and replaced the old sql conf file.
After that, I started up Amarok from the application menu, and success! It opened up normally!
Actually it opened with the following dialog showing:


Pressing OK brings the following screen:

This was expected, now we just need to create the SQL database, username, and password as defined in the configuration window. Start with:
mysql -uroot -p mysql

Then type in the password that was set up for root earlier.
Now that we are connected to mysql, we can create a new database with the following:
CREATE database amarokdb;

A "Query OK ..." will display if the command was successful.

We can add a new user with the following:
CREATE USER 'amarokuser'@'localhost' IDENTIFIED BY 'your_password';

You should use something other than "your_password" in the above command.
Again, we are looking for a "Query OK" to verify success.
Finally, we need to set permissions as indicated in the Amarok configuration window:
GRANT ALL ON amarokdb.* TO 'amarokuser'@'localhost' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;

Use the password created earlier for "your_password"
The "Query OK" message should display after each command.
At this point, the MySQL database, user, and permission should be successfully created.

Now, back in the Amarok Configure window, replace the password with the one that was created earlier and hit "Apply" or "OK." Then Amarok needs to be completely exited and then reopened for the new database settings to be used. When Amarok is reopened, the following window shows up looking for all the music files.

Find wherever the music files are stored, hit OK and Amarok scans the directory. The files are now shown in the Local Collection on the main Amarok Screen. From here on out it should be somewhat simple to figure out how to add playlists and so on. Check out the User Manual for more info on operating Amarok.

No comments:

Post a Comment