Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: Andhyka on August 07, 2007, 05:47:16 AM

Title: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 05:47:16 AM
Hi, I just joined Rockbox forum being Hi-Fi newbie since I got my iPod and decent canalphone (MDR-EX90) one month ago.  ;)

Recently, I installed Rockbox on my iPod after reading some ipod SQ posts on Head-Fi.org, and wow, Crossfeed and HW SQ are awesome! It drains battery and is bit laggy though but it's negligible.

I have a question, does massive pre-cut (-24db) have an impact on sound output? I was thinking of setting my volume to 0db (line out, cleanest quality) and use pre-cut as a volume control to handle my headphone instead. I read somewhere in the forum that input source (44khz, 16 bit) gets upscaled to 32 bit during DSP, and is downscaled back to 16bit for the DAC.

But since the output is compressed (from -24db precut), will it have the same high dynamic range as when it was not cut at all (0db precut, but @ 50-60% volume)?

Edit: I finally settled on this matter. Doing all the above steps is not recommended as it can reduce the clarity/fidelity of audio signal. Either sets the pre-cut level suitable to your headphone, or turn it off entirely.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: pabouk on August 07, 2007, 06:24:22 AM
Because the pre-cut is applied in the digital domain you lose the dynamic range by lowering the volume using pre-cut. This practically means that the quantization noise will be louder. If I remember it correctly 6 dB corresponds approximately to 1 bit of digital resolution thus by applying -24 dB you would have a digital resolution of 12 bits instead of the original 16 bits.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 06:31:57 AM
Ouch, 4bit lost in translation is intolerable i presume.  :o

I thought everything in digital domain will not lose detail and clarity.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: pabouk on August 07, 2007, 08:05:28 AM
I thought everything in digital domain will not lose detail and clarity.
This could be true only if the DA converter in your player has resolution of at least 16 + 4 = 20 bits and S/N ratio at least 120 dB!
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 08:47:15 AM
Oh well, thanks for the input. I raised this whole issue because the iPod sounds best near/at 0db (according to Rockbox & Head-Fi fellows) and is too loud for headphone, so pre-cutting in equalizer helps but at the cost of reduced/compressed clarity.

The other solution possible is adding amp (which I don't bother spending one cos it is more expensive than the headphone itself) and adding iMod (costs the same as 30GB iPod).

After tweaking little bit, I settled on this:

Volume: -15db
Balance: -3%
Pre-Cut: -9db
Crossfeed (Direct/Cross/Attenuation/Cutoff): 0db, -6db, -6db, 700hz
Hardware EQ (Bass Cutoff/Gain): 105hz/6db - turned on when crossfeed is off

Software EQ is on only for pre-cut, anything else is off.

Ideas/Suggestion/Feedback?
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: preglow on August 07, 2007, 11:13:43 AM
Because the pre-cut is applied in the digital domain you lose the dynamic range by lowering the volume using pre-cut. This practically means that the quantization noise will be louder. If I remember it correctly 6 dB corresponds approximately to 1 bit of digital resolution thus by applying -24 dB you would have a digital resolution of 12 bits instead of the original 16 bits.
This assumes that Rockbox uses 16 bits precision for samples internally, and that is quite simply not true. Most codecs operate with an accuracy at or above 24 bits, so the bits that get shaved away in the precut will probably not be audible in the output anyway.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: mamboman on August 07, 2007, 01:30:24 PM
thanks for the advise. so i guess it doesn't discard much of the real information from the stream. just invested in an amp and listening through the lineout without the imod, the sound quality is indeed significantly improved but at the expense of portability.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: pabouk on August 07, 2007, 01:45:46 PM
I do not know much about Rockbox internals so correct me if I am wrong.

Most codecs operate with an accuracy at or above 24 bits, so the bits that get shaved away in the precut will probably not be audible in the output anyway.
I know that Rockbox operates with about 30 bit accuracy at some places but as far as I know the final output to the DAC is always truncated or dithered to the most significant 16 bits.

When you set precut to -24 dB you are approximately "shifting" the original sample value by 4 bits to the less significant bits thus the 4 most significant bits are not used by the original signal anymore. At the final stage before sending the signal to the DAC only the most significant 16 bits are taken (optionally with some information from lower bits by dithering) so in our case only 12 bits from the original signal would be used and the 4 most significant bits will be wasted (zero).
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 07:17:22 PM
Finally, I found the answers what I am looking for!  ;D

http://www.wolfsonmicro.com/products/WM8983
http://www.wolfsonmicro.com/uploads/documents/en/WM8983.pdf

It turns out that Wolfson DAC chip (WM8983) on my iPod Video 80GB uses 24-bit sampling in both its ADC and DAC filters. I am not sure about other iPods/players but this seems to indicate that way. Now I can set pre-cut to its lowest lvl (-24db) and enjoy hi-fi pure sound delivered from my iPod @ 0db volume.  :D

I'm still looking the answer for this question though: What sampling is used by Rockbox to deliver sound output on its final stage to Wolfson chip? Does Rockbox digitally downsample it from 32-bit back to 16-bit or 24-bit?
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: saratoga on August 07, 2007, 08:25:32 PM
Finally, I found the answers what I am looking for!  ;D

http://www.wolfsonmicro.com/products/WM8983
http://www.wolfsonmicro.com/uploads/documents/en/WM8983.pdf

It turns out that Wolfson DAC chip (WM8983) on my iPod Video 80GB uses 24-bit sampling in both its ADC and DAC filters. I am not sure about other iPods/players but this seems to indicate that way. Now I can set pre-cut to its lowest lvl (-24db) and enjoy hi-fi pure sound delivered from my iPod @ 0db volume.  :D

That won't work.  You'll still lose 24 dB of SNR.  Anytime you adjust volume in the digital domain, you lose SNR, no exceptions.  Thats why volume is adjusted on the analog side of the DAC.  Don't try and defeat that, you can only make things worse.

I'm still looking the answer for this question though: What sampling is used by Rockbox to deliver sound output on its final stage to Wolfson chip? Does Rockbox digitally downsample it from 32-bit back to 16-bit or 24-bit?

Rockbox uses 44.1KHz as the sampling rate.  I don't know what precision is loaded into the DAC, but I'd imagine its 16 bit.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 09:27:40 PM
Umm I am unsure of how Rockbox precut works, whether it cuts the bottom half of sound or compress/normalize the whole fidelity. If the latter is what happens, I have to disagree.

Since the EQ/DSP processing done in Rockbox is through 32-bit channel, the pre-cut won't affect the SNR as the audio source is still wholly 16-bit. Yes I know it's already upscaled to 32 bit, but the fact that it is just 16-bit stretched will not affect SNR/fidelity of the original music unless I cut waaaay too much (like minus 96db - 6db * 16-bit).

But the early argument still remains, how does Rockbox cut the music? Does it use compress/normalize algorithm, or simply just cut the lower half of sound fidelity.

Any thoughts?

Hmm, I'm still hoping Rockbox feeds 24-bit audio signal to Wolfson ADC/DAC.

Here's the breakdown:

Digital Music (44khz & 16bit) -> Rockbox DSP (16bit stretched to 32bit) ->
24db Pre-Cut (16bit stretched to 28bit/32bit) -> Final Downsampling (16bit stretched to 21bit/24bit -> Wolfson chip (16bit stretched to 21bit/24bit processed by 24-bit ADC/DAC) -> Pure 16-bit signal audible through headphone

Edit: I revised the breakdown above
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 09:55:18 PM
Wouldn't the math be -> 21/24 rather than 20/24, then to 14/16? I'm not really an expert on this, but if a 16 bit signal is scaled to 32bit, you actually use the other 16 bits giving twice the resolution, rather than leaving them empty, don't you? It's for more accurate processing, isn't it?
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 10:03:06 PM
I think 16/24/32 bit and decibels work exponentially, so half the volume of 32-bit is not the same as 16-bit, since 2 ^ 32-bit = 4294967296 and 2 ^ 16-bit = 65536.

But apart from the maths, I can confirm that the 16bit signal stretched to 24bit/32bit and transformed to anything above 16bit itself will not affect its fidelity/SNR. You can check it on Professional audio software like Adobe Audition.

I think let's use an easy example with 4bit/8bit/12bit signal:

1 0 1 0

if we convert this to 12bit signal:

111 000 111 000

The same data is added three times. If it's converted back to 8bit signal:

11 00 11 00

Then downscaled back to 4bit:

1 0 1 0

Its only stretched back and forth, and 16bit signal in 32bit channel is still 16bit (except for X-Fi).  :P
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 10:16:19 PM
Yes, if you make absolutely no changes to the signal, obviously going from 16 bit to a linear multiple (32 bit) and back again will result in identical output. I'm not even sure why you bothered to try to explain that, as it's not relevant once you start changing the signal.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 10:23:35 PM
Well, that explains the signal pathway I mentioned above. And it's just 16-bit data being transformed over and over until it reaches Wolfson DAC without loss of quality/fidelity, of which I hope Rockbox pre-cut EQ function compresses the whole spectrum instead of cutting the lower fidelity.

Compress vs Pre-cut:

00001100 -> 0010 (data compressed, or in another term, downscaled)

00001100 -> 1100 (the first half of data is deleted or cut, meaning it loses fidelity/SNR)
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 10:29:15 PM
You're talking gibberish. The above signal path is *not* just 16 bit being transformed over and over. It includes the gain adjustment which removes accuracy, the exact reason why you wrote 28/32. That's 4 bits lost of accuracy. When you scale those 4 bits down to 16-bit scale, it's 2 bits loss of accuracy at that scale, is it not? But that's assuming that the 4 bits of lost accuracy is the right number, at 32-bit etc.

You're trying to imagine a scenario where audio can be transformed losslessly. If you decrease the gain in digital this is performed by multiplying the sample by a constant. Since you're decreasing, this results in a changed sample and loss of accuracy. You can't magically make the number smaller yet still keep all the bits.

For example, if you have a sample that is 1111 1111 1111 1111 and you multiply it by a smaller constant, how would you maintain all the data in that sample? You lose some, simply by definition.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 10:40:50 PM
Yes actually you are right. It will lose a lot of accuracy in the process - when scaled to 16bit, which happens on Rockbox right now.

So this is the Original Rockbox:

16 -> 32 -> 28/32 -> 14/16 -> DAC -> 14bit analog signal

But so far I noticed, the iPod Rockbox only lost 2db of accuracy (instead of 4db, which I thought it be).

Well, as I mentioned above, I'm happy with -12db pre-cut listening to iPod Rockbox on -15db volume.

Until I found out that Wolfson DAC supports 96khz/24bit. Rockbox could be updated to do this:

16 -> 32 -> 28/32 -> 21/24 -> DAC -> 16bit analog signal

Edit: I finally realized that pre-cut in software EQ actually cuts away the gain/SNR/fidelity. I still hoped that the pre-cut algorithm is changed to downscale algorithm.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 10:54:02 PM
Again I ask you: How do you decrease a signal without losing anything? The statement makes no sense. The least you can possibly lose is the least significant bit. It's simple math.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 11:00:52 PM
Umm I don't know how the algorithm works but the normalize features available on Adobe Audition seems to do exactly that. It allows records with compressed fidelity (prevalent in early 1990s) to fit into its maximum potential. I don't have it as it's very expensive but you get the idea from here:

http://blogs.magnatune.com/buckman/beier1.gif
http://blogs.magnatune.com/buckman/beier2.gif

Edit: Hmm, I guess this must be resource-intensive, and not implementable in iPod.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 11:05:30 PM
"Normalizing" doesn't do any such thing. Normalizing can usually be seen as increasing or decreasing the volume to a set point, usually used in an attempt to have all tracks peak at 0dB. It doesn't gain you any additional fidelity, all it does is essentially shifts/stretches where the existing range you have lies across. Are you perhaps referring to something other than a "Normalize" feature? I assure you that you cannot magically recover data that does not exist any more. The very best you can do is attempt to approximate that data in some manner.

Yes, it maximizes resolution, but it doesn't add any additional data. For example, as you said, when you go from 16-bit to 32-bit, you don't gain *anything* because you still have the same sample.

If you take something that's only using 12-bits, and you normalize it so that it's full scale 16-bi, you still have the same information (and because you're scaling to a non-integer multiple, you no longer have a lossless copy of the original).
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 11:24:57 PM
Exactly, "normalize" does not add any clarity/fidelity to existing audio signal. It just amplifies/maximizes to its maximum limit based on signal peaks.

The antonym to "normalize" is "compress", which I thought was done at Rockbox pre-cut feature. And then, I realized from your reply that it cut away the insignificant bits of audio signal, which if done at -24db pre-cut, can make the music sounds boring/dull/lifeless.  :'(

Having a highly detailed headphone like MDR-SA5000, the difference between 0db pre-cut & -24db pre-cut is night and day. Also I believe that -24db pre-cut is performed before the audio signal enters Rockbox DSP, and is upsampled from 16bit to 32bit. So yeah, it's 4 bit short - 2^16=65536 vs. 2^12=4096 - and it's substantial.

Thanks for the feedbacks/replies. It really helps me improve my understanding on hi-fi.

Cheers.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 11:28:47 PM
You're still wrong. Compressing an audio signal as a method for reducing the loudness reduces its dynamic range. It is impossible not to. I don't know how I can make this more clear:

You cannot magically make a signal smaller and not lose some of it when working in digital.

If one foot were divided into 16 segments, and then you decided to shrink something down to use only 15/16 of that foot, and you have to use the same size segments still, you then only get to represent it with 15 segments, not 16 any more.

When you compress audio, you're still working with a pre-defined number of bits, so some data will be lost. It's that simple.

As well, in all honesty, a 24db cut at 16-bit vs 32-bit should result in the same number of final bits lost. You're still lowering the volume by the same amount, independent of whether the signal is represented by 16 bits or 32 bits. My example earlier was just that if you were losing 4 bits at 32-bit, those 4-bits would be equivalent to 2 at 16-bit. How much you lose should be in constant ratio, the only real advantage at 32-bit should be that as you have more resolution, is that you have to round less often for operations.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 11:32:04 PM
Umm yeah you are right about that. Sigh, I wish the "compress" was done after 16-bit audio signal is upsampled to 32-bit. The whole notion on pre-cut seems to indicate loss of SQ.

I just wished Rockbox would upscale 16-bit signal to 32-bit signal, then compress it back with -24db.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 11:34:41 PM
You cannot magically *not* lose data.

If you scale to 32-bit, then compress, then decrease to 16-bit, it will be equivalent to compressing at 16-bit. Both lose data. Since this is the only operation you're doing (compression) converting to 32-bit is pointless: You can ensure that the rounding necessary is done in the same way during the compression if you really want to. Working in 32-bit reduces the loss of accuracy when you perform multiple operations because you have more resolution.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Febs on August 07, 2007, 11:38:47 PM
Umm yeah you are right about that. Sigh, I wish the "compress" was done after 16-bit audio signal is upsampled to 32-bit. The whole notion on pre-cut seems to indicate loss of SQ.

I just wished Rockbox would upscale 16-bit signal to 32-bit signal, then compress it back with -24db.

Could you define how you're using the word "compress" here?
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: safetydan on August 07, 2007, 11:43:09 PM
The Rockbox DSP does things in the following order:

1. Receive PCM data from the codecs in whatever format. This is converted to an internal 32-bit fixed point format.
2. Apply a gain to the data. This gain is the combination of the replay gain and the software equalizer precut. All it is is a multiply of each sample of the PCM data.
3. Resample the data.
4. Apply crossfeed if enabled.
5. Apply the software equalizer if enabled.
6. Apply the software tone controls if enabled.
7. Apply channel processing if enabled (mono/stereo/karaoke etc).
8. Clip the samples back down to 16-bit for sending to the DAC.

Not quite sure if I have a point in all that, but I figured I'd try and write up what Rockbox actually does. May or may not be accurate but is based on reading the source.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 11:45:39 PM
Ok I'll just make everything short. Compress is just anti-thesis of normalize. You compress signal from maximum SNR to reduced SNR, while you normalise signal from reduced SNR to maximum SNR.

And here's what happened during audio processing in Rockbox.

Rockbox:

SOURCE 16bit -> -24db precut (4bit) -> DSP 12bit in 32bit -> DAC 12bit in 16bit -> MUFFLED SIGNAL

What I thought originally on first post:

SOURCE 16bit -> DSP 16bit in 32bit -> -24db compress (4bit) -> DSP 16bit in 28bit/32bit -> DAC 16bit in 21bit/24bit -> CLEAN SIGNAL
(Provided there's such function called "compress" and the ADC/DAC accepts 24bit signal)
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 11:47:32 PM
As has been clearly stated by me: lowering the gain by 24db will result in the same amount of lost data whether you do it in 32-bit or 16-bit. As was stated by Dan, the gain adjustment happens after the 32-bit conversion. You're basing the loss of 4-bits on a random statement by one person, and ignoring the mathematical implications. If you increase from 16-bit to 32-bit, the value of bits are changed entirely.

Please, if you want to make a statement as to what is happening, rather than what you mistakenly think is happening, back it up by research. His statement comes straight from the Rockbox source code, for example.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 07, 2007, 11:53:43 PM
I'm not a developer and audio expert in this regard, and I don't know what happened in the inner workings of Rockbox. I'm just trying to figure out everything without good background on those areas (so as to use my Rockbox'ed iPod to maximum potential).  >:(

If you have any recommended settings I can directly use to do so. Let me know.

Peace.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 07, 2007, 11:56:15 PM
It's basic math: If something removes 4 bits at 16-bit, it removes 8 bits at 32-bit. If it also only removed 4 bits at 32-bit, then why couldn't we do it simply by removing 2 bits at 16-bit, and never do the conversion? It's all math, and it's all determinate. If you look at it that way, it's absolutely clear that the same determinate mathematical operation cannot have two different results when applied to the same data, now can it?
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 12:00:36 AM
Of course as I stated on the diagram above, the output will always be some decibels short because Rockbox outputs it on 16-bit audio signal wide to Wolfson DAC.

DIGITAL 16bit -> DSP 16bit on 28bit/32bit -> DAC 14bit on 14bit/16bit (or 12bit, I don't know which one)

As for the signal quality on 32-bit Rockbox internal DSP, there's no depreciation.

If only Rockbox outputs in 24-bit...

Ofcourse, pre-cut on current Rockbox cuts away the 4bit (-24db) of signal data, and I don't intend to use it.

If only Rockbox has normalize/compress algorithm...
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 08, 2007, 12:06:06 AM
If the only operation you're doing in the DSP is the digital gain adjustment, outputting at 24-bit should be no different than 16-bit. Math again.

And I told you already: COMPRESSING IS NOT LOSSLESS.
Mathematically the least you can possible lose is the least significant bit. Please, do some proper research on the audio side, and learn basic math.

Do you know the mathematical difference between "dynamic range compression" and "Reducing the volume"?

And I remind you again, though I already did in PM, that you need to read the rules. This is your last warning on that one.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 12:07:34 AM
I understood everything that Llorean said, and is entirely valid.

What I wrote in the few posts beforehand is my wish that Rockbox could develop this feature in future builds so that to get better sound quality out of iPod.

I did decide not to use pre-cut before (as mentioned in the thread).
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 08, 2007, 12:09:54 AM
I think you don't understand: You cannot magically prevent the loss of data. All you have is a choice of which data will be lost. Why don't you look into what exactly precut does, rather than jumping to a conclusion based on the phrasing a user used, and see and decide for yourself whether that's better or worse than analog volume adjustment.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 12:15:57 AM
Yes I do know the difference.

Dynamic range compression determines the fidelity/clarity/detail of sound, and is related to 16bit/24bit/32bit.

And also, I can get the same quality with any volume as long as I put my ipod line-out on headphone amp.

Just one last question before I bail out of this unconstructive thread ever:
Does Wolfson DAC accepts 24-bit digital signal?

If not, then I'm throwing away everything I know.

If yes, what I am proposing is "reducing the volume" through the use of wide "dynamic range compression" of 32-bit Rockbox DSP.

Therefore I can listen the cleanest signal reproduction iPod can reproduce from my iPod without requiring headphone amp.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Febs on August 08, 2007, 12:20:03 AM
Dynamic range compression determines the fidelity/clarity/detail of sound, and is related to 16bit/24bit/32bit.

You need to go figure out the difference between "dynamic range" and "dynamic range compression."  You're just saying nonsense.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 12:26:03 AM
What's your point anyway. I knew that pre-cut is bad halfway of the thread, and I don't intend to use it.

I'm giving the feedback to Rockbox developers to have a look at, from the satisfied users of Rockbox.

If it's possible to implement, then go ahead.

if it's possible to implement and there's no plan to do it, then I don't mind.

If it's not possible to implement, then I'm fine with it.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 12:30:21 AM
Man, of course I know dynamic range.

And everywhere I see it's about how much detail you put in particular frequency range (coarse definition).

Who doesn't know what it is when every computer/audio store is cluttered with HDR SM3 video card, 24-bit audio cards, SACDs, 24-bit audio DVDs.

Edit: Hmm you guys really don't know what I mean, or you are just pretending you don't know about it for whatever purpose. I have had enough discussion and argument about this point anyway.

Edit 2: I just checked the schematics of iPod DAC, and looks like it does not have any amp, outputting line-out all the time, and uses its DAC to control volume digitally. This means the resultant signal will be compressed.

Edit 3: I just re-checked Wolfson DAC specs on iPod. It says it does 24-bit processing inside its chip. Since 16-bit is fed into Wolfson and upscaled to 24-bit inside,  I did quick calculation to check what level of volume control would be optimal without loss of SQ. Results: anything above -48db or >25% volume control.

I rest my case.

Overall, you guys did amazing job to Rockbox, and grats to Apple for making some right decision.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Febs on August 08, 2007, 12:31:41 AM
Read this:  http://en.wikipedia.org/wiki/Dynamic_range_compression
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Llorean on August 08, 2007, 12:32:39 AM
1) Do proper research in the future. You're talking with people who know what they're talking about. You've admitted you aren't one, and you're arguing a point you don't know the inner workings of.

2) You don't know how Rockbox works, and are apparently unwilling to learn how it does things internally before claiming there are better ways (if you don't know factually how Rockbox does it, it is physically impossible for you to claim there is a better way). Saying "precut sounds bad" doesn't mean you have any clue how it works, other than an assumption you made based on a statement by one person. Go and read it, and please don't post again in this thread about it until you know what exactly our algorithm is doing.

3) You apparently refuse to admit the existence of the transitive property of mathematics.

Please address all these issues before making statements that relate to them.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: preglow on August 08, 2007, 07:01:49 AM
I do not know much about Rockbox internals so correct me if I am wrong.
When you set precut to -24 dB you are approximately "shifting" the original sample value by 4 bits to the less significant bits thus the 4 most significant bits are not used by the original signal anymore. At the final stage before sending the signal to the DAC only the most significant 16 bits are taken (optionally with some information from lower bits by dithering) so in our case only 12 bits from the original signal would be used and the 4 most significant bits will be wasted (zero).
This is basically true, but a bit confused. Let's take MP3, for example, which operates at a 29 bit accuracy. A -24 dB cut will approximately throw away the lowest four bits, and this leaves us with a 25 bit accurate signal, and the 16 highest of these bits is what is passed to the DAC (possibly after further processing). This still leaves us with 9 bits to waste before the output should suffer at all. This is the entire reason we opted to go for a 32 bit DSP path in the first place.
This is of course assuming you do some EQing to boost some bands again. If you just cut -24 dB and do nothing, then yes, the resulting signal will basically be 12 bits thanks to the level being so low overall.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: saratoga on August 08, 2007, 11:34:52 AM

If you just cut -24 dB and do nothing, then yes, the resulting signal will basically be 12 bits thanks to the level being so low overall.

Unfortunately, this is what the original poster wants to do!

Quote from: Andhyka
Edit 2: I just checked the schematics of iPod DAC, and looks like it does not have any amp, outputting line-out all the time, and uses its DAC to control volume digitally. This means the resultant signal will be compressed.

No.  There has to be an amp.  You can't drive headphones off of a logic gate.  

Quote from: Andhyka
Dynamic range compression determines the fidelity/clarity/detail of sound, and is related to 16bit/24bit/32bit.

Dynamic range compression is a type of DSP effect that you can apply to audio.  It is not a metric.  It does not determine anything.  Its not relevant here.

Quote from: Andhyka
And also, I can get the same quality with any volume as long as I put my ipod line-out on headphone amp.

You've said this a few times.  I don't see why it should be true.  

Quote from: Andhyka
Just one last question before I bail out of this unconstructive thread ever:
Does Wolfson DAC accepts 24-bit digital signal?

If not, then I'm throwing away everything I know.

If yes, what I am proposing is "reducing the volume" through the use of wide "dynamic range compression" of 32-bit Rockbox DSP.

Did you read my previous post on this idea?  As I said above, controlling the volume digitally will always reduce the SNR.  Always.  What you are suggesting doesn't make a lot of sense.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 03:05:41 PM
Cheers for all the feedback (although a bit harsh), and I think I've found what I'm looking for. ;D

The reason that I bring all these matters up is because I've got highly detailed headphone MDR-SA5000 and was thinking if it sounds better with imod + headphone amp + dock connector cable.

But ofcourse, this is beyond what I can afford at the moment.

Therefore, I started this whole thread to discuss by proposing that line-out output (100% volume) can still be audible through headphone by feeding 24-bit data signal from Rockbox DSP to DAC (which then I found out this is wholly unnecessary, from you guys).  :)

But as it turns out, the iPod has DAC chip much better than I think, most MP3 players out there. It does 24-bit signal processing in both ADC/DAC filters.

If that is true, digital signal received by DAC will be upscaled from 16-bit to 24-bit, then the volume control will compress/normalise according to the volume level specified.

Thus I can derive that volume level below 100% and above 25% DOES NOT AFFECT the compression of final output.

Don't get me wrong, the Wolfson DAC chip still compresses dynamic range of received signal according to specified volume level but it already upscales the signal to 24-bit internally (16-bit data in 24-bit channel), leaving 8-bit of interpolated fidelity.

Taken from Wolfson WM8393 white paper, 5G iPod Video DAC:
"The digital audio data is converted to oversampled bit streams in the on-chip, true 24-bit digital interpolation filters. The bitstream data enters the multi-bit, sigma-delta DACs, which convert it to high-quality analogue audio signal. The multi-bit DAC architecture reduces high frequency noise and sensitivity to clock jitter. It also uses a Dynamic Element Matching technique for high linearity and low distortion."
http://www.wolfsonmicro.com/uploads/documents/en/WM8983.pdf

I must admit though that my understanding on electrical engineering & audio manipulation are limited, and this matter may seem trivial to you, especially Rockbox developers cos they definitely knew this already years ago.

Reply to saratoga: I think iPod does have an amp but is set at static level (which volume can't be increased or decreased). iPod relies on digital volume on its DAC which results in dynamic range compression (less fidelity/clarity).
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Febs on August 08, 2007, 03:19:25 PM
One more time, since you seem to have great difficulty understanding this concept:  Changing the volume on an ipod DOES NOT RESULT IN DYNAMIC RANGE COMPRESSION.  You are mis-using that term.
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Andhyka on August 08, 2007, 03:28:18 PM
Exactly, it doesn't.  ;)
Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: saratoga on August 08, 2007, 03:35:59 PM
If that is true, digital signal received by DAC will be upscaled from 16-bit to 24-bit, then the volume control will compress/normalise according to the volume level specified.

I've already explained to you why this is not the case.  Are you not reading what people are saying, or do you really not understand what is meant by "analog" and "amplifier"?

Allow me to try again:  normalizatin and compression are not involved.  Volume control is handled purely through analog means using an amplifier.  

Thus I can derive that volume level below 100% and above 25% DOES NOT AFFECT the compression of final output.

This doesn't mean anything.  Its just a collection of nouns and verbs without content or information.

Don't get me wrong, the Wolfson DAC chip still compresses dynamic range of received signal according to specified volume level

More meaningless babble.

but it already upscales the signal to 24-bit internally (16-bit data in 24-bit channel), leaving 8-bit of interpolated fidelity.

Just stop.

I must admit though that my understanding on electrical engineering & audio manipulation are limited,

You don't say.

Reply to saratoga: I think iPod does have an amp but is set at static level (which volume can't be increased or decreased).

You think wrong.

iPod relies on digital volume on its DAC which results in dynamic range compression (less fidelity/clarity).

1)  No
2)  What part of the following sentences did you not understand: "Dynamic range compression is a type of DSP effect that you can apply to audio.  It is not a metric.  It does not determine anything.  Its not relevant here."

Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Febs on August 08, 2007, 03:36:20 PM
"Dynamic range compression" takes all signal above a certain threshold and reduces it by a specified ratio (this is typically called limiting) or takes all signal below a certain threshold and raises it by a specified ratio (this is typically called compression).  So let's say you have  piece of music where the highest peak is at 0 dB, and the lowest part is at -30 dB.  That piece of music would have a dynamic range of 30 dB.  Let's say you apply limiting so that the highest peak in the music is now at -10 dB and the lowest peak is at -20 dB.  THAT is dynamic range compression.  You have changed the music so that there is less of a difference between the highest and the lowest values.  There is now 10 dB of dynamic range in your music.

Now, suppose you take that same piece of music and raise every sample by 10 dB, so that the highest peak is once again at 0 dB.  You haven't changed the dynamic range of the music.  You've simply scaled the volume at every point in the file by a constant.  That is normalisation.

Now, let's say you put that file on your iPod and play it.  You turn down the pre-cut.  Rockbox scales the gain of the file by a constant.  There is still 10 dB of dynamic range in the file itself, but every sample in the file is played back at a lower level.  The effective signal to noise ratio may be lower, but the dynamic range of the music itself is still 10 dB.  The music is not "compressed" by lowering the volume.

Title: Re: -24db Precut Sound Quality on Rockboxxed iPod?
Post by: Bagder on August 08, 2007, 04:54:58 PM
Let me just say that I don't understand half of what you're talking about, but I'm enjoying every single word here.

Go go go! :-)