Giter Club home page Giter Club logo

cudafir's Introduction

cudaFIR

cudaFIr is an ALSA audio plugin that implements Finite impulse response (FIR) filtering. It convolves the input stereo signal with the filter impulse response, using partitionned FFT, accelerated by Nvidia GPU.

Compile

cudaFIR compilation need libasound-devel, make, gcc, CMake packages and the cuda SDK from Nvidia.

To compile it :

cd cudaFIR
Edit the CMakeLists.txt file to set the CUDA_ARCHITECTURES of your GPU
mkdir build
cd build
cmake ..
make 

This will create the libasound_module_pcm_cudaFIR.so alsa external pluging in the build directory.

Note : cudaFIR has been only tested on a Jetson TX1, but it must works on any Linux machine with a Nvidia GPU for which the cuda SDK exist.

Install & Alsa configuration

  1. Copy the libasound_module_pcm_cudaFIR.so into your alsa external plugin directory. Exact path depends of your Linux distribution (ie for fedora : /usr/lib64/alsa-lib/).

  2. Create a virtual alsa device in your alsa conf file (.asoundrc, /etc/asound.conf, etc ...) :

pcm.filter {
        type cudaFIR
	filterpathprefix "/mydir/myfilter"
        slave {
                pcm "hw:USB,0"
        }
}
  • hw:USB,0 must be replaced by the name of your alsa output device.
  • filterpathprefix is the filters filename prefix (see below).

Filters

cudaFIR need one filter impulse response file by used sample rate.

Filters impulse response file format is 32bits floats stereo raw. Such files could be generated by program like "rePhase" (https://rephase.org/)

Their names must be of the form: filterpathprefix-Fsk.raw , where Fs is the sample frequency in Ks/s.

Example : /mydir/myfilter-44k.raw, /mydir/myfilter-48k.raw, /mydir/myfilter-88k.raw, /mydir/myfilter-96k.raw, etc ...

Use

Just play music using the filter virtual alsa device.

Example: aplay -D filter sound.wav

Note : cudaFIR accept only pcm signed 16 or 32 bits integer as input, and output in 32 bits signed integer format, so the slave device must accept this later format.

cudafir's People

Contributors

tleconte avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.