Skip to main content

Topic: I have developed an OpenCL based resampler for foobar2000 v 1.x (Read 6511 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • cxn4689
  • [*]
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.

  • Sandrine
  • [*][*][*][*]
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.

  • mudlord
  • [*][*][*][*][*]
  • Developer (Donating)
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?

  • cxn4689
  • [*]
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

  • cxn4689
  • [*]
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.

  • cxn4689
  • [*]
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!

  • cxn4689
  • [*]
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.

  • cxn4689
  • [*]
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

  • cxn4689
  • [*]
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

  • NiPP0
  • [*]
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).

  • SoNic67
  • [*][*][*]
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
  • Last Edit: 28 April, 2012, 08:23:29 PM by SoNic67

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
I have developed an OpenCL based resampler for foobar2000 v 1.x
Reply #11
I have (finally, since I thought about it months ago) merged your two threads into this single one and split off the posts about licensing (and posts arguing about posts): Discussion: are (L)GPL-licensed components compatible with fb2k’s SDK?
  • Last Edit: 28 May, 2012, 02:46:47 PM by db1989