Occasionally I find I have a CD with audio which clips or is on the edge of clipping, from which lossy encoding does cause or aggravate clipping.
Quote from: Takla on 02 January, 2012, 04:53:56 PMOccasionally I find I have a CD with audio which clips or is on the edge of clipping, from which lossy encoding does cause or aggravate clipping.And can you ABX those differences?I think this aggravation is not listenable at all...
Lossy audio encoding and decoding can cause the highest/lowest sample values to go over the allowed limit (in practice having the sequential max/min values), which may lead to clipping seen by analysis tools, or even audible clipping. But whether the clipping is truly audible or not is a totally different thing. There are different methods to avoid clipping in lossy audio. Look at the specific audio format answers how to best avoid clipping in each case.
somewhere to upload it
I'm sorry but am unwilling to perform an abx test on a sample that is unamibiguously audibly clipping and can damage my headphones or speakers. I will happily abx this on my Sony MDR ZX700 headphones or Sennheiser CX95 earphones on receipt of £65 or equivalent, or on any headphone that anyone cares to provide at no charge.
What I can offer without again risking damage to my headphones is an image of the waveform of the offending part of the track (03 - William Blitheman - Gloria tibi Trinitatis 6) in audacity uncompressed, and in Ogg Vorbis -q 7 and from wavpack:
For a modern DAC, clipping shouldn't damage your equipment due to the reconstruction filter. At most it'll boost the volume a dB or two, probably not even for such mild clipping as you have in those images.
Quote from: saratoga on 02 January, 2012, 08:03:19 PMFor a modern DAC, clipping shouldn't damage your equipment due to the reconstruction filter. At most it'll boost the volume a dB or two, probably not even for such mild clipping as you have in those images.I find that slightly reassuring, but then why would the caskets (is that the right word?) of my headphones be hideously resonating, that is physically shaking on my head, while the audio is distorting horribly?
..... but I see now that you saying that WavPack is the codec that is not doing this (obviously you are not using FFmpeg, or someone fixed that). However, it may that the decoder you are using for Ogg has a similar bug.
Quote from: bryant on 02 January, 2012, 08:13:30 PM..... but I see now that you saying that WavPack is the codec that is not doing this (obviously you are not using FFmpeg, or someone fixed that). However, it may that the decoder you are using for Ogg has a similar bug.For the wavpack encode I used the wavpack command line tools from wavpack 4.6 in Debian. Playback was via Rockbox 3.5.1 on iRiver H340, H140, Rockbox 3.10 on Sansa Clip+ and Rockbox daily build of 17 December on Android on an Archos A43IT (I wouldn't take too much notice of the Archos as a testing/comparison device because it seems to have a small built in bass and treble boost).
I downloaded the track and converted it into Ogg q5 and lame v2. Interestingly, the lame sample does not clip, and I could not ABX it.The vorbis sample does clip, but only very slightly. With concentration after A/B'ing it for a while, I could hear a very slight hiss in the Ogg track that was not present in the mp3 or wav version during one of the organ blasts. I'm assuming it was the clipping. Once I locked onto that portion, I could ABX it 4/4 just by listening for the momentary slight bit of hiss during the otherwise fairly tonal organ blast. I then replaygained the sample, and as expected the bit of noise went away. A very subtle effect, but with enough patience I believe audible.
That's reassuring - it isn't just me
I found that lame -h -V 1 was good for me. Vorbis clipped at any setting, as did neroAacEnc whether one or two pass. Once I stopped listening for the gross clipping I was able to notice some less obvious distortion in the few seconds leading up to it.....seems to be a sample with a variety of easily induceable artefacts...
.... using replaygain.
I'm aware of RG and did use it but found it problematic with a collection containing lots of albums which RG gives a significant gain raise (big collection of early music i.e. lots of acoustic lute+voice and similar) as well as modern music that gets a substantial reduction. I found that to guarantee avoiding clipping I needed a -6.0dB preamp, at which point it's no fun because everything except the loud stuff is much too quiet.
I settled on using the volume control instead.
Do you think the vorbis problem is with the encoder or the decoder? Are you suggesting I post it here or to xiph or RB or somewhere else?
A few years back when I was using Winamp, Ogg Vorbis files would regularly clip with (near) 0dB material.It turned out it was due to the Vorbis decoder, which had dithering enabled by default. Disabling dithering solved the clipping.
I think it's also likely that I first noticed gross audible clipping when I listened to the track individually in Rockbox at default settings and didn't appreciate that this had triggered album mode RG with 0.0 preamp.
So what I've found today is that with RG disabled I don't hear the gross resonance that I heard before, but what does happen (not every time but when occuring it's always in the exact same place in the track) is a nasty click. I wonder if this could be anything to do with the decoder overflow mentioned, or maybe is associated with the hardware.
Quote from: Takla on 03 January, 2012, 11:15:54 AM].... a nasty click. I wonder if this could be anything to do with the decoder overflow mentioned, or maybe is associated with the hardware.If you have a file that causes non-deterministic output in rockbox, you should post it now.
].... a nasty click. I wonder if this could be anything to do with the decoder overflow mentioned, or maybe is associated with the hardware.
Rockbox's RG setting is at "Track Gain If Shuffling".I have been listening to an album and RG has not been activated.Then I load a single track which has RG album value in the tags. When RG is activated there is a often click as the gain changes.The click occurs the after the same number of seconds each time it's heard, which makes it at first seem to be associated with the audio file, when in fact it's associated with the player.
The original gross distortion seems to have been caused by the way oggenc copies RG tags unchanged when encoding from flac, even though the levels of Ogg Vorbis file are not identical to that of the flac. The same file with corrected RG values does not induce clipping.
I can only thank you for your patience,
I'm not sure I understand what you're saying. Replaygain does not introduce a click.
Quote from: saratoga on 03 January, 2012, 07:26:24 PMI'm not sure I understand what you're saying. Replaygain does not introduce a click.Agreed: RG per se, with correct values, doesn't cause a click. But the change in gain from one gain level to another can induce a click from the player, as does switching on eq or crossfeed, or the sleep timer shutting the player down and so on.
So what I'm saying is that the encoded vorbis file is fine: that the original audible resonating distortion was an unforseen result of a combination of factors but I was mistakenly associating it with what was easily seen and overtly apparent - the thick red clipping warnings when I put the file into a wav editor, and the last artefact I noticed, a click, was being caused not by the audio file but by the player.
To be 100% clear: there is no way an error of a fraction of a dB in the replaygain value could cause the integer wrap around you described above in an audio file. That is simply not how these things work.