INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [Feature Requests] Audio Path improvements, DSD to PCM conversions, etc.  (Read 1046 times)

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7771
  • Autumn shade...

I've been engaging in this topic for the last few days, and while doing so I've noticed a few things that could be added/improved in MC to help make things a little easier for users (and a little easier for us when troubleshooting).

The low hanging fruit, aka Audio Path improvements:

I never really convert DSD to PCM as I bitstream it, but during the course of going through that topic, I decided to try it. With MC converting DSD to PCM, I look at the Audio Path... and there's no clear indicator that it's actually converting DSD to PCM that most users would instantly recognize.



As you can see, it just mentions the low-pass filtering being enabled, but no mention of a DSD to PCM conversion happening, even though more technical users can see it is via input and output there.

1) My first request is this, add in the Audio Path that a DSD to PCM conversion is happening. It should say what format the DSD is in, e.g. 1xDSD or DSD64 or 2.8 MHz and what PCM it's converting to, e.g. 352.8 kHz.

DSD to PCM conversion, 1xDSD 2.8 MHz to PCM 352.8 kHz or something like this.

2) To add to number 1, it should also mention what resampler it's using, e.g. SSRC or SoX.

DSD to PCM conversion, 1xDSD 2.8 MHz to PCM 352.8 kHz using SoX or DSD to PCM conversion, 1xDSD 2.8 MHz to PCM 352.8 kHz using SSRC or something like this.

These would definitely would help a lot.


The pipe dreams, aka conversion improvements:

This is the request(s) that may not be doable, but I thought I'd just throw them out here anyways.

1) Have an option to set the PCM sample rate MC should use for DSD to PCM conversions. Right now with mine it's automatically using 352.8 kHz, and the only way to change this is to set in DSP Studio > Output Format > Sample Rate the 352,800 Hz sample rate to output at a different sample rate, e.g. 88,200 Hz. Which then would make it where all 352.8 kHz content is resampled to 88.2 kHz, which is kinda undesirable. Having a dedicated option to override the automatic sample rate used and set a specific PCM sample rate for DSD to PCM conversions can help with trying to workaround issues with CPU bottlenecks when doing the conversions and encountering issues with buffering because it's not fast enough. Not to mention bypassing the two conversions needed (DSD to 352.8 kHz, then again from 352.8 kHz to 88.2 kHz).

2) This is the big iffy one that I almost hesitate posting... have an option to do any DSD to PCM or PCM to DSD (or DSD to DSD) conversions before starting playback. This would hopefully eliminate a) the need for a on-the-fly conversion which on lower power machine may bottleneck and encounter issues with stuttering/buffering and b) eliminate the need to convert the file(s) ahead of time and play that back (and waste space having a playable version of the song on disk). Yes, depending how weak the hardware is this could cause a delay before playback, but it should be an option as long as the user is aware of this. The alternative to this would be having it convert up to 50% of the track before beginning playback, which may or may not also workaround this, depending on what it's decoding and encoding too.

Out of the two pipe dreams here, the first one would make the most sense and I'm sure a good number of users would appreciate this. The second one however, this one probably isn't easy to do at all.

Thoughts?
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

1) Have an option to set the PCM sample rate MC should use for DSD to PCM conversions. Right now with mine it's automatically using 352.8 kHz, and the only way to change this is to set in DSP Studio > Output Format > Sample Rate the 352,800 Hz sample rate to output at a different sample rate, e.g. 88,200 Hz. Which then would make it where all 352.8 kHz content is resampled to 88.2 kHz, which is kinda undesirable. Having a dedicated option to override the automatic sample rate used and set a specific PCM sample rate for DSD to PCM conversions can help with trying to workaround issues with CPU bottlenecks when doing the conversions and encountering issues with buffering because it's not fast enough. Not to mention bypassing the two conversions needed (DSD to 352.8 kHz, then again from 352.8 kHz to 88.2 kHz).

The thing about this is that it does not really work like that. The DSD to PCM decoder always outputs exactly 1/8th the DSD rate, just due to the way DSD conversion works, and after that its just PCM of that sample rate. Any further processing is no different as if you started with a PCM file.
This initial conversion to 1/8th PCM can't be changed, its just inherent to the DSD to PCM process - its also not using any of the two resamplers to do this, its just part of the conversion (this also goes towards the other point about mentioning which resampler is used).

Tracking the "source" of the PCM throughout the app seems like it just opens up a lot of headaches - at what point does it become "normal" PCM, or does it stay "special" PCM for ever? Is there a difference? Why would PCM 352.8 out of a FLAC file resample to something else then PCM 352.8 out of a DSD file? Isn't it both PCM 352.8?
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!

Mine lists "Downsample 8x for DSD to PCM conversion".  Like Hendrik said, we're not using a resampler here.
Logged
Matt Ashland, JRiver Media Center

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097

I agree with 1)

The DSD to PCM sample rate is very confusing. In fact, it ignores the sample rate you put in for >768 KHz in Output Format. I fully understand that the first conversion is to 1/8 of the initial sample rate, but most new users do not know that. So, a 2x DSD (5.6 MHz) gets converted to 705 KHz no matter what the number you put in >768 KHz.  Many users then get an output error, even though they put in something their Dac supports,  like 176 KHz, in Output Format. It really seems like the number you put in >768 KHz should be honored.

In addition, it would be nice to have all the DSD sample rates listed, like all the PCM rates are listed, so that you can put the final sample rate in there and not have to know about this whole 1/8 conversion that is going on behind the scene.

I realize that DSD to PCM conversion is not all that common and this would need some change to the conversion code, but it seems like the end result should follow the sample rate that the user inputs  without having to know about the behind the scene 1/8 conversion process. Most new users simply do not understand the process.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

What if 352 just said "352.800 Hz / DSD 1x", and 704 respectively (and the greater then also include a hint)?

As I outlined above, to MC there is no difference if a file was DSD64 or 352.8 PCM, as the same exact data is coming out of the input reader. Carrying extra "source" information feels iffy to me, rather then just letting the data properties speak for itself.
Logged
~ nevcairiel
~ Author of LAV Filters

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097


As I outlined above, to MC there is no difference if a file was DSD64 or 352.8 PCM, as the same exact data is coming out of the input reader.

Hendrik - You are stating how the internal code works. I understand that. Unfortunately, it does not actually do what the user interface would indicate, which creates a problem for the user. The idea is to change the code to correspond to what the user is expecting from the user interface, and to improve the user interface to cover all DSD sample rates. I understand that is a code change, but the current situation is, at best, confusing, and, at worst, just wrong.  This is a long standing issue.  It really would be nice to get it addressed.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

What about the suggestion to just make it clear in the sample rate box then, so you dont have to know, just to read?

I would rather not redesign parts of the core audio engine only because some UI is confusing, when we can rather just amend the UI. Core changes just add complexity, ambiguity and potential for breakage that doesn't have to exist, and would need to be absolutely warranted.
Logged
~ nevcairiel
~ Author of LAV Filters

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7771
  • Autumn shade...

but it seems like the end result should follow the sample rate that the user inputs  without having to know about the behind the scene 1/8 conversion process. Most new users simply do not understand the process.

And this was kinda getting me too, because I never do DSD to PCM conversions, so I didn't really know about it until I started testing it and noticing things.

For example like the Downsample 8x for DSD to PCM conversion part, in my screenshot above it doesn't say this in Audio Path at all. I assume it's actually doing a DSD to PCM conversion (via the input and output data shown) but it's simply not showing that message in Audio Path? Or is it not supposed to? It's confusing there, as it's only after I use Output Format > Sample Rate to change 352.8 kHz to 88.2 kHz that it finally says Downsample 8x for DSD to PCM conversion in the Audio Path. Shouldn't it always say it regardless if a DSD to PCM conversion is happening? That's what I'm confused about here, having it there would at least indicate there's a DSD to PCM conversion happening. For me, I can tell by looking at the input and output, but for most users they wouldn't have a clue if it's happening looking at it this way.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

You are right, the Downsample 8x thing is only showing up when its also resampling, thats clearly a bug. I'll fix that and also reword it to include the source and destination rate, as per your suggestion.
Logged
~ nevcairiel
~ Author of LAV Filters

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

How about this?



Edit:
Actually I moved it straight to the top of the audio path, as it makes more sense to have the low-pass line below it, and it definitely happens first as well.
Logged
~ nevcairiel
~ Author of LAV Filters

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7771
  • Autumn shade...

Looks great! ;D Thank you very much, that's really going to help when trying to troubleshoot those type of issues in the future with users. ;)

The thing about this is that it does not really work like that. The DSD to PCM decoder always outputs exactly 1/8th the DSD rate, just due to the way DSD conversion works, and after that its just PCM of that sample rate. Any further processing is no different as if you started with a PCM file.
This initial conversion to 1/8th PCM can't be changed, its just inherent to the DSD to PCM process - its also not using any of the two resamplers to do this, its just part of the conversion (this also goes towards the other point about mentioning which resampler is used).

Okay, I understand this now... however, is that what other apps like Audirvana do as well? Because in this post the screenshot the user posted shows Audirvana playing back a DSD512 file by (seemingly) converting it to 88.2 kHz and playing it back while also avoiding the buffering/stuttering on-the-fly conversion issue MC can have with these conversions on less powerful hardware (and the user mentions Colibri avoids this too, though it's not shown what it's doing). I guess what I'm asking is, how do these apps seem to avoid that issue and is there any tricks or anything that can be done in MC to avoid these kind of issues for users who want to do this sort of thing, as it comes up from time to time? I suppose this is where the second pipe dream request comes from, doing the DSD to PCM conversion before starting playback or after X amount of the track is converted.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097

What about the suggestion to just make it clear in the sample rate box then, so you dont have to know, just to read?


That was my next suggestion. An explanation in the Output Format section for >768 would help. Something like

DSD conversion will be done to PCM at 1/8th the original DSD sample rate. To further down sample, please enter the final desired sample rate for each DSD sample rate in the appropriate PCM sample rate above.

And maybe a table showing the DSD rate and the 1/8 conversion value.


Question - for 8x DSD does the final PCM to PCM conversion use the sample rate in the >768 KHz line?

Thanks.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

Okay, I understand this now... however, is that what other apps like Audirvana do as well? Because in this post the screenshot the user posted shows Audirvana playing back a DSD512 file by (seemingly) converting it to 88.2 kHz and playing it back while also avoiding the buffering/stuttering on-the-fly conversion issue MC can have with these conversions on less powerful hardware (and the user mentions Colibri avoids this too, though it's not shown what it's doing). I guess what I'm asking is, is there any tricks to avoid these kind of issues for users who want to do this sort of thing, as it comes up from time to time but it seemingly doesn't happen with other apps? I suppose this is where the second pipe dream request comes from, doing the DSD to PCM conversion before starting playback or after X amount of the track is converted.

Its not fundamentally impossible to write a dsd to pcm decoder that decimates even further straight away, so you arrive at a lower sample rate out of the box. However, the one we use is not setup for that.
Logged
~ nevcairiel
~ Author of LAV Filters

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097

I believe DSD to PCM conversion is not all that CPU intensive. The 1/8 conversion is pretty quick and Sox is pretty quick. I think the real performance issue that people run into is on the fly PCM to DSD conversion.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923

Going to DSD is most definitely far more CPU intensive.
Logged
~ nevcairiel
~ Author of LAV Filters

davewave

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 68

Great topic.

On a related note, it would be great if the conversion from a SACD ISO to individual DSD/DSF files were converted fully as DSD type files instead of being converted to PCM and then back to DSD file types.

By way, I always thought that when converting DSD to PCM it is a good idea to leave the sampling rate below 100khz.  As I understand it, DSD moves some analog conversion artifacts to the 100 khz and above range.   So there is some residual non musical noise at those higher frequencies.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097


By way, I always thought that when converting DSD to PCM it is a good idea to leave the sampling rate below 100khz.  As I understand it, DSD moves some analog conversion artifacts to the 100 khz and above range.   So there is some residual non musical noise at those higher frequencies.

There are several options for filters to remove the high frequency noise.  Any of them will remove the noise. It is a personal choice as to which one you use. The Safe filter is the default I believe. Unless you turn the option off you should not have any problems. Audio Path should show you what filter is active.

Tools - Options - Audio - Advanced - Configure Input Plugin - DSD

Logged
Pages: [1]   Go Up