getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: Steven on August 25, 2012, 09:42:43 AM

Title: HDCD decoding
Post by: Steven on August 25, 2012, 09:42:43 AM
I have created a DSP plugin that can decode HDCD encoded files. It is based on the HDCD decoder provided by the author of the foobar HDCD decoder (kode54).
When this plugin is enabled, and a HDCD encoded file (including HDCD encoded files that have been converted to a lossess format like FLAC or ALAC, WMA Lossless, but not TAK) will be decoded on-the-fly. The MusicBee status bar will show when a HDCD file is being decoded- if the file has peak-extensions enabled then that will show in the status message

1. The plugin itself should be placed in the MusicBee Plugins folder
https://getmusicbee.com/download/plugins/mb_hdcd.zip
2. enable the plugin, either from the Equaliser and DSP window, or Preferences/ Player/ Equaliser & DSP

To enable HDCD decoding when ripping a CD:
https://getmusicbee.com/download/plugins/hdcd_ripping.zip
unzip into the MusicBee application folder
Title: Re: HDCD decoding
Post by: butty on August 25, 2012, 10:51:46 AM
Great! Thanks! :D
Title: Re: HDCD decoding
Post by: superstar19 on September 07, 2012, 01:43:57 AM
Thanks.  Unfortunately, my setup probably isn't optimized to take full advantage, but I have several HDCD encoded Grateful Dead discs so I'll give this a try.
Title: Re: HDCD decoding
Post by: p-mob on June 22, 2013, 10:29:32 AM
Hi Steven.
Do the actual (beta)versions of MB support HDCD direct, without using this patch?
I have some FLAC-HDCDs in my collection. Would be nice to use them, as they were thought to be used.
Thanks!
Title: Re: HDCD decoding
Post by: Steven on June 22, 2013, 10:51:49 AM
you only need the plugin. I have updated the instructions
Title: Re: HDCD decoding
Post by: p-mob on June 22, 2013, 11:05:43 AM
Thanks a lot!
 ;D
Title: Re: HDCD decoding
Post by: p-mob on June 22, 2013, 11:33:11 AM
Another question:
The plugin is active, and I have done some FLAC 24 Bit Rips with MB.
But on playback MB does not show anything HDCD related.
MB Version ist latest 2.1 Pre. HDCD plugin is set active.
Title: Re: HDCD decoding
Post by: Steven on June 22, 2013, 12:07:36 PM
if its 24bits then its already decoded and nothing for the plugin to do
Title: Re: HDCD decoding
Post by: p-mob on June 22, 2013, 12:16:54 PM
Now i got it.
That means, it has to be decoded as 16Bit without the option for HDCD, right?
Title: Re: HDCD decoding
Post by: Steven on June 22, 2013, 02:20:23 PM
yes - if you rip a HDCD disc without the HDCD option ticked, then the plugin will detect and decode as HDCD (if detected)
Title: Re: HDCD decoding
Post by: p-mob on June 23, 2013, 10:18:39 AM
But:
If I rip a HDCD with the option ticked (24Bit) i get a error for every track.
Title: Re: HDCD decoding
Post by: Steven on June 23, 2013, 11:35:10 AM
For the error, you would need to provide more details such as what the error says and if there is anything in the error log around the time you do the rip (help/ support/ view error log).
If the disc really is a HDCD disc, it should not matter whether you tick the HDCD option or not - it should still be ripped without error, but if the option is ticked then it will be decoded to 24 bits with the HDCD sound enhancements already applied. If you have acccurate rip checking enabled i expect it would fail to make an accurate rip match.
Title: Re: HDCD decoding
Post by: p-mob on June 23, 2013, 12:21:13 PM
The error log does not contain anything regarding the error messages when ripping a HDCD with 24Bit.
The ripped FLAC works fine, but You are right, AccurateRip fails.
The disc was 100% a HDCD (Dire Straits - Sultans of Swing: The Very Best of Dire Straits).
HDCD was printed on disc and cover.
I did this test with another HDCD i have, and it gives the same result.
Title: Re: HDCD decoding
Post by: Steven on June 23, 2013, 12:32:59 PM
accrurate rip will only make a match if other people have submitted results HDCD decoded to 24 bits.
Title: Re: HDCD decoding
Post by: p-mob on June 23, 2013, 12:40:29 PM
You are right. The errormessages came from using AccurateRip.
I deactivated it, and all errors are gone.
Nice to know.
Thanks!
Title: Re: HDCD decoding
Post by: boroda on June 26, 2013, 07:55:55 AM
Here is plugin's wiki page (http://musicbee.wikia.com/wiki/HDCD_Decoding). Please update it if plugin is updated.
Title: Re: HDCD decoding
Post by: Otto Kerner on November 21, 2013, 02:29:36 PM
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.
Title: Re: HDCD decoding
Post by: Steven on November 21, 2013, 03:00:21 PM
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.

Title: Re: HDCD decoding
Post by: Otto Kerner on November 21, 2013, 03:19:44 PM
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.
Title: Re: HDCD decoding
Post by: Steven on November 21, 2013, 05:36:59 PM
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
Title: Re: HDCD decoding
Post by: Steven on November 21, 2013, 09:12:31 PM
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
Title: Re: HDCD decoding
Post by: Otto Kerner on November 21, 2013, 11:01:41 PM
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.
Title: Re: HDCD decoding
Post by: jimmanningjr on February 06, 2014, 09:56:15 PM
 ;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!!!!
Title: Re: HDCD decoding
Post by: Ricky Roma on April 11, 2014, 01:38:08 PM
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?
Title: Re: HDCD decoding
Post by: Steven on April 11, 2014, 05:27:43 PM
see reply #17
Title: Re: HDCD decoding
Post by: superstar19 on February 12, 2015, 05:50:59 PM
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.
Title: Re: HDCD decoding
Post by: IEMUser on February 19, 2015, 08:52:05 PM
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.
Title: Re: HDCD decoding
Post by: superstar19 on February 25, 2015, 06:18:00 PM
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).
Title: Re: HDCD decoding
Post by: Steven on July 18, 2015, 03:46:20 PM
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
Title: Re: HDCD decoding
Post by: superstar19 on July 21, 2015, 02:51:50 AM
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.
Title: Re: HDCD decoding
Post by: superstar19 on July 21, 2015, 02:57:49 AM
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).
Since posting this, I have discovered that CUEtools will do the "24-bit" HDCD decoding to already ripped HDCD encoded FLAC files so you don't necessarily have to pull out your actual CDs if you've already ripped 'em once.
Title: Re: HDCD decoding
Post by: Steven on July 21, 2015, 08:39:18 AM
you can do the same when ripping with musicbee
Title: Re: HDCD decoding
Post by: superstar19 on July 21, 2015, 06:08:52 PM
you can do the same when ripping with musicbee

Oh wow, thanks.  Didn't realize that.  I'll have to give that a try.
Title: Re: HDCD decoding
Post by: AaronM on May 20, 2020, 09:03:26 PM
Is there an updated version of this plugin? I keep getting errors when trying to import it.

(https://i.imgur.com/JGzU6q2.png)

I'm on version 3.3.7367 (Windows, not the Store version)
Title: Re: HDCD decoding
Post by: phred on May 20, 2020, 09:37:28 PM
Is there an updated version of this plugin? I keep getting errors when trying to import it.
What are you trying to import? Please read the installation/use instructions in the first post
Title: Re: HDCD decoding
Post by: Steven on May 20, 2020, 10:30:32 PM
try using the non-store version of musicbee
Title: Re: HDCD decoding
Post by: djony on January 07, 2021, 05:44:04 AM
I have the same problem too that HDCD plugin will not work anymore in Windows 10 20H2. Perhaps some issue with Visual C runtime that this plugin was compiled long time ago with older runtime.
Title: Re: HDCD decoding
Post by: captain_paranoia on March 02, 2021, 01:01:56 PM
Just to clarify for the couple of people who are struggling to install this plugin (me included..)

It DOES NOT install via the Preferences/Plugins/Add Plugin dialogue.
(that was my problem: installing on a new PC, and over-familiarity of that dialogue, and not RTFM...)

RTFM on the first page:
1. Unzip HDCD.zip to put HDCD.dll into the Plugins folder
2. Go to Preferences/Player
3. Press the 'Equaliser & DSP' button
4. Tick the 'HDCD Decoder' in the 'DSP Plugins' section of the dialogue

HDCD tracks will now trigger the HDCD plugin to expand to 20bits
Title: Re: HDCD decoding
Post by: djony on May 25, 2022, 07:01:58 AM
Still can't work and I have tried manually put the dll into the plugins directory. From edit preferences and then plugins, this plugin will not show unless the dll name is renamed to mb_hdcd.dll and the status is disabled because it can't be initialized
Title: Re: HDCD decoding
Post by: Steven on May 25, 2022, 08:14:26 AM
put hdcd.dll in the plugins folder
on starting MB, tick HDCD in the equaliser & dsp dialog to activate it
Title: Re: HDCD decoding
Post by: iandrew on December 22, 2022, 02:24:38 PM
The HDCD indication is not available when the wave bar option is used for the progress bar. Hope this can be fixed!

(https://i.imgur.com/fN8YAWr.png)

(https://i.imgur.com/AEDGdGX.png)
Title: Re: HDCD decoding
Post by: jimmanningjr on January 14, 2023, 03:26:30 PM
Good Morning Steven,
I have been using  MusicBee for over a decade now. I was one of the people who requested this HDCD plug in.
Every system I've had I have installed MusicBee and this plug in. Took some work but I always got this plug in to work.
UNTIL NOW! I have followed this forum and followed all advice concerning installing and using MusicBee and this HDCD plug in.
I have a brand new TrigKey S3 14gigs ram 500gigs storage with Windows 11 pro.....
Any suggestions?
The first time I had this problem ..I downloaded a Patched version of MB, and that did the trick...
Perhaps a similar fix is required
Title: Re: HDCD decoding
Post by: sveakul on January 14, 2023, 04:32:02 PM
The first time I had this problem ..I downloaded a Patched version of MB, and that did the trick...
Perhaps a similar fix is required
You didn't say what version of MB you are using.  The 3.5 RC3 full versions are available here: https://getmusicbee.com/forum/index.php?topic=36464.msg208192#msg208192 (https://getmusicbee.com/forum/index.php?topic=36464.msg208192#msg208192)

There are patched versions of MusicBee uploaded about weekly: https://getmusicbee.com/patches/MusicBee35_Patched.zip (https://getmusicbee.com/patches/MusicBee35_Patched.zip)

If you have the "Store" version of MusicBee it cannot be patched.
Title: Re: HDCD decoding
Post by: phred on January 14, 2023, 06:15:25 PM
Adding to sveakul's comment... any new features, bug fixes, and changes in one patch are included in new patches and full version releases.
Title: Re: HDCD decoding
Post by: jimmanningjr on January 19, 2023, 10:16:18 PM
The first time I had this problem ..I downloaded a Patched version of MB, and that did the trick...
Perhaps a similar fix is required
You didn't say what version of MB you are using.  The 3.5 RC3 full versions are available here: https://getmusicbee.com/forum/index.php?topic=36464.msg208192#msg208192 (https://getmusicbee.com/forum/index.php?topic=36464.msg208192#msg208192)

There are patched versions of MusicBee uploaded about weekly: https://getmusicbee.com/patches/MusicBee35_Patched.zip (https://getmusicbee.com/patches/MusicBee35_Patched.zip)

If you have the "Store" version of MusicBee it cannot be patched.
I have been running the 3.5 version of Music bee...also the above patch did not do the trick this time.
Title: Re: HDCD decoding
Post by: sveakul on January 19, 2023, 11:08:15 PM
If you have the "Store" version of MusicBee it cannot be patched.
I have been running the 3.5 version of Music bee...also the above patch did not do the trick this time.
There are 3 different versions/types of 3.5.x MusicBee--the Installer, Portable, and Store versions.  In the Help/About dialog there is an abbreviation after the version number that says what type you have.
Title: Re: HDCD decoding
Post by: jimmanningjr on January 20, 2023, 12:11:09 AM
If you have the "Store" version of MusicBee it cannot be patched.
I have been running the 3.5 version of Music bee...also the above patch did not do the trick this time.
There are 3 different versions/types of 3.5.x MusicBee--the Installer, Portable, and Store versions.  In the Help/About dialog there is an abbreviation after the version number that says what type you have.
HERE IT IS: 3.5.8419
Title: Re: HDCD decoding
Post by: iandrew on November 04, 2023, 01:47:17 PM
I upgraded to the latest MusicBee 3.5.8698 Installer Edition and HDCD decoding has stopped working. The HDCD active message does not show on the status bar and the output remains at 16 bit (checked using Bitter VST plugin). This is in an album that was correctly decoded as HDCD earlier. Every time MusicBee is started the HDCD decoder is OFF in the DSP options even though I turn it back ON. It remembers the rest of the plugin settings. Is MusicBee failing to turn ON the plugin?