AIFF files will not play on iPod, will on iTunes

Help for Audacity on macOS.
Forum rules
ImageThis forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
audio_pete
Posts: 215
Joined: Fri Jul 26, 2013 1:03 am
Operating System: Please select

Re: AIFF files will not play on iPod, will on iTunes

Post by audio_pete » Sun Aug 11, 2013 9:34 pm

steve wrote:Thanks for testing.

The files that I uploaded have the following file names:
  • 02-s-count-padding.aiff
  • 02-s-no-padding.aiff
  • 02-s-no-count-padding.aiff
So that we are perfectly clear, are you saying that:
  • 02-s-count-padding.aiff played correctly.
  • 02-s-no-padding.aiff did not play.
  • 02-s-no-count-padding.aiff played correctly.

Please confirm if the above is correct and I'll consult with Gale and Koz to see if these findings concur with their test results.
No.

The first album, Testaiff_count, the tone 2 song played on my iPod.
The second album Testaiff_no_count, the tone 2 song did not play
The third album, Testaiff_no_pad, the tone 2 song played on my iPod.

Count padding and
No padding played

No count padding did not

I can retest if these results do not make "sense"

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AIFF files will not play on iPod, will on iTunes

Post by Gale Andrews » Sun Aug 11, 2013 10:14 pm

audio_pete wrote: Count padding and
No padding played

No count padding did not
Thanks for clarifying.

Can you now see if your iPod will play 02-sjoel.aiff (id 8242). I mentioned this file here http://forum.audacityteam.org/viewtopic ... 63#p219963 .

Thanks


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AIFF files will not play on iPod, will on iTunes

Post by steve » Sun Aug 11, 2013 10:16 pm

I don't have an iPod so all I see is the actual file names and given the length and complexity of this forum thread I want to be certain that I've got the facts right. ;)

The results I was expecting are:
  • 02-s-count-padding.aiff plays correctly.
  • 02-s-no-padding.aiff plays correctly.
  • 02-s-no-count-padding.aiff does not play.
I believe that you are confirming that this is correct.

This would make sense because 02-s-no-count-padding.aiff is a direct copy of 02-s.aiff which you posted and reported did not play.

The difference between the three files are just very slight differences - in fact there are only 4 bytes involved, but clearly that is enough to upset not only your iPod but also other programs. I'll get back to you shortly - I'm pleased that we have finally made some real progress with this issue.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AIFF files will not play on iPod, will on iTunes

Post by steve » Mon Aug 12, 2013 9:29 am

Just a quick update on what we know so far. I think that Koz and Gale are still looking at some other details, but here's what we have established from the most recent tests.

From the AIFF specification (AIFF-1.3.pdf):
An AIFF file is composed of "Chunks".
Some Chunks (such as the one that holds the audio data) are compulsory.
Some Chunks (such as those that contain metadata) are optional.
Each Chunk must start on a 2 byte boundary.

Chunks are in the following form:
4 bytes that hold the Chunk ID (ckID)
4 bytes that say how many data bytes are in the Chunk (ckSize)
The Chunk data (ckData)
If the data has an odd number of bytes, an extra "zero" byte must be added as padding to the end of ckData so that the next chunk begins on a 2 byte boundary.
ckSize is the number of data bytes - it does not include the 8 bytes used by ckID and ckSize or the pad byte (if present).

Both your iPod and Riff-Pad have problem when "Text Chunks" have an odd number of bytes.
In the case of Riff-Pad we can see exactly what is going on, and that is what provided the clue for why your iPod (and Koz's older iPod) failed with some AIFF files but not others. Riff-Pad was failing on the same files as the iPods.

In the case of Riff-Pad, if there is an odd number of bytes in a Text Chunk, Riff-Pad tries to start reading ckData from the next byte after the end of ckSize, which fails because the data is offset by 1 byte (the "padding" byte). It gets worse - because the byte count is now offset by one byte, the next chunk cannot be read at all because the last byte of ckData is being misread as the first byte of the ckID of the next chunk.

Riff-Pad and the iPods read AIFF files correctly provided that there is an even number of bytes in each chunk.
For the COMM chunk this is not a problem because this chunk always has 18 bytes.
For the SSND chunk this will usually not be a problem because for 16 bit, 32 bit and stereo audio there will always be an even number of bytes (it might be interesting to test a mono 24 bit file that has an odd number of samples as this would have an odd number of bytes in the SSND chunk).
For Text chunks there may be an odd or even number of bytes, depending on the number of text character. This is where we see a repeatable problem for your iPod, Koz's older iPod and Riff-Pad. It appears that Apple have fixed the problem on newer iPod models as Koz's newer iPod will play these files.

iTunes avoids the potential problem of Text chunks by deleting the entire chunk. This is allowed under the AIFF specification for applications that process the audio, but is prohibited by the specification if the file is simply copied. This probably accounts for why transferring files one way via iTunes works but transferring another way does not work, though to be honest I could not follow your description of what you were doing (not helped by the fact that I don't have iTunes or an iPod). iTunes also uses non-standard chunks that appear to always have an even number of bytes (though I've not tested this thoroughly).

Having identified this issue, we now need to work out the best way to deal with it. There are several options that are currently being considered. I'll keep you informed.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: AIFF files will not play on iPod, will on iTunes

Post by Robert J. H. » Mon Aug 12, 2013 9:57 am

Stupid question, but are there no firmware updates that could correct this behaviour on older iPods?
Interestingly that Aple products do not abide by their house-made specifications. I'd expected this rather from MS.

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AIFF files will not play on iPod, will on iTunes

Post by steve » Mon Aug 12, 2013 10:24 am

Robert J. H. wrote:Interestingly that Aple products do not abide by their house-made specifications
Ironic isn't it.
steve wrote:(it might be interesting to test a mono 24 bit file that has an odd number of samples as this would have an odd number of bytes in the SSND chunk).
Riff-Pad counts the number of bytes incorrectly but is happy if SSND is the final chunk. If SSND is not the final chunk Riff-Pad can't read the final chunk correctly and throws an error message.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AIFF files will not play on iPod, will on iTunes

Post by Gale Andrews » Mon Aug 12, 2013 3:39 pm

steve wrote:Both your iPod and Riff-Pad have problem when "Text Chunks" have an odd number of bytes. In the case of Riff-Pad we can see exactly what is going on, and that is what provided the clue for why your iPod (and Koz's older iPod) failed with some AIFF files but not others.
[...]
For Text chunks there may be an odd or even number of bytes, depending on the number of text character. This is where we see a repeatable problem for your iPod, Koz's older iPod and Riff-Pad.
I think that is speculation as regards Koz's older iPod until Koz tests your three files and mine which happens to have even numbers of bytes for each chunk. If it was as simple as that for his older iPod, then he would be able to play AIFF files converted by iTunes, but he can't.

We need to find out exactly what his older iPod is.
steve wrote:If SSND is not the final chunk Riff-Pad can't read the final chunk correctly and throws an error message.
That's not correct if ID3 is the final chunk and Riffpad could read the previous chunks correctly.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AIFF files will not play on iPod, will on iTunes

Post by Gale Andrews » Mon Aug 12, 2013 3:49 pm

Gale Andrews wrote: Can you now see if your iPod will play 02-sjoel.aiff (id 8242). I mentioned this file here http://forum.audacityteam.org/viewtopic ... 63#p219963 .
@audio_pete: Could you also please see if your iPod can play the attached "audacityselectionwithoutmetadata.aiff"

We want to be sure we address all the issues there may be with older iPods.


Thanks


Gale
audacityselectionwithoutmetadata.aiff
(281.46 KiB) Downloaded 61 times
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AIFF files will not play on iPod, will on iTunes

Post by Gale Andrews » Mon Aug 12, 2013 4:06 pm

@audio_pete

Can you confirm you are running the latest version of iTunes and the latest version of the iPod software that you can get?

Please see "How to update iPod for Macintosh" on http://support.apple.com/kb/HT1483 .

See also how to find the iPod software version .


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AIFF files will not play on iPod, will on iTunes

Post by steve » Mon Aug 12, 2013 4:40 pm

Gale Andrews wrote:That's not correct if ID3 is the final chunk and Riffpad could read the previous chunks correctly.
It seems that it also depends on the number of bytes in ID3. Anyway, that was only an aside and not really relevant to the matter in hand.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply