Bug 219902 - amarok uses musicbrainz ids but cannot handle them in playlist
Summary: amarok uses musicbrainz ids but cannot handle them in playlist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Unspecified
: NOR normal (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 220965 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-24 01:04 UTC by Clara Gnos
Modified: 2010-01-02 16:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Dummy file with musicbrainz metadata (5.29 KB, audio/x-vorbis+ogg)
2009-12-24 10:44 UTC, Clara Gnos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Clara Gnos 2009-12-24 01:04:38 UTC
Version:           2.2.1-2 (using KDE 4.3.4)
Installed from:    Debian testing/unstable Packages

Downstream bug http://bugs.debian.org/556414

Noticed a weird behavior with amarok 2.2 or 2.1 (not sure here). When I tried to create a new dynamic playlist only songs from Nine Inch Nails - The Slip where added. When I closed the app and restarted it then only songs from this album were shown again in the playlist - all other entries were "lost".

To debug it a little bit further I just added following code:

    while( giveup-- && !track ) {
	int trand = KRandom::random() % subset.size();
	debug() << "random output " << trand << " " << subset[ trand ];
        track = trackForUid( subset[ trand ] );
    }

instead of

    while( giveup-- && !track )
        track = trackForUid( subset[ KRandom::random() % subset.size() ] );


in Dynamic::BiasSolver::getRandomTrack


The output just looked weird to me, but here are something which is
interesting:

amarok:     [BiasSolver] [ERROR!] track is 0 in BiasSolver::getRandomTrack()
amarok:     [BiasSolver] random output  2523   "
                                                z>�ԱA[�lIo�-l"
amarok:     [BiasSolver] random output  1839   "
��FN��/۔\���"                                   ^�
amarok:     [BiasSolver] random output  534   "
                                               Z��p�L֎�taځ"
amarok:     [BiasSolver] random output  2949   "
                                                �YupEn�ge�єx+"
amarok:     [BiasSolver] random output  187   "
                                               A���{�L���h�I��"
amarok:     [BiasSolver] random output  293   "
                                               �^޽
                                                  �K��x}�s�G�"
amarok:     [BiasSolver] random output  2819   "
                                                b\ܪY�@k�
                                                        AN�6"
amarok:     [BiasSolver] random output  3755   "
                                                �w��E4�3��/x�Y"
amarok:     [BiasSolver] random output  247   "
                                               �K��*I��<V��"g"
amarok:     [BiasSolver] random output  4488   "
                                                �˱evC�zb�� ޘ"
amarok:     [BiasSolver] random output  730   "

                                               F6�2Lݢ�H䣆�"
amarok:     [BiasSolver] random output  4461   "
                                                �N�C�N���!�;��"
amarok:     [BiasSolver] random output  1428   "
                                                �fsR_O�I���ߝ"
amarok:     [BiasSolver] random output  597   "
                                               $ Ն�J_�<�▒��y""
amarok:     [BiasSolver] random output  461   "
                                               t���dO"�h5u���"
amarok:     [BiasSolver] random output  1073   "
                                                ���AhE��iފ�p}�"
amarok:     [BiasSolver] random output  4555   "|����ж�|ɻLM"
amarok:     [BiasSolver] track selected: "Head Down" "Nine Inch Nails"
amarok:     [BiasSolver] random output  1375   "
                                                ���sMG)��^)s��"


You maybe noticed that all failed uids have a \n at the beginning and the
only one which didn't fail (did many tests and all looked like that) hadn't
\n at the beginning. Here another output which didn't fail:

amarok:     [BiasSolver] random output  4558   "��_��2=▒ù�O����"
amarok:     [BiasSolver] track selected: "The Four of Us are Dying" "Nine Inch Nails"
amarok:     [BiasSolver] random output  1628   "
                                                ��|��OD���Z�}E"
amarok:     [BiasSolver] random output  658   "
                                               ��s�FK�����
                                                          �"
This is maybe the reason why trackForUid fails but I am not sure.


Changed the lines again to

    while( giveup-- && !track ) {
	int trand = KRandom::random() % subset.size();
	debug() << "random output " << trand << " "  << (s_universeCollection->uidUrlProtocol() + "://" + QString(subset[ trand 
].toHex()));
        track = trackForUid( subset[ trand ] );
    }


Output looks now like

amarok:     [BiasSolver] random output  296    "amarok-sqltrackuid://0b3cee0759471344bfa30b1a3cede70522"
amarok:     [BiasSolver] random output  4041   "amarok-sqltrackuid://0b4b9709be0618474b8012cbba3824a44a"
amarok:     [BiasSolver] random output  2472   "amarok-sqltrackuid://0bcf5dc40c18854866a17f37d7ddd79913"
amarok:     [BiasSolver] random output  559    "amarok-sqltrackuid://0b9148f2b003f54e2eba8e762f8a028c86"
amarok:     [BiasSolver] random output  4556   "amarok-sqltrackuid://1e049c64a6a4df82d41bf9a5ee0fd37c"
amarok:     [BiasSolver] track selected: "Lights in the Sky" "Nine Inch Nails"
amarok:     [BiasSolver] random output  1708   "amarok-sqltrackuid://0b437435ec85b2403daaf12d9ff619c010"
amarok:     [BiasSolver] random output  2953   "amarok-sqltrackuid://0baf7aedbb280340d4939cbadd59ee4ab3"

It can easily be seen that uids which doesn't match are exact one byte longer
(0x0b at the beginning). 

So next step was to find what that means. Just did a small search in my db
and found something:

mysql> select uniqueid from urls where uniqueid like "%4b9709be%";
amarok-sqltrackuid://MB_4b9709be-0618-474b-8012-cbba3824a44a

mysql> select uniqueid from urls where uniqueid like "%1e049c6%";
amarok-sqltrackuid://1e049c64a6a4df82d41bf9a5ee0fd37c


So I would definitely say that it cannot handle musicbrainz ids. This causes
the dynamic playlists to only add files where musicbrainz ids are missing. An
extra problem caused by that is that all entries including a musicbrainz id in
my current playlist will be forgotten when I stop amarok and restart it.

As nine inch nails are currently the only songs without musicbrainz id it
makes amarok the current worst player to use for me.



Here the output of vorbiscomment for amarok-sqltrackuid://MB_4b9709be-0618-474b-8012-cbba3824a44a

MUSICBRAINZ_ALBUMARTIST=Therion
MUSICBRAINZ_ALBUMARTISTSORTNAME=Therion
MUSICBRAINZ_ALBUMSTATUS=official
MUSICBRAINZ_ALBUMTYPE=album
MUSICBRAINZ_NONALBUM=0
MUSICBRAINZ_SORTNAME=Therion
MUSICBRAINZ_VARIOUSARTISTS=0
REPLAYGAIN_ALBUM_GAIN=-8.31 dB
REPLAYGAIN_ALBUM_PEAK=1.12695789
REPLAYGAIN_TRACK_GAIN=-8.24 dB
REPLAYGAIN_TRACK_PEAK=1.11570489
TRANSCODED=mp3;192
genre=Death Metal
genre=Metal
genre=Gothic Metal
genre=Progressive Metal
genre=Heavy Metal
genre=Symphonic Metal
producer=Therion
producer=Lars Nissen
format=CD
lyricist=Thomas Karlsson
releasecountry=DE
label=Nuclear Blast
totaltracks=10
musicbrainz_albumartistid=c6b0db5a-d750-4ed8-9caa-ddcfb75dcb0a
date=2004-05-24
musicip_puid=ebfe5f9d-a469-dd01-2245-3cf52c9d70f9
asin=B0003HHOW2
albumartistsort=Therion
conductor=Mario Klemens
conductor=Mario Klemens
conductor=Adam Klemens
script=Latn
title=Typhon
musicbrainz_albumid=2ee34d04-00bf-48c3-886a-6829aad095c9
releasestatus=official
albumartist=Therion
catalognumber=NB 1253-2
album=Lemuria
musicbrainz_artistid=c6b0db5a-d750-4ed8-9caa-ddcfb75dcb0a
releasetype=album
performer=Kavi Björkqvist (guest balalaika)
performer=Sven Lindblad (guest balalaika)
performer=Jens Nyborg (guest balalaika)
performer=City of Prague Philharmonic Orchestra (orchestra)
performer=Steen Rasmussen (guest hammond organ)
performer=Richard Evensand (guest drums)
performer=Petra Čermáková (guest horn)
performer=Johan Niemann (electric bass guitar)
performer=Kühn Mixed Choir (guest choir vocal)
performer=Kristian Niemann (electric guitar and acoustic guitar)
performer=Jitka Tomšíčková (guest oboe)
performer=Christofer Johnsson (electric guitar)
coverartmime=image/jpeg
language=eng
artist=Therion
musicbrainz_trackid=4b9709be-0618-474b-8012-cbba3824a44a
arranger=Christofer Johnsson
artistsort=Therion
tracknumber=1
tracktotal=10
Comment 1 Rick W. Chen 2009-12-24 01:23:33 UTC
Hi Robert, this issue is known and fixed in my local branch. It should be out
in the next release. In the meantime, it would be great if you or your Debian
pals can test these patches out. They are under branch "musicbrainz" at:

git://gitorious.org/~stuffcorpse/amarok/stuffcorpse-clone.git

Keep in mind you'll need to do a full rescan first. Let me know if you
experience any trouble. Thanks a lot!
Comment 2 Clara Gnos 2009-12-24 10:31:02 UTC
Fresh install (all amarok files removed for user/system) and then installed your version. It rescans everything, but the behavior is the same as before. The version string says 0.2.2-GIT. So I would say that it is correctly installed.

The database output really changed but none of the problems have been solved:

mysql> select uniqueid from urls where uniqueid like "%4b9709be%";
amarok-sqltrackuid://mb_4b9709be-0618-474b-8012-cbba3824a44a
Comment 3 Clara Gnos 2009-12-24 10:44:06 UTC
Created attachment 39303 [details]
Dummy file with musicbrainz metadata

Only use a single collection with exact that file included. Add it to the playlist and close amarok. When you open amarok again it will be missing again.

Enable dynamic playlist and try to repopulate it - the song don't appear.
Comment 4 Rick W. Chen 2009-12-24 11:20:12 UTC
That's very odd... but I tried and the dummy file works for me - both playlist reloading and dynamic mode. Which Qt version are you running?
Comment 5 Clara Gnos 2009-12-24 11:48:15 UTC
Tried it with 4.6.0 and now with 4.5.3. 4.6.0 didnt work, but 4.5.3 works
Comment 6 Rick W. Chen 2009-12-24 14:50:39 UTC
I just pushed a 4.6 fix to the above repo. Please test.
Comment 7 Clara Gnos 2009-12-24 15:14:54 UTC
Yes, works. Thanks and merry x-mas.
Comment 8 Rick W. Chen 2009-12-24 15:33:55 UTC
Merry xmas to you too!
Comment 9 Rick W. Chen 2010-01-02 16:45:16 UTC
*** Bug 220965 has been marked as a duplicate of this bug. ***