Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category ID3 / meta data
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by lowlight - 2005-08-05
Last edited by fg - 2011-06-04

FS#2616 - Arbitrary vorbis comments and ID3v2 TXXX/COMM text in wps

This patch allows for the display of arbitrary vorbis
comments (besides the supported artist, album, year,
etc) in the wps. Vorbis comments take the form
TAGNAME=VALUE, so a new wps variable is used:
%ix”TAGNAME” quotes included. TAGNAME should match exactly.

For example, I sometimes use a PERFORMER tag if
there are guest artists on a particular track by an artist.
This wps line will display the PERFORMER tag,
otherwise defaults to the artist.
?%ix”PERFORMER”<%ix”PERFORMER”|%ia>

This only works for non-supported tags…%ix”ARTIST”
will not display anything.

The following files were changed:
apps/metadata.c
apps/wps-display.c
firmware/replaygain.c
firmware/exports/id3.h

Currently, only 8 arbitrary vorbis comments are stored
(beyond the supported ones) if they all fit in the buffer.
Since I store the vorbis comments in the
mp3entry.id3v2buf[], I increased its size from 300 to 500
(for iriver), this may be overkill, and can be reduced.

This patch works for both OGG and FLAC files with
vorbis comments. I’m sure somebody could modify the
apetag metadata handling to do something similar.

Closed by  fg
2011-06-04 21:05
Reason for closing:  Out of Date
Additional comments about closing:  

Since the WPS code was also totally redone since this patch, there's probably nothing at all still useful in it

UPDATE 8/8:
Patched screens.c to display extra vorbis comments
in “Show ID3 Info” menu.

UPDATE 8/11:
A fix and changed the id3v2buf size to 400.

UPDATE 8/12:
Update for the recent changes in “ID3 Info” display. I added a
space between ID3 entries on the display for readability.

UPDATE 8/15:
Separated the screens.c patch since there are cosmetic
changes that not everyone may want.

UPDATE 9/2:
Synced to current cvs.

UPDATE 10/5:
Synced to current cvs.
Split out the patch for screens.c. Apply this to display the
tags in “Show ID3 Info” (also adds a space between id3
items for readability).

UPDATE 10/31:
1. Synced to current cvs.

2. Parses ID3v2 TXXX fields. Like vorbis comments, these are
name/value pairs and are displayed in wps with %ix”NAME”.

3. Parses ID3v2 COMM field (comment). Use wps code %
ix”COMMENT” to display this value. Does not work with
ID3v1 comments. This should probably be a hard coded tag
like artist, album, etc.

4. Parses ID3v2 TDAT field (date). This is a 4-digit date of the
form DDMM. This field combines with TYER (year) to make a
year string of the form YYYY-MM-DD.

Switched from using two arrays (name & value) to a single
array. Doesn’t change the functionality of the patch.

There was a problem with the screens patch showing half a
line for some fonts. I’ve removed that patch until I figure it out.
screens.c is still patched to dislay the user comments.

Fixed a mistake.

The comment field is now handled with the %im wps syntax
(too bad %ic is already used for composer). This includes
id3v1, id3v2, and vorbis comments (and maybe ape tags)
named “comment” (any case).

Other user defined comments are handled as before: %
ix”TAGNAME” (here case matters, although I could change
that).

All tags are displayed in the “Show ID3 Info” screen.

UPDATE 11/23:
Synced to current cvs. Also “fixes” the “Show ID3 Info”
screen.

WARNING…I may have been too hasty to update this…it’s
locking up my player. Wnfortunately, it will be next week
until I can look at it again.

UPDATE: 12/02
Synced to current cvs.
I tested it this time and it appears to function as it
should.

Anonymous Submitter commented on 2006-01-21 14:31

How does it handle multiple fields with same tagname? For
example, vorbiscomment allows “ARTIST=Megumi Hayashibara” and “ARTIST=Masami Okui” in the same file (for a song with
multiple singers).

UPDATE: 2006-02-08
Synced to current cvs.

In response to the previous question about multiple fields
with the same name…only the first one encountered will
be displayed. You could use ARTIST, ARTIST1, ARTIST2, etc
to differenciate.

UPDATE: 2006-02-09
Small bug fix.

UPDATED DESCRIPTION:
This patch adds support for user defined tags and allows
you to reference them in the WPS by the %ix”Name” syntax.
Vorbis Comments, APEv2 tags, and ID3v2 TXXX tags are
supported in this way.

Support has also been added for the “Comment” field in all
tag formats which uses the %im syntax.

New with this patch is support for ID3v2 fields that are
not supported by Rockbox. They can now be referenced by
their native frame name, e.g., TCON, TCOP, TDAT, etc. (for
the whole list, see
http://www.id3.org/id3v2.3.0.html#sec4.2.1). For example: %
ix”TDAT”.

The “Show ID3 Info” screen (long button press on wps
screen) will display all the tag names and values.

UPDATE: 2006-03-21
Synced to current cvs.

mmohr commented on 2006-03-24 15:07

UPDATE: 2006-03-24
Because lowlight doesn’t seem to have time this week,
I produced a synced patch to the current cvs

mmohr commented on 2006-03-28 14:12

UPDATE: 2006-03-28
It now also works on targets with hardware codec (I tested Archos recorder).
And I changed the behaviour a bit:

%ix|tagname|
%?ix|tagname|<true|false>

are now also allowed (makes it IMHO more consistent to other tags)

e.g.
%?ix|LOCATION|<%ix|LOCATION||No location available>
%?ix|LOCATION|<%ix"LOCATION"|No location available>

Also allowed are now already available tags, e.g.

%ix|TALB|

will display the album (same as %ia).

Internally I changed a lot ;)
I also highered the number of possible user tags to 10
and the bufsize to 512 (for devices with memory ⇐ 4M)
and to 1024 (for devices with memory > 4M)
Maybe it’s a bit big - but I wanted to see more about my comments :-)

It still only displays ID3v2 information and no ID3v1 information
but it should be no problem to extend it… (maybe I’ll do it later)

Known bug: In my tests with the simulator, the comment tag shows a

few strange characters at the beginning.
I don't know why :(

Maybe lowlight or somebody else can have a look at it?
(may have something to do with unicode mapping???)

mmohr commented on 2006-03-31 06:40

Forget my last patch - it works in principle,
but it wastes a lot of memory!

I learned, that the mp3entry structure will
be used for 32 tracks → so highering anything
inside is really no good idea!
And to make it even 1024 bytes large is an
absolutely waste of space…

I think the whole thing should be build into
the audiobuffer and therefore only loaded once
when loading a new track.
With that could also use as much memory as is
needed and not waste something where e.g. no
tag exists for…

So my suggestion is to work on that and put
it in after 3.0 - when the number of relevant
changes hopefully calm down :)

I can’t get this to work….any updates maybe?? Thanks in advance

I think this is a good patch, sorry it does not work with current daily builds.
Could someone please sync it to a recent version, please.

I will rework this once “metadata-on-the-buffer”…a framework for storing arbitrary amounts of metadata (tags, album art, etc) on the audio buffer…has been implimented.

“I will rework this once “metadata-on-the-buffer”…a framework for storing arbitrary amounts of metadata (tags, album art, etc) on the audio buffer…has been implimented.” – still valid interest? Would love to see it implemented with MoB.

Yes, I still plan to revisit this, I just need the time. But I’ve got “real” work and some other Rockbox things I want to do first.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing