iTunes gapless playback and Max' AAC's

Discuss the current and future development of Max.
Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Tue Dec 05, 2006 1:30 pm

Thanks for testing this. Unfortunately I don't think I'll be able to get my hands on a 5G iPod. I'm going to do some tests with a Nano soon though.

The fact that ALAC plays gapless is not very surprising, due to their nature lossless files generally don't suffer from gaps.

I'm not sure (since I don't have one) but isn't there a newer firmware for that iPod? Could you hook up your iPod to iTunes and choose 'Check for Updates' from the 'iTunes' menu? Just to be sure...

You are using iTunes to transfer the Max generated file to the iPod don't you? I think the gapless info needs to be stored in the DB on the iPod and at least for iTunes I'm sure it works OK.

I think the test would be best if exactly the same conversion is done in both Max and iTunes and preferably with the least complex and identical source format (to rule out FLAC or ALAC reading issues). I'd recommend converting the source to Wav and then using that Wav as a source for the same conversion in iTunes and Max. Could you do that? Thanks!

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Tue Dec 05, 2006 2:02 pm

Maurits wrote:Thanks for testing this. Unfortunately I don't think I'll be able to get my hands on a 5G iPod. I'm going to do some tests with a Nano soon though.
No problems... I am happy to test... :-)
Maurits wrote: The fact that ALAC plays gapless is not very surprising, due to their nature lossless files generally don't suffer from gaps.
Agreed, it was mentioned more as a datapoint to verify that the files were gapless, and that the firmware was capable of playing gapless files.
Maurits wrote: I'm not sure (since I don't have one) but isn't there a newer firmware for that iPod? Could you hook up your iPod to iTunes and choose 'Check for Updates' from the 'iTunes' menu? Just to be sure...

You are using iTunes to transfer the Max generated file to the iPod don't you? I think the gapless info needs to be stored in the DB on the iPod and at least for iTunes I'm sure it works OK.
I use iTunes to update both the music and the iPod, and it is up to date, and when I transfer the iTunes generated file it does play gaplessly.
Maurits wrote: I think the test would be best if exactly the same conversion is done in both Max and iTunes and preferably with the least complex and identical source format (to rule out FLAC or ALAC reading issues). I'd recommend converting the source to Wav and then using that Wav as a source for the same conversion in iTunes and Max. Could you do that? Thanks!


I will try to do that tonight (wife and kids permitting ;-) )

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Tue Dec 05, 2006 9:35 pm

Maurits wrote:That is strange. Since there is no difference between the gapless data produced by Max and by iTunes it shouldn't sound different.
It would appear that this statement is not as true as previously believed ;-). Judging by a previous comment in this thread, the important atom is ITunSMPB, and for me, they are different between iTunes and MAX created files.

For me, when I look at the created files, all of the iTunes files (both 120 and 160 bit CBR AAC) have :

iTunSMPB^@^@^@<84>

However, the Max created file has:

iTunSMPB^@^@^@<83>

I do not know how much difference that might make, but there would not need to be much difference for the blip that I am noticing to go away... Anyway, can't test on the iPod tonight, but I did notice the above difference.

Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Wed Dec 06, 2006 8:55 am

Interesting stuff.

Could you post the complete content of iTunSMPB in those files?

It should be more like this:
00000000 00000840 0000037c 00000000 00f1d844 00000000 00000000 00

In the mean time I'll try and find files with a difference between iTunes and Max. As I wrote earlier, I haven't seen one yet so I'm not quite sure how to produce one that is different. I'll try some unusual things...

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Wed Dec 06, 2006 9:43 pm

Except for the first bit before the data, and I have no idea what that is, the two look pretty similar to me.

I don't know if it makes any difference, but the tags are also in a different order as well. I will try to pull down a newer svn snapshot and run that, just to make sure that I am getting the latest results.

itunes:
iTunSMPB^@^@^@<84>data^@^@^@^A^@^@^@^@ 00000000 00000840 00000294 00000000008AC12C 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

max:
iTunSMPB^@^@^@<83>data^@^@^@^@^@^@^@^@00000000 00000840 00000294 00000000008ac12c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Wed Dec 06, 2006 10:55 pm

I wonder if the iPod is case sensitive for this atom and iTunes is not. :?

Could you create the files from the same source again but this time with XLD instead of Max please? Or perhaps you could change the few lower-case characters to upper-case with a Hex-editor? That would rule out the case difference...

By the way, as far as I can see no changes to the gapless code have been made since build 1077 so that build will do just fine.

Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Thu Dec 07, 2006 7:52 pm

OK, this is even better. Could you try both these sets of tracks on your iPod? Is the upper case one completely gapless?

[files removed]

Thanks!
Last edited by Maurits on Thu Dec 07, 2006 8:25 pm, edited 1 time in total.

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 8:15 pm

Maurits wrote:OK, this is even better. Could you try both these sets of tracks on your iPod? Is the upper case one completely gapless?

Lower case
Upper case

Thanks!
Well... I could not reliably detect any difference between the two... there was a few ticks in the lowercase version, but they also turned up in the upper case version :-)

I will experiment some more with my own tracks and get back to you.

Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Thu Dec 07, 2006 8:26 pm

OK, too bad. Would have been nice if it was just that. Nonetheless, Stephen, could you make the atom fully upper case? Just to be sure?

I'm really interested in the files XLD makes...

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 8:48 pm

Maurits wrote: I'm really interested in the files XLD makes...
Well... good and bad news... XLD also has the mini-skip when played on the iPod. However, for all three of Max, XLD and iTunes I converted from iPod, iTunes plays truely seamlessly, both Max and XLD have very brief skip... as mentioned before, it is very short, however definitely noticeable.

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 9:02 pm

Maybe some more useful information... I assume that cpil is compilation, and that tmpo is tempo, although I can't imagine either of those fields affecting gapless playback. But, both iTunes and XLD spit out capitals, and a leading space.... for consistency, so should Max I guess....

More investigation needed however, since I can't see how this shows any useful difference between iTunes and XLD, and XLD already has the annoying gap.

$mutagen-inspect *.m4a 21:57:34
-- iTunes.m4a
- MPEG-4 audio, 206.26 seconds, 160000 bps
tmpo=0
©too=iTunes v7.0.2, QuickTime 7.1.3
cpil=False
----:com.apple.iTunes:iTunSMPB= 00000000 00000840 00000294 00000000008AC12C 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
©nam=01-Artful Dodger; Romina Johnson-Movin Too Fast (Bump & Flex Vocal Mix)
----:com.apple.iTunes:iTunNORM= 000005AC 000004BD 00006B1E 000087E9 0002FFE5 000316E5 00007E89 00007E89 00007373 00007470

-- max.m4a
- MPEG-4 audio, 206.26 seconds, 128003 bps
©too=Max 0.6.2b
----:com.apple.iTunes:iTunSMPB=00000000 00000840 00000294 00000000008ac12c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

-- XLD.m4a
- MPEG-4 audio, 206.26 seconds, 128000 bps
©too=X Lossless Decoder, QuickTime 7.1.3
----:com.apple.iTunes:iTunSMPB= 00000000 00000840 00000294 00000000008AC12C 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 9:10 pm

I think that I may have found a problem... iTunes puts all of the tags at the front of the file, Max puts them all at the end.

Although that does not explain XLD, which also puts the tags towards the fron t of the files. :-\

Also, both iTunes and XLD spit out

iTunSMPB\0\0\0\XCC

and Max spits out

iTunSMPB\0\0\0\XCB

And, here is an octal dump of (what I think is) the interesting area.

Code: Select all

iTunes.m4a
0112300   c   k   T   i   m   e       7   .   1   .   3  \0  \0  \0 274
0112320   -   -   -   -  \0  \0  \0 034   m   e   a   n  \0  \0  \0  \0
0112340   c   o   m   .   a   p   p   l   e   .   i   T   u   n   e   s
0112360  \0  \0  \0 024   n   a   m   e  \0  \0  \0  \0   i   T   u   n
0112400   S   M   P   B  \0  \0  \0 204   d   a   t   a  \0  \0  \0 001
0112420  \0  \0  \0  \0       0   0   0   0   0   0   0   0       0   0
0112440   0   0   0   8   4   0       0   0   0   0   0   2   9   4    
0112460   0   0   0   0   0   0   0   0   0   0   8   A   C   1   2   C
0112500       0   0   0   0   0   0   0   0       0   0   0   0   0   0
0112520   0   0       0   0   0   0   0   0   0   0       0   0   0   0
0112540   0   0   0   0       0   0   0   0   0   0   0   0       0   0
0112560   0   0   0   0   0   0       0   0   0   0   0   0   0   0    
0112600   0   0   0   0   0   0   0   0  \0  \0  \0 242   -   -   -   -
0112620  \0  \0  \0 034   m   e   a   n  \0  \0  \0  \0   c   o   m   .
0112640   a   p   p   l   e   .   i   T   u   n   e   s  \0  \0  \0 024
max.m4a
14735740   a   t   a  \0  \0  \0 001  \0  \0  \0  \0   M   a   x       0
14735760   .   6   .   2   b  \0  \0  \0 273   -   -   -   -  \0  \0  \0
14736000 034   m   e   a   n  \0  \0  \0  \0   c   o   m   .   a   p   p
14736020   l   e   .   i   T   u   n   e   s  \0  \0  \0 024   n   a   m
14736040   e  \0  \0  \0  \0   i   T   u   n   S   M   P   B  \0  \0  \0
14736060 203   d   a   t   a  \0  \0  \0  \0  \0  \0  \0  \0   0   0   0
14736100   0   0   0   0   0       0   0   0   0   0   8   4   0       0
14736120   0   0   0   0   2   9   4       0   0   0   0   0   0   0   0
14736140   0   0   8   a   c   1   2   c       0   0   0   0   0   0   0
14736160   0       0   0   0   0   0   0   0   0       0   0   0   0   0
14736200   0   0   0       0   0   0   0   0   0   0   0       0   0   0
14736220   0   0   0   0   0       0   0   0   0   0   0   0   0       0
14736240   0   0   0   0   0   0   0       0   0   0   0   0   0   0   0
14736260
XLD.m4a
0117420   r   ,       Q   u   i   c   k   T   i   m   e       7   .   1
0117440   .   3  \0  \0  \0 274   -   -   -   -  \0  \0  \0 034   m   e
0117460   a   n  \0  \0  \0  \0   c   o   m   .   a   p   p   l   e   .
0117500   i   T   u   n   e   s  \0  \0  \0 024   n   a   m   e  \0  \0
0117520  \0  \0   i   T   u   n   S   M   P   B  \0  \0  \0 204   d   a
0117540   t   a  \0  \0  \0 001  \0  \0  \0  \0       0   0   0   0   0
0117560   0   0   0       0   0   0   0   0   8   4   0       0   0   0
0117600   0   0   2   9   4       0   0   0   0   0   0   0   0   0   0
0117620   8   A   C   1   2   C       0   0   0   0   0   0   0   0    
0117640   0   0   0   0   0   0   0   0       0   0   0   0   0   0   0
0117660   0       0   0   0   0   0   0   0   0       0   0   0   0   0
0117700   0   0   0       0   0   0   0   0   0   0   0       0   0   0
0117720   0   0   0   0   0       0   0   0   0   0   0   0   0  \0  \0
0117740  \a 320   f   r   e   e  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0117760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
Any other information that you can think of?

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 9:54 pm

Hmm.. I have just discovered something very interesting.... the iTunes generated file has a very different header. For a start the magic number is different, and it is a hmoov, not a moov. I hope that helps somebody figure out what it all means!

Oh.... one other difference... it would appear that max inserts a lot of extra zeros that neither XLD, nor iTunes do...

Code: Select all

~/tmp/mus % od -c iTunes.m4a| head -10                                                                                                                               
0000000  \0  \0  \0       f   t   y   p   M   4   A      \0  \0  \0  \0
0000020   M   4   A       m   p   4   2   i   s   o   m  \0  \0  \0  \0
0000040  \0  \0 235   h   m   o   o   v  \0  \0  \0   l   m   v   h   d
0000060  \0  \0  \0  \0 301 236   I   : 301 236   J 323  \0  \0 254   D
0000100  \0 212 314  \0  \0 001  \0  \0 001  \0  \0  \0  \0  \0  \0  \0
0000120  \0  \0  \0  \0  \0 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0000160  \0  \0  \0  \0   @  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000200  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000220  \0  \0  \0 002  \0  \0 223 031   t   r   a   k  \0  \0  \0   \
~/tmp/mus % od -c XLD.m4a | head -10                                                                                                                                                                             
0000000  \0  \0  \0 034   f   t   y   p   M   4   A      \0  \0  \0  \0
0000020   M   4   A       m   p   4   2   i   s   o   m  \0  \0 247 222
0000040   m   o   o   v  \0  \0  \0   l   m   v   h   d  \0  \0  \0  \0
0000060 301 234 332 270 301 236   K 001  \0  \0 002   X  \0 001 343   m
0000100  \0 001  \0  \0 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000120  \0 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0000160   @  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000200  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0 002
0000220  \0  \0  \0   !   i   o   d   s  \0  \0  \0  \0 020 200 200 200
~/tmp/mus % od -c max.m4a | head -10                                                                                                                                                                             
0000000  \0  \0  \0 034   f   t   y   p   M   4   A      \0  \0  \0  \0
0000020   M   4   A       m   p   4   2   i   s   o   m  \0  \0 257 341
0000040   f   r   e   e  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000060  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0127760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   2   [
0130000 260   m   d   a   t      \0  \0  \0  \0  \0 016      \0  \0  \0
0130020  \0  \0 016      \0  \0  \0  \0  \0 016      \0  \0  \0  \0  \0
0130040 016      \0  \0  \0  \0  \0 016      \0  \0  \0  \0  \0 016    
0130060  \0  \0  \0  \0  \0 016      \0  \0  \0  \0  \0 016      \0  \0

Maurits
Posts: 117
Joined: Sun Jan 29, 2006 1:36 pm
Location: London, Europe

Post by Maurits » Thu Dec 07, 2006 10:10 pm

pwagland wrote: -- max.m4a
- MPEG-4 audio, 206.26 seconds, 128003 bps
©too=Max 0.6.2b
----:com.apple.iTunes:iTunSMPB=00000000 00000840 00000294 00000000008ac12c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Well, Max certainly has an odd bitrate here. :) And it has one block of zero's less than the other two.
pwagland wrote:I think that I may have found a problem... iTunes puts all of the tags at the front of the file, Max puts them all at the end.

Although that does not explain XLD, which also puts the tags towards the fron t of the files. :-\
That is a known issue (optimization is the process of moving the tag to the front) but it should only happen when using source files without metadata like WAV. The tags will be at the front when encoding from CD of FLAC for instance.
Last edited by Maurits on Thu Dec 07, 2006 10:32 pm, edited 2 times in total.

pwagland
Posts: 16
Joined: Tue Nov 28, 2006 11:29 pm

Post by pwagland » Thu Dec 07, 2006 10:13 pm

Maurits wrote: Well, Max certainly has an odd bitrate here. :) And it has one block of zero's less than the other two.
Yeah :-)

I think that the odd bitrate comes from the 40(odd)K of zero 'free' padding that max adds, that the other two do not. Also, it has everything the same, except for a missing leading space.... and the other things that I have just mentioned ;-)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest