This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problems with the database and disappearing playlists

Tags: None
(comma "," separated)
jefferai
Moderator
Posts
52
Karma
0
Martux wrote:Well, that's interesting. I am on gentoo here. When I try to emerge amarok with the -embedded USE flag, it will force me to install mysql-5.0.x.
So that is not a hard dependency of amarok?


No, that's actually a Gentoo-specific issue. There were problems with a patch that Gentoo had for mysql-embedded in the 5.1.4x series, so they masked it -- apparently rather overaggressively. I'm on Gentoo on my work machine, using 5.1.46, and I just tried the embedded db, and it seems to be working fine. (That said, considering that you're worried about things like backups and all, you may want to stick with an outside server as this allows
for easier manual manipulation of data if necessary).

Martux wrote:Regarding the backup strategy... yes, that would be nice. I don't even care about statistics, but keeping the saved playlists consistent is neccessary.
I mean why is it, when the collection gets rescanned the saved playlists *can* be empty? I guess it is because this tag in the xspf file:
<identifier>amarok-sqltrackuid://</identifier>


You said that you did not scan the music back into your database, right?

What the identifier is is part of AFT, which you can look at here: http://amarok.kde.org/wiki/Amarok_File_Tracking

The reason it's in there is so that you can move your files around between folders, or even change the filenames (look at that article for details of embedded vs. non-embedded tracking and their limitations), and still have your playlists play the files.

In this case, since your collection was emptied, it appears that the playlist code realizes that that track isn't in the collection and doesn't show it because it thinks the file is not playable (which if Dynamic Collection were working properly, would mean that when the media was next plugged in and that part of the collection restored, it would appear back in your playlist).

Bart (Stecchino) does playlists so he'll have to comment on this in more depth. It might be good to code a fallback or something -- or to show the files but grayed out to indicate that Amarok doesn't know whether or not they are available to be played.

Martux wrote:This line gets ignored by eg. clementine so that can load the playlist. Amarok doesn't. That is clearly a showstopper...


Right...agreed, we probably need to have a fallback for cases like this. I realize this is frustrating to you right now, but think of it this way -- you discovering this issue means we can fix it and prevent it from being a problem for others :-)

Martux wrote:Also an idea: Can't the rating of a song be stored in the id3-tag, in the comment field for example?


See my previous post :-)
jefferai
Moderator
Posts
52
Karma
0
Martux wrote:jefferai, thank you for the kind words. I learned that Opera has a built in irc-client. Can you give me a room-address, we could meet there then.
In the meantime I build amarok again, this time with embedded flag set and mysql-5.0.90. Thanks, Marcus


I'm usually in #amarok, and my nick is jefferai.

Please be aware that I'm always on but not always there -- but I nearly always respond to highlights eventually.

Also I'll be doing some traveling so I won't really be around much for the next 24-hoursish.

All that said, feel free to poke me anytime.
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
OK, thanks. How did you manage to get the embedded db working with 5.1?
I don't care about backups right now, because I have all my playlists in "clean" m3u file format. So that's a good chance to start all over again. I am willing to do so, as your support here is great and I *love* amarok ;)
Btw. FMPS looks like something really promising! Would be lovely to have it working!!
jefferai
Moderator
Posts
52
Karma
0
Hi Martux,

That's a hard question for me to answer, because for me it "just worked". You haven't said in what way it fails for you -- can you describe this in more detail?

One thing that might be enlightening is the output of running amarok --debug in the command line. For full debug output during startup you need to run it twice (if you don't always run it this way) so try the following:

amarok --debug
(change to embedded mysql and then close amarok)
amarok --debug --nofork

See if the output has anything strange in it -- if you're not sure, feel free to paste it here or in a pastebin and link to it.
User avatar
Stecchino
KDE Developer
Posts
88
Karma
0
jefferai wrote:Bart (Stecchino) does playlists so he'll have to comment on this in more depth. It might be good to code a fallback or something -- or to show the files but grayed out to indicate that Amarok doesn't know whether or not they are available to be played.

Martux wrote:This line gets ignored by eg. clementine so that can load the playlist. Amarok doesn't. That is clearly a showstopper...


Right...agreed, we probably need to have a fallback for cases like this. I realize this is frustrating to you right now, but think of it this way -- you discovering this issue means we can fix it and prevent it from being a problem for others :-)


We actually already have that fallback, we use the <location> in the XSPF when the <identifier> is not valid or didn't give us a valid Track object.
Here is the code that does that.

Assuming the XSPF was created by Amarok identifier holds the internal amarok URL that makes it very fast to load the Track objects and location is just the file on disk. I don't understand how this fallback could have failed, unless the filesystem location of the files changed after you reconnected the HD.
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
Hi!
Thank you all for these very insightful help.
Right now I have amarok working fully again, the only way it seems to be supported on gentoo: with mysql-5.0 and embedded USE flag set.
It was my impression that it is Amaroks fault that Gentoo does not support
embedded dbs with mysql-5.1 which you clarified it is not. I searched the Gentoo bugtracker with no solution. That's a bit nasty, because the only reason I've installed mysql is amarok :(
What really irritates me, is what Stecchino writes in his last post. I surely *never ever* change the path to my music, as this is asking for trouble. I have really no idea why amarok sometimes cannot read its own playlists, while eg. clementine can... If there's anything I could do to bugtrack this, let me know.

EDIT: changed the title of the OT to something more constructive ;)
User avatar
Stecchino
KDE Developer
Posts
88
Karma
0
Martux wrote:What really irritates me, is what Stecchino writes in his last post. I surely *never ever* change the path to my music, as this is asking for trouble. I have really no idea why amarok sometimes cannot read its own playlists, while eg. clementine can... If there's anything I could do to bugtrack this, let me know.


I'll investigate this for you, in my mind it's does point to a bug in the saved playlist loading, though it probably is only this bad in this very specific situation.

Please open a bug report for this describing very short how you ended up with empty playlists. I'll reply there is more details are needed.
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
Yes, I'll do, thanks.
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
jefferai
Moderator
Posts
52
Karma
0
Hi Martux,

Martux wrote:Hi!
Thank you all for these very insightful help.
Right now I have amarok working fully again, the only way it seems to be supported on gentoo: with mysql-5.0 and embedded USE flag set.
It was my impression that it is Amaroks fault that Gentoo does not support
embedded dbs with mysql-5.1 which you clarified it is not. I searched the Gentoo bugtracker with no solution. That's a bit nasty, because the only reason I've installed mysql is amarok :(


Try looking at Gentoo bugs 306315, 306377, and 306155.

Martux wrote:What really irritates me, is what Stecchino writes in his last post. I surely *never ever* change the path to my music, as this is asking for trouble. I have really no idea why amarok sometimes cannot read its own playlists, while eg. clementine can... If there's anything I could do to bugtrack this, let me know.


As I explained in my earlier post, I think this is a corner case that wasn't foreseen and thus not properly tested (as corner cases are wont to do). Thanks for opening the bug report.

Martux wrote:EDIT: changed the title of the OT to something more constructive ;)


:-)

By the way, watch my blog at http://jefferai.org if you like...I'll post there with news about FMPS as it comes, and there are a few other things that are likely to pop up soon that I think you will be interested in. Can't say what it is yet but just check back now and then :-)
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
Hi jefferai!
Yes, I found the gentoo bugs. Unfortunately no one seems to be willing to add a patch for those willing to install. As I learned, other distros seem to work fine with embedded mysql-5.1. That's just something I will have to live with...
In the process of finding out what is going on, I tried 5.0 and 5.1, embedded and external db, and I think it is safe to say that the issue discussed in this thread has got nothing to do with mysql.
Right now I am sticky with 5.0 and don't have to mess with mysql manually.
With my playlist problem... that was a hard birth :)
That happened so often to me, that I thought it was supposed to work like that, just to make me angry :) Well... I really hope the devs can track this bug down, will be interesting what the cause is.
In my impression this forum has changed very much to a place where you actually get helped in a very nice manner. Thanks for that, I will be around.
Have a nice and not so hot day,
M.
jefferai
Moderator
Posts
52
Karma
0
Martux wrote:Hi jefferai!
Yes, I found the gentoo bugs. Unfortunately no one seems to be willing to add a patch for those willing to install. As I learned, other distros seem to work fine with embedded mysql-5.1. That's just something I will have to live with...


Well, what other distros have done is not to try to patch MySQL to provide a shared library, but instead they provide two versions of the embedded library, so Amarok on those distros has a dependency on the "second version". (This ends up causing its own problems too.)

Martux wrote:Well... I really hope the devs can track this bug down, will be interesting what the cause is.
In my impression this forum has changed very much to a place where you actually get helped in a very nice manner. Thanks for that, I will be around.
Have a nice and not so hot day,
M.


Awesome -- glad you're happier. I don't really hang around on the forums unless I'm pointed to a specific problem, so I can't comment on your experiences in the past, but I have definitely seen cases in the past on the KDE forums where people get upset at comments that are made by random other users and not actually by developers.

Just remember that forums are an easy and quick way for anyone to sound off -- whether or not they're affiliated with a project :-)
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
Yeah well, forums... I usually only hang around the gentoo forum, there are lots of technical knowledgable people.

With the databases, that is really the most annoying thing with amarok2, it only supports mysql. I know there are technical reasons for that, but mysql is a big blob of software... Personally I had to disable some kind of logging in mysql.conf, that's really nothing I should be doing as a user (but that's of course a gerntoo issue). Is sqlite really so slow? I mean sometimes speed is not everything.

The whole kde3-to4 thing was extremely unlucky imho, with all the distros switched way to early. Personally, I am with kde4 since 4.2 or something, about 2 years after 4.0 came out... Let's hope the community will learn from this ;)

So, what can I say? Is there anything I could do to help out here?
jefferai
Moderator
Posts
52
Karma
0
Hi Martux,

Martux wrote:Yeah well, forums... I usually only hang around the gentoo forum, there are lots of technical knowledgable people.


The Gentoo forums *tend* to be an amazing paragon of forums compared to most. :-)

Martux wrote:With the databases, that is really the most annoying thing with amarok2, it only supports mysql. I know there are technical reasons for that, but mysql is a big blob of software... Personally I had to disable some kind of logging in mysql.conf, that's really nothing I should be doing as a user (but that's of course a gerntoo issue). Is sqlite really so slow? I mean sometimes speed is not everything.


Yes. It really is that slow. In the early days of Amarok 2 we did some testing comparing the backends and found that for larger collections it could be many, many times slower.

We're not the ony ones with that problem -- Quassl supports both sqlite and postgres backends but the sqlite one is so slow that you can end up timing out trying to connect to the core while it tries to fetch data.

Sqlite is great for what it is, but high performance it's not.

Now, that said...

I do have a dream of switching to QtSql or some other such abstraction, like Quassel. Currently there is a problem in that it doesn't support embedded MySQL -- which is pretty much a necessity. I've been working on a patch to add embedded MySQL support to QtSql but there are no guarantees of it getting in, and the earliest possible time it could get in would be Qt 4.8.

This is also useful because on mobile platforms sqlite is pretty ubiquitous but getting libmysqld on there might be very difficult.

So -- at some point the other backends may return. But, only if we can do it properly. Most of us have relatively little DB experience (we get people all the time that complain that we don't have an optimized table structure, queries, or what not -- but of course when we ask if they would help us improve them, we never hear from them again). That's one of the main reasons we went with mysql -- although it certainly has its problems, it had both an embedded and server version, it's quite fast (at least given our apparent limited ability to do things properly), and we don't have to worry about things working on one DB and not the other because of errors on our part.

If we went to a multi-db system we'd have to have one of the longer developers committed to maintaining it and have some way to make it easier than hacking lots of query swapping in and out into the code.

Again, if this is something you or another are interested in working on, I'm more than happy to provide guidance and coaching. Otherwise it's an item on my radar, but there are more important things that need to get looked at first.

Martux wrote:So, what can I say? Is there anything I could do to help out here?


If you mean "join the project and help out" then of course :-)

If you mean your specific issue, then the right place to follow up, I imagine, is the bug report. Stecchino is the right person to follow up with you.
User avatar
Martux
Registered Member
Posts
156
Karma
0
OS
jefferai wrote:The Gentoo forums *tend* to be an amazing paragon of forums compared to most. :-)

Yai, better not waste your time with otw ;)

For the "helping out" part, I am just an "enthusiastic user" with no programming skills :( If I still can be of any help to your project, I would be proud to.
As for the bug reports, I will try that earlier next time before ranting, promised.
I get the impression that you guys spend a lot of heart blood into all of this, developing, endless discussions with users... Respect for that!
It is incredible what kde4 became, along with amarok as one of its "core components" (imho).
cu, Marcus


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], lockheed