PDA

View Full Version : Some thoughts on MusicBrainz integration



hakan
2005-08-27, 02:39
Hi everyone,


In my quest for the perfectly tagged music collection, I started adding
MusicBrainz tags to my files. I'd like to import that data to the
SlimServer database so that plugins like SlimScrobbler could use it.

I'll start by extending the tables tracks, contributors and albums with
a text column for the mb tag and work my way from the fileformat parser
modules up to the DBI modules to store that information into the database.

One of the last steps for the time being would be to verify that the
SlimScrobbler can submit that information to last.fm

Would such a contribution (if it doesn't break too much ;-) ) be
accepted to the server or are there already other plans for MB
integration? I couldn't find any plans in the forums or the bug database.


Regards,
Hakan


--
The Key To Immortality Is First Living A Life Worth Remembering.

hakan
2005-08-29, 15:04
Hakan Tandogan wrote:
> Would such a contribution (if it doesn't break too much ;-) ) be
> accepted to the server or are there already other plans for MB
> integration? I couldn't find any plans in the forums or the bug database.
>

I created an enchantment request in bugzilla and attached my current
patch on it.

The patch reads musicbrainz information from FLAC, Ogg and MP3 files and
stores them in the tables tracks, albums and contributors.


Regards,
Hakan


--
The Key To Immortality Is First Living A Life Worth Remembering.

Dan Sully
2005-08-29, 15:06
* Hakan Tandogan shaped the electrons to say...

>I created an enchantment request in bugzilla and attached my current
>patch on it.
>
>The patch reads musicbrainz information from FLAC, Ogg and MP3 files and
>stores them in the tables tracks, albums and contributors.

Is there any way to do this using MP3::Info?

Re-reading every MP3 using MP3::Tag just isn't an option. We already have a
bottle neck with our MP3 tag/info reading as is.

Thanks.

-D
--
<dr.pox> NO, NETBSD IS NOT REALLY BUILT WITH ELITE FORTRAN77!!@$#$

dean
2005-08-29, 15:14
I'm a big fan of MusicBrainz, but I haven't found a compelling use
for it wrt slimserver...

Couple of thoughts...

1. I'm not sure we're ready to accept a patch for adding stuff to the
database without actually reading it anywhere. :) But I get the idea.

2. We're already reading in all the tags, so when your patch does this:

+ my $mp3 = MP3::Tag->new($file);
+ $mp3->get_tags();

Again seems like a real performance issue. Could you use the
existing tags already returned by:

my $tags = MP3::Info::get_mp3tag($fh);

To extract the tags you are looking for?



On Aug 29, 2005, at 3:04 PM, Hakan Tandogan wrote:

> Hakan Tandogan wrote:
>
>> Would such a contribution (if it doesn't break too much ;-) ) be
>> accepted to the server or are there already other plans for MB
>> integration? I couldn't find any plans in the forums or the bug
>> database.
>>
>
> I created an enchantment request in bugzilla and attached my
> current patch on it.
>
> The patch reads musicbrainz information from FLAC, Ogg and MP3
> files and stores them in the tables tracks, albums and contributors.
>
>
> Regards,
> Hakan
>
>
> --
> The Key To Immortality Is First Living A Life Worth Remembering.
>

hakan
2005-08-30, 02:39
> I'm a big fan of MusicBrainz, but I haven't found a compelling use
> for it wrt slimserver...
>
> Couple of thoughts...
>
> 1. I'm not sure we're ready to accept a patch for adding stuff to the
> database without actually reading it anywhere. :) But I get the idea.

Hey, how about moodlogic and musicmagic ;-)

Actually, I use the data in the SlimScrobbler plugin. I'm about to send a
patch to Stewart so the plugin can submit the track MBID.

The V2 protocol for AudioScrobbler needs / supports Artist MBIDs as well.

Besides, I'd like to base my playlists / "listened n times" statistics on
the MBID (if available, of course).

Like everyone else in my vicinity, I'm constantly retagging and
rearranging my collection. If I move a track to a new directory, it looks
like a wholly new object to the SlimServer, even if it is a track I
already listened to hundreds of times. That would break "automatic
playlists" (enchantment request #380) if and when we get around to
implement them.

> 2. We're already reading in all the tags, so when your patch does this:
>
> + my $mp3 = MP3::Tag->new($file);
> + $mp3->get_tags();
>
> Again seems like a real performance issue. Could you use the
> existing tags already returned by:

Yes, I know, *that* piece of code sucks ;-) I'm not really comfortable
with parsing each mp3 twice, but I wanted a proof-of-concept for this
weekend.

> my $tags = MP3::Info::get_mp3tag($fh);
>
> To extract the tags you are looking for?

I couldn't make MP3::Info give me the tags I was looking for, and google
wasn't any help, either. I'll experiment with MP3::Info a little bit more
this weekend, maybe I'm missing something really obvious.


Regards,
Hakan


--
The key to immortality is first living a life worth remembering...

kdf
2005-08-30, 09:05
On 30-Aug-05, at 2:39 AM, Hakan Tandogan wrote:

>
>> I'm a big fan of MusicBrainz, but I haven't found a compelling use
>> for it wrt slimserver...
>>
>> Couple of thoughts...
>>
>> 1. I'm not sure we're ready to accept a patch for adding stuff to the
>> database without actually reading it anywhere. :) But I get the
>> idea.
>
> Hey, how about moodlogic and musicmagic ;-)
well, I can see how those are different since those are reading local
libraries.

however, there is already musicbrainz stuff in Slim::Formats::FLAC. I
don't recall why or how, just noticed it was there.
-kdf

hakan
2005-09-01, 12:25
Dan Sully wrote:
> Re-reading every MP3 using MP3::Tag just isn't an option. We already have a
> bottle neck with our MP3 tag/info reading as is.

Hi,

I just modified my patch to use MP3::Info instead. It needs a little
modification to Info.pm (attached as well to the feature request), but
our local copy of Info.pm is already somewhat patched ;-)


Regards,
Hakan



--
The Key To Immortality Is First Living A Life Worth Remembering.

hakan
2005-09-14, 05:01
> I'm a big fan of MusicBrainz, but I haven't found a compelling use
> for it wrt slimserver...
>
> Couple of thoughts...
>
> 1. I'm not sure we're ready to accept a patch for adding stuff to the
> database without actually reading it anywhere. :) But I get the idea.

I updated the patch for SVN 4275. It would be really nice if it could be
incorporated in time for 6.2... Please? Pretty Please? ;-)

My local server runs with that patch for two weeks now; I saw no problems
that were based on the MBid patch...


Regards,
Hakan


--
The key to immortality is first living a life worth remembering...

Dan Sully
2005-09-14, 08:43
* Hakan Tandogan shaped the electrons to say...

>I updated the patch for SVN 4275. It would be really nice if it could be
>incorporated in time for 6.2... Please? Pretty Please? ;-)
>
>My local server runs with that patch for two weeks now; I saw no problems
>that were based on the MBid patch...

Hakan - what are you using the MB info for? It'd be really nice to be able to
justify the reading / storing of that data. Thanks.

-D
--
<weezyl> $6.66: The Value Meal of the Beast.

hakan
2005-09-14, 10:24
> * Hakan Tandogan shaped the electrons to say...
>
>>I updated the patch for SVN 4275. It would be really nice if it could be
>>incorporated in time for 6.2... Please? Pretty Please? ;-)
>>
>>My local server runs with that patch for two weeks now; I saw no problems
>>that were based on the MBid patch...
>
> Hakan - what are you using the MB info for? It'd be really nice to be able
> to justify the reading / storing of that data. Thanks.

Basically, to have an identifier for data that can't be put in the music
tracks themselves (like playCount, lastPlayed, "mood") but need to "follow
the tracks". Based on that information, I'm (slowly, but getting there)
building a Plugin for smart playlists.

Every now and then, the database is rebuilt. Sometimes, a change in the
SQL schema is the cause, sometimes it is because I do another round of
cleaning my various tags, rename tracks (based on the just modified tags),
etc. Nevertheless, I want to keep my playCounts which I would lose in a
full rescan.

My first Plugin copies the playCount information, keyed on the MBid (if
MBid is not available, then on the url as a fallback), periodically into a
backup table and restores that data after a clean rescan. Obviously, I
can't use the "id" attribute from the tracks table.

My second Plugin uses that information and constructs playlists based on
rules like ("20 random tracks from years (80 ... 89) which I have listened
least frequently to"). This Plugin would we one solution to the
enchancement request #380 (Automatic playlists).

Other information that would be keyed off the MBid would be multi-valued
genre information (see the discussions "Enhanced meta tags for the
multi-valued genre derivitives." and "Official source of genres?" in the
ripping forum).

Another Plugin that uses / could use the MBid information is the
SlimScrobbler; the protocol requires that MBids are submitted to the
AudioScrobbler but the Plugin just sends an empty string

I would use moodlogic for automatic playlists if it would be possible to
run moodlogic on a linux server. I'm not quite ready to give up and run
that beast inside a VMware on my linux server because I'd really like to
have a "integrated solution" to the problem of automatic playlists.


Regards,
Hakan


--
The key to immortality is first living a life worth remembering...