Author Topic: HDCD decoding  (Read 56221 times)

boroda

  • Sr. Member
  • ****
  • Posts: 4595

Otto Kerner

  • Guest
First let me say I greatly appreciate your effort for publishing this plugin.

While trying this out, however I stumbled upon a snag:
It seems to me, that it doesn't provide a greater bit-depth than 16bit. And HDCD was invented in the first place to extend the 16bit depth of the original CD specification!

How can I say so, you ask?
Well, I use a sound interface which comes with a rather nice set of tools for measurements and analysis of audio signals.
http://www.rme-audio.de/img/techinfo/digicheck/bitstat.gif
http://www.rme-audio.de/techinfo/digich.htm
(This software can only be used with RME sound interfaces, so don't bother to download it if you don't have one of their products.)

Among these measurement tools is a display of the used bits for the actual played audio. This tool now displays that only 16 bits are used when I'm playing a FLAC file ripped from HDCD disc.
I am using the ASIO driver and I did maximise the volume slider, otherwise this measurement would not be possible since the volume adjustment changes the bit depth to 32 bit too if set to anything lower than 100%.

Of course I compared the readings of my instrument with other files, too see if my conclusions are correct.
I tested a FLAC ripped from a regular CD which gave the expected 16 bit reading.
Then I decoded my HDCD rip with eac3to.exe to a 24bit file and played that back. The reading for this was 32 bit.
Then I tested again the HDCD flac and it said 16 bit. Though in the status bar it said "HDCD active, Peak extension activated"!
In the preferences of MusicBee I checked "32bit playback" of course.

All of the files were checked with Winamp and ASIO output plugin too.

Conclusion: apparently the plugin fails to activate an output stream wider than 16 bit and such fails to fulfill its very purpose.
I don't have any idea if the plugin or MuscBee itself is to blame for this.

Addditionally, when the playlist advances from one HDCD file to the next, the "HDCD" display in the status bar vanishes. It reappears when playback is manually stopped and restarted though.
Last Edit: November 21, 2013, 02:56:12 PM by Otto Kerner

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
the plugin is based on the same library used for the foobar HDCD plugin written by Kode54 on the hydrogenaudio forum.
If you have the same results on foobar then i suggest you contact him and let him know all the users of his library are not getting the benefit they believe they are getting.
If it works as expected in foobar but not musicbee then let me know but i probably wont do anything about it unless something has been changed so that its not decoding the sound data, although i am doubtful that is case if it is reporting peak-extensions are detected.
From my own tests i recall the sound adjustments were fairly small and on the quieter parts of the sound data for the files i tested.


Otto Kerner

  • Guest
I must apologize for jumping to conclusions. The plugin itself works fine.
Sorry!

The snag shows only when replaygain is active at the same time. Once deactivated, the reading shows the expected 17 to 20 bit which is achievable on a HDCD.

So, the problem is a combination of this HDCD decoder and replaygain. Do you know if there is a possibility to automatically switch off replaygain when the HDCD decoder works? The replaygain value that is stored in the file is only valid for the UNdecoded file anyway and thus cannot be used sensibly with the decoded audio.
Last Edit: November 21, 2013, 03:36:49 PM by Otto Kerner

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i have made a change to the next update for MusicBee v2.3 as it was applying the HDCD decoding after replay gain adjustments which as you report wouldnt decode as HDCD. I will post a link later

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
this is the updated HDCD.dll so when replay gain is enabled it shouldnt intefere with the HDCD decoding:
http://www.mediafire.com/download/dm9cl2xewcc4g91/HDCD.zip

and you will need to new MusicBee v2.3:
http://musicbee.niblseed.com/V2_3/MusicBee_Exe_Patched.zip

Otto Kerner

  • Guest
Thank you for your prompt response!
The updated version now uses all 32 bits while playing back HDCD audio with replaygain activated.

However, as I wrote in my last post, the replaygain value that is stored in the file is only valid for the UNdecoded file anyway and thus cannot be used sensibly with the decoded audio.
This is due to the way HDCD encoding works and that the encoded audio is still playable on normal CD players without HDCD decoder. When playing back undecoded HDCD audio the effect can be compared to applying a dynamic compression. Thus undecoded HDCD audio sounds much louder than decoded. And the undecoded audio is what is used for calculating the replaygain value!

Consequently when we play back our DECODED audio and additionally apply the replaygain value, the resulting output volume is way too low.
That's why I asked for a simple deactivation of replaygain since it yields a better result.

Unfortunately there is also no simple volume raising factor which one could apply uniformly after the HDCD decoding process. This is again due to the way the HDCD encoding works. The effective amount of dynamics compression that results from the HDCD encoding process depends on the source material and is different for every single song.

So in theory for a replaygain that works perfectly, we would need TWO replaygain values:
- one for the undecoded audio to keep the file compatible with non HDCD-aware players
and
- a second one for our HDCD decoder
Since this is not practical, IMHO the best solution is to automatically deactivate replaygain altogether when the HDCD decoder is processing audio.

Altough I wrote earlier there is no uniformly appliable volume correction factor for this:
Nonetheless, one could maybe add an option for a selectable fixed volume boost after the HDCD decoding.
This could compensate a little bit the loss of "loudness" due to the HDCD decoding, Practical values range between +3dB and +6dB. More would result in digital clipping.
The foobar module does provide some options for this, but it also doesn't work perfectly in conjunction with replaygain.
Last Edit: November 21, 2013, 11:29:50 PM by Otto Kerner

jimmanningjr

  • Jr. Member
  • **
  • Posts: 87
 ;D ;D ;D ;D ;D ;D ;D ;D I requested this feature about 3 years ago....I have been busy so i missed when you First enabled this plugin....(95% of all my live and studio Grateful Dead has HDCD encoding plus many other CDs like the Doors...and many more I have the COMPLETE EUROPE 1972 Box which is like 76 disc's all HDCD encoded) Thank You Steven you are the Best...I recommend MUSICBEE to anyone that will listen!!!Thanx again bro !!! Have a grate YEAR!!!!

Ricky Roma

  • Jr. Member
  • **
  • Posts: 31
My CDs have been ripped to 16bit FLAC using dbpoweramp.
When I playback some files ripped from HDCDs, some indicate "HDCD Active" (eg Roxy Music - Country Life) whereas others don't seem to detect it at all (eg Neil Young - Mirrorball). Is this a ripping error on my part or are some HDCD's not easily detected?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312

superstar19

  • Jr. Member
  • **
  • Posts: 60
I've been using this plug-in for a while now, but I just noticed that the status bar only displays "HDCD" for the first track.   When the player goes to the next track, "HDCD" disappears.   If I double click on the 2nd track to start playback again, the "HDCD" is displayed, but then disappears when it advances to the next track.  Is this how the plugin is supposed to work? Not a big deal as it really doesn't affect actual music playback, but I just thought it was odd that it won't stay displayed.  These are CD-ripped FLAC files that I am playing back.

IEMUser

  • Newbie
  • *
  • Posts: 2
As others have mentioned, the HDCD indicator disappears when MusicBee starts playing the next track, and I have confirmed that the a HDCD decoding also stops functioning when the indicator disappears. I confirmed this simply by listening; when the HDCD indicator disappears upon start of the next track, there is a noticeable increase in the noise floor as well as in increase in overall level.

As mentioned by others, you can simply double-click on the track to re-display the indicator, and this (as one might expect) also re-enables the HDCD decoding, which is obvious because the noise floor drops and the overall level decreases.

So this clearly seems to be a bug in MusicBee, but at least for me, it's not a big deal because I just rip HDCD encoded CDs with the HDCD option ticked (I rip to FLAC). This creates a 24-bit file with HDCD already decoded in the file, so you don't need the HDCD plugin to hear the benefits of HDCD.  Be warned that you will likely see a message indicating that the rip does not match accuaterip submissions, but this is only because no one has submitted a 24-bit rip to accuraterip. You can ignore or turn off accurateziip when using the HDCD option when ripping.

As a bonus, you can listen to the 24-bit file on an external device/player (I use my smartphone with Google Play Music or MX Player) without the need for HDCD decoding on the external player. This is allows you to realize the full potential of an HDCD even if you don't have a player that can decode HDCD.  The difference is quite obvious; when comparing the sound of the 24-bit file against the 16-bit (HDCD encoded) version using a player that does not decode HDCD (i.e. Google Play Music and MX Player), the noise floor is noticeably lower and the overall sound is significantly less ragged on the 24-bit file.

Of course if you only have 16-bit (HDCD encoded) files and not the source CD, you won't be able convert the files to 24-bit versions with HDCD decoded.  In this case, the HDCD plugin must be used to decode HDCD-encoded files and it would be nice to get the bug fixed for this use case.

superstar19

  • Jr. Member
  • **
  • Posts: 60
Great info!  Thanks for the reply.  I didn't realize the decoding was also turning off.  Thought it was just a display issue.   Not a big deal at this time, as I am slowly trying to upgrade my system so that I can output my PC music to home audio system rather than the PC speakers.

As for the 24-bit ripping, I still have all my HDCD discs, but I don't have a ton of motivation to go back and re-rip them @ 24 bits (my collection includes just about everything the Grateful Dead have released on CD).

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
I've been using this plug-in for a while now, but I just noticed that the status bar only displays "HDCD" for the first track.   When the player goes to the next track, "HDCD" disappears.   If I double click on the 2nd track to start playback again, the "HDCD" is displayed, but then disappears when it advances to the next track.  Is this how the plugin is supposed to work? Not a big deal as it really doesn't affect actual music playback, but I just thought it was odd that it won't stay displayed.  These are CD-ripped FLAC files that I am playing back.
does this version of musicbee.exe address the reported issue? I expect i would only happen for WASPI and ASIO output modes
http://musicbee.niblseed.com/V2_5/MusicBee_Exe_Patched.zip
unzip and replace the existing musicbee files

superstar19

  • Jr. Member
  • **
  • Posts: 60
does this version of musicbee.exe address the reported issue? I expect i would only happen for WASPI and ASIO output modes
http://musicbee.niblseed.com/V2_5/MusicBee_Exe_Patched.zip
unzip and replace the existing musicbee files
That seems to have done the trick!  Yes, I am using ASIO output mode, but I believe when I originally posted that question, I was still using the onboard Realtek/Directsound option feeding my PC speakers.