MPD decoding HDCD format?

General Discussion about MPD – anything that doesn't fit in the other MPD forums.
Post Reply
111MilesToGo
Posts: 6
Joined: March 7th, 2018, 11:00 am

MPD decoding HDCD format?

Post by 111MilesToGo » March 10th, 2018, 10:04 am

I would like to know whether and how MPD handles (decodes) the HDCD format. You know, that Pacific Microsonics then Microsoft stuff encoding 20 bits into the 16 bits of a CD at 44.1 kHz (PE, LLE, TF).

Coming from Windows, the consensus best practice is to rip HDCDs as-is to 16/44.1 FLAC via dBpoweramp, then leave it to the audio player (foobar2000 with HDCD component) to decode.

So what about MPD, both for said FLACs from hard disk as well as for replaying an HDCD from the optical drive?

PS: I read that ffmpeg incorporates an HDCD decoder.

max
Forum team
Posts: 801
Joined: January 15th, 2013, 3:43 pm

Re: MPD decoding HDCD format?

Post by max » March 10th, 2018, 1:07 pm

No, MPD doesn't support this format.

jast
Forum team
Posts: 18
Joined: January 15th, 2013, 4:03 pm
Location: Germany
Contact:

Re: MPD decoding HDCD format?

Post by jast » March 11th, 2018, 10:45 am

It does support FLAC, though. :)

111MilesToGo
Posts: 6
Joined: March 7th, 2018, 11:00 am

Re: MPD decoding HDCD format?

Post by 111MilesToGo » June 21st, 2018, 3:29 pm

Please allow me to return to the HDCD question, even though HDCD is something like an enigma and a scam... (both quotes from the web).

The HDCD patent was issued in 1997 (to Pacific Microsonics). It has expired in 2017, at least according to all information on the web. Thus it should no longer be protected. I did understand MPD was not to be endangered in any way by including copyright-protected items, but AFAIK this no longer holds for HDCD.

So, please, let me ask you, Max: Please reconsider putting an HDCD decoder into MPD. I did read ffmpeg has such a module, and there is the original hdcd.exe that was reverse-engineered from Windows Media Player. I have read a huge number of web publications on HDCD, and I understand it is something quite awful. But I feel HDCD today still is one of the big "white spots" on the MPD landscape.

Remark: As I said above, there is a good number of HDCD discs out there (e.g. the entire Grateful Dead reissue catalog since many years). Best practice for ripping with dBpoweramp is to rip such discs as-is, without decoding, thus preserving the original AccurateRip checksum for future checks. Yes, on could afterwards convert all such 16/44.1 HDCD rips with dBpoweramp Music Converter to 24/44.1 (it uses hdcd.exe). However, this would store HDCDs twice on one's hard disk, wasting space. In the age of hi-res audio downloading, hard disk space is becoming precious again.

max
Forum team
Posts: 801
Joined: January 15th, 2013, 3:43 pm

Re: MPD decoding HDCD format?

Post by max » June 21st, 2018, 3:52 pm

If FFmpeg can decode it, then MPD can decode it as well. It only needs to be told to direct HDCD files to the FFmpeg decoder plugin. Probably here: https://github.com/MusicPlayerDaemon/MP ... n.cxx#L889
Send a pull request when you're done.

There's nothing for me to consider, because nobody submitted any code to me.

111MilesToGo
Posts: 6
Joined: March 7th, 2018, 11:00 am

Re: MPD decoding HDCD format?

Post by 111MilesToGo » June 22nd, 2018, 2:22 pm

Sorry, dear Max, pls let me mention:

(1) HDCD facts:

At the beginning of this thread, you stated MPD doesn't detect HDCD in 16/44.1 PCM and doesn't decode it. I would NOT know how ffmpeg does that, but from reading on the web I think it can.
max wrote:
June 21st, 2018, 3:52 pm
It only needs to be told to direct HDCD files to the FFmpeg decoder plugin.
There is no such thing as an HDCD file, only 16/44.1 PCM files in whatever coding was selected (FLAC, WAV, etc).

On Windows, foobar2000 does decode HDCD within 16/44.1 PCM "on-the-fly" via a plugin (component), and - quite important - it lets you put the technical details (PE, LLRE, TF) into the status line. dBpoweramp can do "off-line" conversion from 16.4/44.1 to 20/44.1 using the hdcd.exe reverse-engineered tool.

(2) My capabilitites are non-existent:
max wrote:
June 21st, 2018, 3:52 pm
Send a pull request when you're done.
Unfortunately, it is over my head, knowledge and time to go into the MPD source code myself and try to figure out what would have to be done to let MPD look at a 16/44.1 PCM stream from a CD/FLAC/whatever and detect the bit pattern that would announce embedded HDCD codings. I am awfully sorry for that.

(3) What now?
max wrote:
June 21st, 2018, 3:52 pm
There's nothing for me to consider, because nobody submitted any code to me.
Please, what would you recommend now? Post a feature request on the github MPD site and find voluntary help from the project community? I see that you yourself do a considerable portion of the posts at github. Maybe I didn't understand your role yet, maintainer for MPD, or an active developer, or both at the same time.

max
Forum team
Posts: 801
Joined: January 15th, 2013, 3:43 pm

Re: MPD decoding HDCD format?

Post by max » June 22nd, 2018, 5:24 pm

I personally have no interest in this bullshit codec, and I have no interest in adding support for this "feature" to MPD.

If anybody wants a feature, he can either write code and send it to me, or convince me (or somebody else) to write it. The latter won't happen with HDCD, because, as I said, it's bullshit, and I don't like wasting my free time with bullshit features, sorry.
But maybe you can find somebody else to do it and send code to me.

This is how open source works. If you don't like that principle, don't use it. Or don't use MPD if you don't like that one of its developers considers HDCD bullshit. Whatever. It's your freedom.

skidoo
Posts: 151
Joined: April 28th, 2013, 10:06 pm
Location: Western Germany

Re: MPD decoding HDCD format?

Post by skidoo » June 23rd, 2018, 11:48 am

Why not converting HDCD to plain PCM or FLAC with ffmpeg?

On the other hand MPD goes mobile with its Android flavour and ffmpeg offers some filters - eg crossfeed - for headphone users. But I guess 111milestogo would prefer a HDCD filter.

Tappit
Posts: 8
Joined: August 3rd, 2018, 8:03 pm

Re: MPD decoding HDCD format?

Post by Tappit » August 3rd, 2018, 8:58 pm

So far as the player is concerned, there is no difference between HDCD and CD. The dither applied to the LSB of an HDCD has a pattern to it which can be recognised and used to make mysterious adjustments to the HDCD filter in the player, if it has one. Whether these functions were ever actually implemented seems open to doubt, but if a PM converter was used to master the CD it means that the studio cared enough to use the best converter available, so the CD probably sounds better than average in any case. Use of the PM converter activates the HDCD indicator pin of the filter chip, so it is a good way to check that your output is bit perfect but does not mean the CD actually has any HDCD enhancements.

Ripping to a flac file does not alter the LSB pattern so, if you have an HDCD DAC, the light will still come on.

Post Reply