Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Resampler plugin (Read 500151 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Resampler plugin

Reply #350
Cannot reproduce: everything is ok here.

Just in case: post a list of installed plugins.


Re: Resampler plugin

Reply #352
It's not possible now, and I have no idea is it possible at all.

Re: Resampler plugin

Reply #353
There is interest in adding a SoX resampler to REAPER for both offline and real-time purposes.  First, I would like to understand the differences between libsox (as opposed to libsoxr) and lvqcl's fb2k resampler.  Is the follwing correct?
1. lvqcl has removed code not related to the resampler (rate effect) from libsox.
2. lvqcl has converted the int32 I/O to float32 for compatibility with fb2k.
3. lvqcl adds variants for SSE, SSE2 and SSE3 for optimized CPU usage.

The best choices for REAPER seem to be either libsoxr or lifting code from lvqcl's fb2k resampler.  Since REAPER is a 64-bit audio engine, libsoxr looks best for offline resampling because it support double64 audio through the whole path, while lvqcl's would introduce quantization to float32 in the path.  For real-time resampling/monitoring during mixing or mastering, float32 would be of sufficient quality since the DAC is 24 bits maximum.  How would you compare libsoxr and lvqcl's resampler in terms of CPU usage and latency?

Re: Resampler plugin

Reply #354
How would you compare libsoxr and lvqcl's resampler in terms of CPU usage and latency?

I did try to measure the usage. On a Core2Duo E7200 running at 3GHz, with lvqc's resampler foobar oscillates between 00 and 01 %. Changes once per second. Without the resampler, it does the same, it just flips less often and stays more time on 00 than 01.
My take is that the 'CPU ussage', for a normal PC, is not an issue at all. Probably if you try it on an Atom or a PIII platform to find it different...

Re: Resampler plugin

Reply #355
I can't use WASAPI due to the silent stream bug, which Foobar doesn't work around when doing manual track changes (yet). So I'm stuck using Direct Sound for my HDMI output, which I have set to 48 kHz 24-bit (most of my HTPC usage is TV/video). Is it worth my time using this plugin? How can I actually test whether SoX does a better job of resampling 44.1 kHz music to 48 kHz than my nVidia card? I have a few 96 kHz 24-bit files too - would any problems arise if I set the shared mode to 96 kHz 24-bit instead of 48 kHz 24-bit?

Re: Resampler plugin

Reply #356
You can do a RMAA recording test, playing the testfile from foobar2000 with all replaygain and dsp disabled at volume 100%. Then do the same with the SoX resampler DSP loaded and compare results. When you find differences in the graphs this doesn't have to automatically mean you can actually hear these differences though!
Better would be a blind listening test where you ask someone else to change the resampling without telling you what you're listening to. Best would be using a third option as a reference. This could be another (expected to be far worse) resampler plugin or the SoX resampler with far lower settings.  The other person would randomly choose an order in which to use these 3 options after which you tell him your preference from best to worst. Repeat ~5-10 times and compare results. If there's a clear preference for one of the 2 options you're interested in, this is what objectively sounds best (to you). If it's ~tied between nVidia and SoX, it doesn't matter. The reference should come 3rd (almost) all the time though.

Re: Resampler plugin

Reply #357
Is there any way to use insert command lines like this which has can allow the use of Foobar to replace the digital filter of a DAC:

rate -v -M -b 87.5 38200 dither -S

Re: Resampler plugin

Reply #358
Any chance of conditional resampling depending on the number of channels of the audio track being played?

What I am trying to do is:

- Resample stereo tracks to 24/192.
- Resample multichannel tracks to 24/96.

My HTPC is hooked to a Pioneer SC-LX81 receiver through HDMI. This receiver unconditionally upsamples everything to 24/192, a behaviour that I am trying to avoid by means of what I assume is a better upsampler (SoX) in Foobar. The problem is that the dsp inside the receiver doesn't have enough horsepower to do room & phase correction with multichannel audio at 24/176 and beyond, so it stays at 24/96 in this case.

Any idea?

Thanks!



Re: Resampler plugin

Reply #361
I just tried to convert a 96 kHz file to 44.1 kHz.
The size of the file is over 5 GB and it didn't work.

Where is the limit sizewise and is there any chance to convert a huge file in one go ?

thanks, Pat


Re: Resampler plugin

Reply #363
Great job done with the the resampler! Just wondering, why don't you let the user choose the output bit depth as the original version allows?

I suspect that changing the bitdepth outside of the DSP plugin may produce inferior results compared to doing this along with the resampling within the same plugin...

Re: Resampler plugin

Reply #364
why don't you let the user choose the output bit depth

Because re-quantization happens when passing the audio data to the soundcard. In the case of Direct Sound that's completely outside of any audio player's hands and in case of ASIO/WASPI (exclusive only) the particular output plugin does the work right before the audio data leaves the player.

"I hear it when I see it."

Re: Resampler plugin

Reply #365
I don't agree. Look at this example. Upsampling 44100 (16 bit) to 88200. My DAC supports 32 bits. The SOX plugin works internally on 32 bits of precision. After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter). Then you suggest to change it back to 32 bits using the output filter. There you go: you have your quantization errors. If you allowed SOX to output 32 bits, it would be the best possible scenario in my case.

I know we are talking about very subtle differences.

I can understand the argument about direct sound, but I'm using ASIO output (and I assume most people using the SOX resampler should be aware of the limitations of Direct Sound as they want to achieve best possible quality...). ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.

Re: Resampler plugin

Reply #366
After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter).


It doesn't: it receives 32-bit float and outputs 32-bit float. Then fb2k output plugin reduces bit depth if necessary.

Re: Resampler plugin

Reply #367
I don't agree. [..] Then you suggest to change it back to 32 bits using the output filter. There you go: you have your quantization errors.

This is not a matter of (dis)agreement though. The internal format is 32 bit floating point in foobar2000 and plugins usually receive, process* and output 32 bit data except for some output plugins.
*) Processing is sometimes done using 64 bit floating point.

As I said, quantization is done as late as possible in order to not introduce unnecessary errors.

Quote
ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.

The ASIO output plugin should choose the highest available bit depth (32 bit floating point or signed integer if available, if not 24 bit signed integer and so on..).
"I hear it when I see it."

Re: Resampler plugin

Reply #368
After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter).
...
ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.
And if you don't believe the author of the plugin, using your example of resampling 44.1/16 to 88.2 via ASIO my DAC reports 88.2/24 bits: i.e. the low bits are changing.

Re: Resampler plugin

Reply #369
Ok, ok! Thanks for the additional info!

However, my previous DAC reported 16 bits when played via foobar even though it supported 24 bits (in all modes: KS, ASIO, wasapi). I didn't use any plugins at that time. And with no plugins (and not using volume control), 16 bit output was indeed the best option.

Unfortunately, my new DAC doesn't report anything, so I assumed ASIO feeds it also with 16 bits. I'll try to find a way to check what bit depth is on the output (analyze USB traffic?). Maybe when a plugin is enabled the output switches automatically to higher bit depth?

Re: Resampler plugin

Reply #370
Without plugins you're automatically using Direct Sound. The format is configured in the Windows sound control panel (right click sound tray icon -> playback devices) -> properties of the playback device -> advanced -> default format.

If you resample to 96 kHz for example you should set this to a format with matching sampling rate, for example to "24 bit, 96000 Hz". That way the Windows audio engine will not resample (again).
"I hear it when I see it."

Re: Resampler plugin

Reply #371
"Without plugins" I ment without DSP plugins. As I said, the output was set to either KS, ASIO, wasapi. All gave 16 bits on output for 16 bit files.

Re: Resampler plugin

Reply #372
"Without plugins" I ment without DSP plugins. As I said, the output was set to either KS, ASIO, wasapi. All gave 16 bits on output for 16 bit files.


KS and WASAPI plugins allow you to set the output bit depth. If you set it to 16 bit it's going to be 16 bit.
ASIO, as I said before, should choose the highest supported bit depth automatically.
"I hear it when I see it."

Re: Resampler plugin

Reply #373
KS and WASAPI plugins allow you to set the output bit depth. If you set it to 16 bit it's going to be 16 bit.


That for sure, when set to 16 bit it will output 16 bit. However KS when set to 24 bit worked for me based on the input file bit depth. For 16 bit files: 16 bit, for 24 bit files: 24 bit. That's fine as this plugin is ment to give you bit-perfect playback. I will try to find a way how to verify if this is the same when DSP plugin is enabled and get back to you. I'm thinking of trying http://www.usblyzer.com/ ...

Re: Resampler plugin

Reply #374
I will try to find a way how to verify if this is the same when DSP plugin is enabled and get back to you.  I'm thinking of trying http://www.usblyzer.com/
FWIW On my system using KS and a 44.1/16 track I see 16 bits changing at the DAC, when resampling to 88.2 I see 24 bits changing at 88.2k at the DAC.
When I tried USBlyzer (for another reason) I was annoyed that the only USB audio decoders they support are for USB Audio 1.0.  But raw packets should be find for your purpose.