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: I have developed an OpenCL based resampler for foobar2000 v 1.x (Read 8503 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I have developed an OpenCL based resampler for foobar2000 v 1.x

This is based on the basic framework of SoX program. I removed the whole SoX algorithm and implemted mine.
My algorithm is very simple. I use the ideal interpolation function (sinc) to caculate the new sampling point and blackman window function to truncate the input sequence. My algorithm is not table based. Because table based method usually needs linear interpolation to get the coefficient that does not fall under the table index. So, my algorithm caculates the sinc function at each time required. The computing overhead can be amortised by the powerful GPU computing. So, I use CUDA to accelarating the conversion progress. The feature is shown below:

Currently, this resampler only support 44->48 for it's just a test program about CUDA acceleration in foobar2000.
The CPU usage is under 6%
the THD distortion is under 0.0005%
the IMD distortion is under 0.0041%
The frequency response is almost a straight line with vibrating less than 0.01db.
The transition band is about 4KHz.
I am working on optimization and debug now.


I am from china main land. So, my english expresion may not be good enough to express my point. If you have any questions, please email me.

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #1
Sounds great! As soon as more sample rates are implemented I will give it a try.

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #2
CUDA...I thought there was delays when calculating info on the GPU. Or am I mistaken?

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #3
First, how can I add a attachment for this topic? I am a fresh man here. Thanks.

This reampler is developed based on the framework of resampler for foobar2000(SoX). I remove the ratelib and the RR_XXX function by adding my resampling algorithm. My algorthm's theories are all from my textbook-(Discrete Time Signal Processing and the web site of digital audio resampling of stanford university). I use the basic band-limited interpolation and the interpolation filter's cutoff frequency is adjusted when doing downsampling to prevent aliasing. Curently, each output sample is caculating by 128 samples. I will make the number of samples needed to caculate a output sample be a adjustable parameter recently. This code is compiled by nVidia's opencl library and it's compitable with AMD's Radeon Card with the newest APP driver.

This version is a pure GPU accelerated one and can only work with nvidia and amd's card.
I tested the GTX480 and HD5870, it works! So, you need a GTX460 or HD5850 or better GPU card.

The cpu occupancy is less than 3% with AMD 965+HD5870.


Installation:
1.open foobar and install the foo_resampler.dll
2.copy the kernel.cl to your D drive's root directory.
PS:you may need the latest nvidia or AMD's opencl driver!

configuration:
I do not modify the origial framework, so the phase and passband option don't work. You can only adjust the output sample rate.
Please note! It currently only support 2 channel audio format!!!


Modification:
the kernel.cl contains the kernel algorithm of my basic and urgly code, you can modify it directly and it will be compiled in the runtime. And the full code I will release in a few weeks for I am leaving my school and I would not have a opencl compitable GPU until july.

Basic Performance of 44.1->48KHz@16bit
Frequency responese:-0.00.+0.01db
Noise Level:-97.2db
Dynamic range:96.8db
THD:0.0005%
IMD:0.0040%
Stero crosstalk:-97.5db

Sorry for my poor english, I am from China mainland.

If you encounter any problem, please contanct me.

cxn4689@live.cn
nick name: Mulder

 

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #4
CUDA...I thought there was delays when calculating info on the GPU. Or am I mistaken?



The latency can be ignored. I have tested it.

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #5
Sounds great! As soon as more sample rates are implemented I will give it a try.



I have modified it to be an opencl version and it supports 32->96khz output rate and 192khz is not tested for device not support.  I have a problem with the attatchment. how can i add an atatchment to a tpoic? by the way, it supports both nvidia 460gtx or better and amd hd5850 or better. latest amd or nvidia opencl driver is needed!

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #6
this is the download link:
http://sharesend.com/bq8an


opencl version resampler support 32K->96Khz, 192khz is not tested for my device limitation.

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #7
Modified the file name. The new download link is :http://sharesend.com/s8szr

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #8
I have optimized the thread mapping of opencl for nvidia GPU.  This 003 version can be downloaded here: http://sharesend.com/t4js6

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #9
Great idea, tried it out... worked fine as long as the output sample rate wasn't above 48kHz... tried 88.2kHz and 96kHz and got silence (GTX 295, Xonar D2X over ASIO).

I have developed an OpenCL based resampler for foobar2000 v 1.x

Reply #10
This would be a nice plug-in if would do 96kHz and use some good quality algorithms for resample. There are hundreds of algorithms out there and some of them are producing horrid results...
You can take a look at SOX one: http://sox.sourceforge.net/SoX/Resampling