Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: dip on June 21, 2007, 03:27:36 AM

Title: New patch for support of WORK tag
Post by: dip on June 21, 2007, 03:27:36 AM
I am just preparing a new patch which will support an additional tag in the rockbox database for browsing and for the WPS. The tag is intended to be used for storing the "work" a track belongs to. This will be mainly used for classical music since the present ALBUM and TITLE tags are not sufficient to handle classical music. With the new tag it will for example be possible to save the album title of a CD comprising several symphonies to the ALBUM tag, the names of the symphonies to the new WORK tag and the titles of the movements of the symphonies to the TITLE tag. It will then be possible to create for example a browse structure like composer->work->artist->title in tagnavi.conf.

While for mp3 files the corresponding tags are defined as TIT1 (for id3v2.3 and 2.4) and TT1 (for id3v2.2) there seems to be no standard tag name for vorbis comments. I found several names (WORK, CONTENTGROUP, CONTENT GROUP, GROUPING) for mapping this id3 tag to vorbis comments but would appreciat if someone could point me to a reliable source indicating a name for the vorbis comment which is mostly used and can be considered to be a "standard" name.
Title: Re: New patch for support of WORK tag
Post by: fml2 on June 21, 2007, 03:57:20 AM
This is just my opinion but I'm not a developer so use with care :-) You can surely make a patch for this and put it to the tracker. But I'd say there's little to no chance that it will be committed because:

1. The tags are not standardized (as you say, and I agree), and I think the RB devs wouldn't want to stick to non standard tags

2. IIUC, every added tag significantly increases the bin size and used RAM size so only really needed tags are used

3. RB devs are not very fond of classical music, so they will probably be reluctant to addind something they don't need (there are also not many requests for this feature)

That said, I'd like to add that I would welcome such a feature since I have many classical pieces in my music collection (about 40%). But the problem is that the community (not only the RB one) has not agreed on the way to tag them. So the problem is not RB specific. See for example MediaMonkey forums on this topic.
Title: Re: New patch for support of WORK tag
Post by: dip on June 21, 2007, 04:36:42 AM
This is just my opinion but I'm not a developer so use with care :-) You can surely make a patch for this and put it to the tracker. But I'd say there's little to no chance that it will be committed because:
I previously put a patch to the tracker adding support for albumartist and comment tags which was committed almost immediately, so we will see.

Quote
1. The tags are not standardized (as you say, and I agree), and I think the RB devs wouldn't want to stick to non standard tags
For mp3 files TIT1 and TT1 are standard tags and for vorbis comments as far as I understand no tags are really standard since you can use what you want. And albumartist was also no standard tag but the patch was committed. ;)

Quote
2. IIUC, every added tag significantly increases the bin size and used RAM size so only really needed tags are used
Especially for classical music a WORK tag IS really needed to tag your music files in a way that they can be reasonably used.

Quote
3. RB devs are not very fond of classical music, so they will probably be reluctant to addind something they don't need (there are also not many requests for this feature)
Don't blame the devs, they get older too and they may listen more to classical music ;) (of course it's not only a question of age).

Quote
That said, I'd like to add that I would welcome such a feature since I have many classical pieces in my music collection (about 40%). But the problem is that the community (not only the RB one) has not agreed on the way to tag them. So the problem is not RB specific. See for example MediaMonkey forums on this topic.
I also use MediaMonkey (and Slimserver as well) and know about all these discussions about tagging of classical music. However, in my opinion all reasonable solutions require a further tag since with the ALBUM and TITLE tags there are only two tags available, bur for classical CDs comprising symphonies, sonatas or the like you NEED a third tag to map the relevant information.
Title: Re: New patch for support of WORK tag
Post by: Llorean on June 21, 2007, 04:48:49 AM
Just as a note, you don't NEED tags to listen to music at all, so please be careful about using absolutes. Many people get by with their music organized solely in the filetree just fine, even including classical music.
Title: Re: New patch for support of WORK tag
Post by: dip on June 21, 2007, 04:56:13 AM
Just as a note, you don't NEED tags to listen to music at all, so please be careful about using absolutes. Many people get by with their music organized solely in the filetree just fine, even including classical music.
Sorry for being too absolute. Of course the tags are only needed if you use the database (and this is of course only my subjective opinion) and they will not help you anything and are not necessary when using the filetree.
Title: Re: New patch for support of WORK tag
Post by: safetydan on June 21, 2007, 05:10:46 AM
Picard (the MusicBrainz tagger) suggets that GROUPING is the approriate Vorbis comment. See http://wiki.musicbrainz.org/PicardQt/TagMapping for details.
Title: Re: New patch for support of WORK tag
Post by: LinusN on June 21, 2007, 05:18:04 AM
If the WORK/GROUPING tags are commonly used, I don't see why Rockbox couldn't use them. I mean, it's a fairly small change, to make some users happy.
Title: Re: New patch for support of WORK tag
Post by: dip on June 21, 2007, 05:51:28 AM
Picard (the MusicBrainz tagger) suggets that GROUPING is the approriate Vorbis comment. See http://wiki.musicbrainz.org/PicardQt/TagMapping for details.
Mp3Tag suggests CONTENTGROUP (see http://help.mp3tag.de/main_tags.html) and foobar2000 CONTENT GROUP (see http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:ID3_Tag_Mapping).

In fact, although the TIT1 field is often referred to as work tag I did not find a source which states that the vorbis comment is named WORK. So maybe I will support to read the CONTENTGROUP, CONTENT GROUP and GROUPING tags from the files to obtain high compatibility with different programs (similar as the albumartist patch reads ALBUMARTIST, ALBUM ARTIST and ENSEMBLE from vorbis comments). Since the official description for TIT1 in the id3 standard is "content group description" I will probably use CONTENTGROUP as WPS-tag to be used in tagnavi.conf (CONTENT GROUP is not possible due to the space inbetween the two words).

Any comments to that?
Title: Re: New patch for support of WORK tag
Post by: safetydan on June 21, 2007, 06:32:42 AM
I'd say that the tag for tagnavi.conf purposes should be called 'grouping' as that's what it's doing. The word 'content' feels a bit redundant IMHO. But then again, I have no strong feelings either way since I wouldn't be using it.

As for what supporting multiple different tags, I don't see a problem with that. So long as it's a reasonable number of course. Don't forget to add the MP4 tags as well if you do a patch for this.
Title: Re: New patch for support of WORK tag
Post by: dip on June 21, 2007, 10:35:15 AM
I'd say that the tag for tagnavi.conf purposes should be called 'grouping' as that's what it's doing. The word 'content' feels a bit redundant IMHO. But then again, I have no strong feelings either way since I wouldn't be using it.
You definitly should! It's a great feature of Rockbox that you can browse for an album or a song even if you don't remember the name of the artist (which is not possible if you have an "artist/album/title" file structure. (Seems to be challenging to convince a developer to use the database  ;))

Quote
As for what supporting multiple different tags, I don't see a problem with that. So long as it's a reasonable number of course. Don't forget to add the MP4 tags as well if you do a patch for this.
If MP4 tags must be handled separately from MP3 tags and Vorbis comments I am quite sure that they were not considered when ALBUMARTIST and COMMENT tag supprt was added to Rockbox (at least I did not add them in my previous patch). So I will have a look for the MP4 tags also into the ALBUMARTIST and COMMENT tags. I hope I will find the relevant places in the code...

BTW, during preparation of the WORK (or GROUPING) patch I also included the feature that in the Rockbox database the GROUPING tag is set to the value of the TITLE tag of a track if the GROUPING tag is not set in the music file. Otherwise you would either have to tag ALL your files with a GROUPING tag (even single music pieces NOT comprising of several movements, like e.g. small piano works as Beethovens "Für Elise") or when browsing through a tagnavi structure like "composer->work->artist->title" only multi part works would be shown.

The same is true for ALBUMARTIST so I think I will also make a separate patch that in the Rockbox database the ALBUMARTIST tag is set to the value of the ARTIST tag of a track if the ALBUMARTIST tag is not set in the music file. With this amendement it is no longer necessary to tag ALL your files with an ALBUMARTIST tag in order to have a browse structure like "albumartist->album->title" for ALL your albums. You need then only to tag the tracks of various artists albums with ALBUMARTIST=various or of albums for which ALBUMARTIST differs from ARTIST for another reason (e.g. albums of a certain artist on which e.g. one song is a duet with another artist (all songs except the duet have ARTIST=artist1 and the duet has ARTIST=artist1 & artist2).

Does that sound reasonable or are there any concerns to this additional feature? Of course, the original tags of the music files are not changed with this solution since the tags are only set in the internal Rockbox database.
Title: Re: New patch for support of WORK tag
Post by: Rincewind on June 21, 2007, 11:14:21 AM
The same is true for ALBUMARTIST so I think I will also make a separate patch that in the Rockbox database the ALBUMARTIST tag is set to the value of the ARTIST tag of a track if the ALBUMARTIST tag is not set in the music file. With this amendement it is no longer necessary to tag ALL your files with an ALBUMARTIST tag in order to have a browse structure like "albumartist->album->title" for ALL your albums. You need then only to tag the tracks of various artists albums with ALBUMARTIST=various or of albums for which ALBUMARTIST differs from ARTIST for another reason (e.g. albums of a certain artist on which e.g. one song is a duet with another artist (all songs except the duet have ARTIST=artist1 and the duet has ARTIST=artist1 & artist2).

Does that sound reasonable or are there any concerns to this additional feature? Of course, the original tags of the music files are not changed with this solution since the tags are only set in the internal Rockbox database.

This is great!
I only have the album artist tag for files that really need them and my foobar2000 is configured exactly in the way you describe it here.
If this gets commited I can finally use the database in rockbox in (almost) the same way as I use foobar2000.
Title: Re: New patch for support of WORK tag
Post by: dip on June 22, 2007, 09:38:39 AM
I have added a patch for the above described improved ALBUMARTIST support at http://www.rockbox.org/tracker/task/7342

This patch now also supports ALBUMARTIST for MP4 and APE tags. Please try that since I do not have MP4 and files with APE tags so I couldn't test it.

I have also finished (but not yet put in the tracker) the second patch which adds support for a GROUPING tag as described. But I have the problem that both patches are changing lines at the same place in the original code so both patches apply when used only alone but as if you want to apply both patches one fails. How is this usually handled?
Title: Re: New patch for support of WORK tag
Post by: safetydan on June 25, 2007, 07:48:29 AM
I've committed code that does a similar thing to what was described in FS# 7342. That should make it easier for you to focus on your grouping patch.
Title: Re: New patch for support of WORK tag
Post by: dip on June 25, 2007, 12:07:32 PM
I've committed code that does a similar thing to what was described in FS# 7342. That should make it easier for you to focus on your grouping patch.
Thanks a lot for the fast acceptance. I will revise my grouping patch accordingly.

One question: With the new version, will the %iA WPS tag be empty or set for a music file which has no albumartist tag set? With my original version it was set since the metadata was copied (and thus albumartist was even shown in the id3 info page). But if it is not set one could use a conditional in the wps file to decide if albumartist should be displayed or not in the WPS (since this makes only sense if it is different from the artist tag, otherwise two identical lines would be displayed).
Title: Re: New patch for support of WORK tag
Post by: safetydan on June 25, 2007, 04:55:09 PM
The %iA tag will be empty if the track has no albumartist tag. Only the database is affected by the data copying.
Title: Re: New patch for support of WORK tag
Post by: Llorean on June 26, 2007, 12:59:26 AM
As it should be, I believe. The user should never be lied to as regard what tags are present on their file in the WPS, and it's only relevant in the Database to make searches work.
Title: Re: New patch for support of WORK tag
Post by: dip on June 26, 2007, 01:59:10 AM
As it should be, I believe. The user should never be lied to as regard what tags are present on their file in the WPS, and it's only relevant in the Database to make searches work.
I agree and I prefer that behavior over my first version since now one can nowconditionally display the albumartist it in the WPS. The same will be true for the new grouping tag.
Title: Re: New patch for support of WORK tag
Post by: dip on June 26, 2007, 07:15:56 PM
I just added the grouping patch to the tracker at http://www.rockbox.org/tracker/task/7362.

Please test it if everything is ok. For empty tags it uses the same code as the improved albumartist patch.
Title: Re: New patch for support of WORK tag
Post by: dip on July 06, 2007, 04:12:38 PM
I use this patch now for some time without problems (in fact it is developed very closely to the already commited album artist patch). Is there a chance that it will be committed soon?
Title: Re: New patch for support of WORK tag
Post by: danhibiki on July 07, 2007, 02:34:28 AM
If some developer is going to commit your patch, I hope that he take a look at the disc number patch (http://www.rockbox.org/tracker/task/4961) too (maybe telling if something is wrong with it), because IMHO it's a more important tag that should be supported by Rockbox.