Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: dip on February 09, 2007, 03:36:28 AM

Title: New album artist and comment patch for WPS and tagcache
Post by: dip on February 09, 2007, 03:36:28 AM
Based on the comment patch from Robert Kukla (roolku) (see http://www.rockbox.org/tracker/task/6301) I created a patch to enable usage of the albumartist tag and the comment tag for both displaying in the WPS as well as using as filter and conditional in tagnavi.config.

If you set the albumartist tag e.g. to Various for all tracks of compilations and to the track artist for all tracks of non compilation albums you can easily create a "browse by albumartist" menu item in tagnavi.conf which shows only artists who have their own album (which usually reduces the length of the artist list a lot).

Example: "Album artist" -> albumartist ? albumartist != "Various" -> album -> title

You can also create a Compilation menu item with: "Compilations" -> album ? albumartist == "Various" -> title

For mp3 files you have to set the BAND tag (TP2/TPE2) which is commonly used for album artist.

Since for ogg vorbis and flac files no single standard tag exist, the patch reads the tags ALBUMARTIST, ALBUM ARTIST (with one space inbetween) and ENSEMBLE which are the most commonly used tags for album artist. Each of these tags will be recognized by the patch.

In tagnavi.config you have to use albumartist or ensemble as filter or in conditionals. album artist (with space) is not possible since spaces are used as delimiter between tags. Both of albumartist and ensemble will work in tagnavi.config, it doesn't matter whether you tag your ogg/flac files with an ALBUMARTIST, ALBUM ARTIST or ENSEMBLE tag.

In WPS the album artist can be displayed with %iA

The comment tag can e.g. be used for titles of classical pieces (like "Symphony Nr. 9") if more than one piece are on an album. In tagnavi.config simply use comment as filter or in a conditional. In WPS use %iC to display the comment. Of course you can use the comment tag to store whatever you want.

The patch can be downloaded from flyspray (http://www.rockbox.org/tracker/task/6638). I hope you will enjoy the patch :-)

Dieter
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: bascule on February 09, 2007, 05:08:35 AM
This will please a lot of people :)

Did you also code WPS tags for next ALBUMARTIST and COMMENT (%IA and %IC respectively)?
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: dip on February 09, 2007, 06:37:11 AM
Did you also code WPS tags for next ALBUMARTIST and COMMENT (%IA and %IC respectively)?
I think this should work automatically since I added only the characters A and C to the available tag list and it worked automatically with %iA and %iC. So %I should also work, but I will test it this evening.

I will also try to extend the patch that in the id3 info page the new tags are also shown. But I have to admit that I did not step really deep in the source code since I simply took the comment patch from Robert Kukla (roolku) and adapted the code for albumartist. Without his patch I wouldn't have found all places in the code which have to be amended.

For the sake of completeness I will also extend the patch that the comment tag will work with mp3 files using only id3v2.2 tags instead of id3v2.3 tags. As far as I understand, at the moment only the v2.3 COMM tag is read but not the v2.2 COM tag.
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: senab on February 09, 2007, 06:50:23 AM
Very good work, i'm going to add this to my build  :D
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: dip on February 09, 2007, 07:06:49 AM
Very good work, i'm going to add this to my build  :D
Great to hear, since I would like to use your build, as it does exactly include the patches I want to use.

Unfortunately, I have only an iPod 80GB 5.5g so I am waiting for a first running version of Rockbox at the moment. Meanwhile I am playing around with the simulator and try to optimize my configuration for the REAL usage... (sigh)
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: roolku on February 09, 2007, 09:44:10 AM
Based on the comment patch from Nicolas Pennequin (see http://www.rockbox.org/tracker/task/2974) I created a patch to enable usage of the albumartist tag and the comment tag for both displaying in the WPS as well as using as filter and conditional in tagnavi.config.

It would have been nice if you had credited http://www.rockbox.org/tracker/task/6301 as well, as this is where the Comment tag code for WPS and tagcache comes from.

Roolku
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: dip on February 09, 2007, 09:54:24 AM
Based on the comment patch from Nicolas Pennequin (see http://www.rockbox.org/tracker/task/2974) I created a patch to enable usage of the albumartist tag and the comment tag for both displaying in the WPS as well as using as filter and conditional in tagnavi.config.

It would have been nice if you had credited http://www.rockbox.org/tracker/task/6301 as well, as this is where the Comment tag code for WPS and tagcache comes from.

Roolku
Sorry for that!!   :-[

I mixed up the two patches and cited the wrong one. Of course I amended the comment patch from you and not from Nicolas. I corrected my previous post accordingly.

Thanks for the great patch. As previously mentioned, I only duplicated your comment code and replaced some text.
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: roolku on February 09, 2007, 10:03:19 AM
Based on the comment patch from Nicolas Pennequin (see http://www.rockbox.org/tracker/task/2974) I created a patch to enable usage of the albumartist tag and the comment tag for both displaying in the WPS as well as using as filter and conditional in tagnavi.config.

It would have been nice if you had credited http://www.rockbox.org/tracker/task/6301 as well, as this is where the Comment tag code for WPS and tagcache comes from.

Roolku
Sorry for that!!   :-[

I mixed up the two patches and cited the wrong one. Of course I amended the comment patch from you and not from Nicolas. I corrected my previous post accordingly.

Thanks for the great patch. As previously mentioned, I only duplicated your comment code and replaced some text.

No worries - I didn't mean to sound so harsh. I was just curious how you had done the comment tag extraction from the id3 tag and noticed the exact same ugly hack that I used. :)

Well at least it reminded me to have another look at it, as I have had 2 bad comment tags that crashed the player in browse-by-comment. Re-saving the comment in winamp fixed it, but it would be nice if it didn't crash in the first place.
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: dip on February 09, 2007, 06:40:00 PM
I made a new version of the patch. It shows now album artist and comment also on the id3 info page (including English and German labels).

I also added support for the mp3 COM tag (id3v2.2) in addition to the mp3 COMM tag (id3v2.3) but I cannot test it since I have not tagging program which writes v2.2.

The new version can be found on flyspray (http://www.rockbox.org/tracker/task/6638).

I also confirm that %IA and %IC (next album artist and next comment) do work in WPS.

Dieter
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: Rincewind on February 10, 2007, 07:57:21 AM
Just a quick question:
Is it possible now to create an entry which shows Album Artist if that tag is present and shows Artist if it isn't?

I have tagged my mp3s in a way that normal albums don't have the Album Artist set and only on compilations I have set the Album Artist to "Various" or on some classical pieces to the performer.

And another thing: you wrote something about BAND for mp3s. Does that mean that ALBUM ARTIST isn't supported for mp3s? I don't know from where you get that BAND is more commonly used than ALBUM ARTIST. I think that foobar2000 users use ALBUM ARTIST more often (that's the standard tag they describe in their wiki).

Since the code for ALBUM ARTIST and ALBUMARTIST is already there for oggs I would suggest that you extend this to mp3s, too. That would save me a lot of retagging and reprogramming foobar2000.
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: senab on February 10, 2007, 04:02:46 PM
I'm currently altering the patch to make use of foobar's album artist tag aswell :)
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: dip on February 11, 2007, 02:26:30 PM
@Rincewind
Unfortunately the patch only adds the possibility to use the album art tag  but no additional logic to use it only if it is set and the artist tag if it isn't. This would be much more complicated. So in order to create a browse album artist entry you must set album artist for all of your tracks.

Applications like Winamp and MediaMonkey (and others) use the BAND tag for mp3 files as album artist tag. These applications have predefined input fields for inputting the tags, and one of the fields is labeled Album Artist. Depending on the audio format (mp3, ogg, flac...) the tags are written into a specific tag. For mp3 files the BAND tag is used and for ogg files MediaMonkey writes the ALBUM ARTIST as well as the ENSEMBLE tag. I assume that for mp3 files the BAND tag is used for Album Artist since this is one of the standard tags predefined in the id3 definition and which should be therefore supported by all applications. ALBUM ARTIST is, however, not predefined in the id3 standard, neither is ALBUMARTIST.

For ogg files this is different since for these no predefined tag names exist. So you can choose any tag name you want (which may of course lead to incompatibilities with other applications).

It should be possible to amend the patch that it reads in addition to the standard BAND tag also an existing non standard ALBUM ARTIST tag from mp3 files. But I do not know how to do that, so if Senab does it that would be great.

@senab
The patch has already be committed to the svn (I don't know if you have seen that, if yes forget my note). It has been slightly amended so you should make your improvements based on the commited code. I have also seen that at the end of id3.c in function main there is a printf command for all id3 tags. I have no idea what this printf is for, but shouldn't the new tags albumartist and comment also be included there?
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: Rincewind on February 11, 2007, 02:58:10 PM
dip, thank you for the explanation.
If there is a way in TagNavi syntax to check in a conditional wheater a Tag exists then It should be possible to create an entry that does what I want.

This is where I have my information about ALBUM ARTIST from (and I followed this for my collection)
http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Encouraged_Tag_Standards

I just read in the id3v2 standard from id3.org and it seems to me that the BAND tag is not really supposed to be album artist, it was just chosen by some popular players for this purpose. But there is no point discussing this here, I just wanted to make my point clear, that I think that ALBUM ARTIST is a valid tag for album artist even in the mp3 format.

If the addition of ALBUM ARTIST for mp3s isn't much overhead for the DB (with that I mean: doesn't take space/computing time if it isn't used) then I would love to have it in Rockbox.
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: alsaf on February 12, 2007, 01:37:51 AM
I use Easytag which does not have the facility to edit ALBUMARTIST field.

I have amended the tagnavi.config file as follows:

For the music file tags I have did the following:

In all wps files replace %ia with %ic

This displays multi disc compilations as follows:

   Various-> album name -> 1
   Various-> album name -> 2
   Various-> album name -> 3
   ....

I am looking for something better like for instance:

   Various-> album name ->album name (CD 1)
   Various-> album name -> album name (CD 2)
   Various-> album name -> album name (CD 3)

I've tried adding a format field to tagnavi.config as follows:

      %format "fmt_disc"        "%s - (CD %s)" album comment

When I navigated through compilation part and I get to disc number section (comment) the screen is blank and I can get no further. It looks like my format field for comment does not work. Can anybody please help.

Title: Re: New album artist and comment patch for WPS and tagcache
Post by: roolku on February 12, 2007, 03:11:21 PM
I've tried adding a format field to tagnavi.config as follows:

      %format "fmt_disc"        "%s - (CD %s)" album comment

When I navigated through compilation part and I get to disc number section (comment) the screen is blank and I can get no further. It looks like my format field for comment does not work. Can anybody please help.

The format string works for me. I suspect you have assigned to a filter rather than the title tag?
Title: Re: New album artist and comment patch for WPS and tagcache
Post by: roolku on February 12, 2007, 03:14:40 PM
I was just curious how you had done the comment tag extraction from the id3 tag and noticed the exact same ugly hack that I used. :)

In light of the recent commit and because 3 tracks with invalid language strings had crept into my collection I re-visited the comment field extraction from id3. The patch here fixes all the issues and also adds support for the comment field in id3v1:

http://www.rockbox.org/tracker/task/6651

Title: Re: New album artist and comment patch for WPS and tagcache
Post by: alsaf on February 12, 2007, 05:31:18 PM
I had added it to filter than title tag. By your reply, I assume this can't be done to filters. I can amend the comment tag to appropriate value.