m4a and ReplayGain-tagging: a problem with Rockbox

Discuss Play, an open source multi-format audio player.
Post Reply
j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Wed Oct 10, 2007 10:27 am

Hello there!

this is my first posting, so please be kind :)


I really, really love play's feature of being able to scan RG and write it to the Metadata.
I am using Rockbox on my iPod Nano 1st Gen. and foobar2000 is the only application I miss - when using OS X. play fills that gap almost perfectly. but one thing does not work as expected:

Rockbox does not seem to recognize the RG values in mp4/m4a-files scanned with play. With foobar2000 it does. Is this because foobar uses some obscure tagging scheme, is it play's fault or is it something with rockbox?

I don't know anything about tagging mp4-files. AFAIK mp4 does not use id3 or ape. what does it use? and how can I fix this? what is the difference between play's tagging and foobar's?

thanks in advance and have a nice day!



edit: I am sorry, feel free to move this topic as appropriate.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by sbooth » Wed Oct 10, 2007 2:09 pm

j33n7 wrote:Rockbox does not seem to recognize the RG values in mp4/m4a-files scanned with play. With foobar2000 it does. Is this because foobar uses some obscure tagging scheme, is it play's fault or is it something with rockbox?

I don't know anything about tagging mp4-files. AFAIK mp4 does not use id3 or ape. what does it use? and how can I fix this? what is the difference between play's tagging and foobar's?
This is Play's fault- although it can calculate RG values for any of the formats it supports, not all of them are written back to the original file. m4a is one of the formats that Play cannot (yet) read or write RG for. I'm not actually sure if there is a standard for how RG information is stored in m4a. I will do some research to figure it out.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Wed Oct 10, 2007 3:19 pm

sbooth wrote:This is Play's fault- although it can calculate RG values for any of the formats it supports, not all of them are written back to the original file. m4a is one of the formats that Play cannot (yet) read or write RG for. I'm not actually sure if there is a standard for how RG information is stored in m4a. I will do some research to figure it out.
hydrogenaudio.org features a foobar2000 sub-forum and a foobar-wiki. the developer's site links to them. those could be helpful. I am not sure whether there is any standard of writing RG values to mp4 files or not. according to the wiki http://wiki.hydrogenaudio.org/index.php ... eplay_Gain foobar uses it's own format. :-/



edit:

There is no AAC tagging standard. Therefore there's no guarantee that your tags will work with the future devices. If you tag with Apple's standard you should not have issues with anything Apple.

However using ID3 tags or APE tags on AAC files would make the situation much worse IMHO. Then your files could be recognized with a handful of software.

Everything boils down to on what hardware+software you intend to play your files.
from

http://www.hydrogenaudio.org/forums/lof ... 32063.html


and another quote from "case" ("tag"-developer):
The iTunes way is the only way and component included in foobar is the same as the one on my page.
from

http://www.hydrogenaudio.org/forums/lof ... 13390.html


of course those are fairly old quotes.

as a result iTunes-tagging seems to be the de-facto standard.

more on iTunes-tagging:

http://www.hydrogenaudio.org/forums/ind ... ntry251686


regards!

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Fri Oct 12, 2007 8:01 am

sbooth, sorry to raise this again but could you post a reply to this topic as soon as you get information regarding your research? I am eager for this!

thanks very much and best regards!

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by sbooth » Sat Oct 13, 2007 8:49 pm

I've just checked in changes that read and write replay gain information for MPEG-4 files. I went with the semi-standard "com.apple.itunes.----" atoms with names along the same lines as the TXXX frames in MP3 files: "replaygain_reference_loudness", "replaygain_track_gain", "replaygain_track_peak", "replaygain_album_gain", and "replaygain_album_peak." The formatting is the same as the Vorbis comments and TXXX frames of the same name.

I believe this is the same scheme used by foobar, but I can't confirm this.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Sun Oct 14, 2007 11:51 am

Thanks for the effort! I've just checked the mp4 files processed by latest Play (r986) and fb2k and Rockbox apparently doesn't read the RG data.


I am really stuck here because I cannot find any information on how foobar's tagger works (that is what library foobar uses to write tags) or what tags are actually written by foobar.

edit: grammar
Last edited by j33n7 on Tue Dec 11, 2007 12:46 pm, edited 1 time in total.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by sbooth » Sun Oct 14, 2007 4:18 pm

j33n7 wrote:Thanks for the effort! I've just checked the mp4 files processed by latest Play (r986) and fb2k and Rockbox apparently don't read the RG data.
The changes are checked into svn, but haven't yet been posted as a build. You'll need to wait for the next unstable or compile from source to test them out currently.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Mon Oct 15, 2007 6:47 am

okay, I'll have to wait for the unstable version then.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by sbooth » Mon Oct 15, 2007 10:56 am

j33n7 wrote:okay, I'll have to wait for the unstable version then.
0.2 has those changes as well.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Mon Oct 15, 2007 1:03 pm

sbooth wrote: 0.2 has those changes as well.
=)


Okay.. here's what I did. I took an album encoded in AAC LC and wrapped into an mp4-container with the extension *.m4a, removed all tags with fb2k and retagged them with foobar and freedb's information.
I then let Play (0.2) determine and write RG values to those files and copied them to my rockboxed iPod Nano. I copied them to another foobar playlist, too. Foobar reads the values just fine.
Only Rockbox seems to have trouble reading any tags because it tries to persue me that those files didn't even exist. :-(
When it's forced to look for them in "file-view" (I usually use the built-in tag-based database) it refuses to play them.
I even updated to the newest daily build (r15111). Doesn't work.

When letting foobar simply rewrite all tags it works.



edit:

hm, after playing around with foobar's advanced preferences, I noticed that Rockbox shows the same behaviour with files tagged by foobar when I choose to let it write the mp4-tags to the end of the file. where are the tags written by Play?


2nd edit:

okay. I took a hex editor and looked at an identical file once tagged with foobar and then tagged with play and it indeed seems that Play writes the tags at the end of each mp4-file.



after digging a bit through the forums on hydrogenaudio.org it seems to me that the atoms which contain the tag data can be in random locations in a file so the problem most likely lies in Rockbox.

I've just started a topic in the Rockbox forums regarding this "bug".

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Mon Oct 15, 2007 6:41 pm

I recently was looking for a nice way to provide my m4a files with ReplayGain information under Mac OS X and finally found "Play" http://sbooth.org/Play/ which is able to scan and write RG values to mp4 files. I did that and noticed that Rockbox is not able to read any tags from those files. The same procedure with foobar works. I am aware of the fact that foobar by default writes the meta-data atoms to the beginning of the file which Play does not.

But I am also aware of the fact (?) that the atoms containing meta-data can be in random location within the files.
Rockbox doesn't seem to cope very well with this.
So, is this to be fixed in a future release of Rockbox? Or is this no bug?
Lear Developer wrote:It's more like a known limitation. :)

The placement of the metadata atoms isn't really random (there are some limitations, after all), but Rockbox should be able to read the metadata as long as it is located before the audio data.

As for improvements on this, once the "metadata on buffer" feature is implemented, it should at least be possible to do something about it.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Fri Oct 26, 2007 8:44 am

hello again!

do you have any plans regarding the location of the mata data atoms within the files?

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by sbooth » Fri Oct 26, 2007 3:29 pm

j33n7 wrote:do you have any plans regarding the location of the mata data atoms within the files?
Not necessarily. libmp4v2 does have an optimize function, which strips free space and re-orders the atoms. I will investigate and if it isn't too slow I will have Play optimize the files when it saves them.

j33n7
Posts: 17
Joined: Wed Oct 10, 2007 10:15 am
Location: EU/GER/MZ

Re: m4a and ReplayGain-tagging: a problem with Rockbox

Post by j33n7 » Sun Oct 28, 2007 8:50 am

thank you very much for this!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests