Sign in

username or email:

password:



Not a member?
Forgot your password?

Search blogs



Search tips

Articles by category

Our Bloggers

See Also

Embedded SystemsFPGA

DSP Blogs > Gabriel Rivas > How to build a test environment for audio DSP code in C using GNU/Linux

Gabriel Rivas
Gabriel Rivas received a BSc in Electrical Engineering at the Technological University of Panama, republic of Panama in 2006. He has worked as embedded software engineer for about 5 years. As a hobby musician he enjoys doing DSP for audio processing.

RSS Feed

Would you like to be notified by email when Gabriel Rivas publishes a new blog?

  

Pageviews: 564

How to build a test environment for audio DSP code in C using GNU/Linux

Posted by Gabriel Rivas on Feb 12 2011 under Audio DSP   

This may be useful for people that want to try audio DSP algorithms in C.

You will need:

  1. Hardware: You will need regular a PC (not older than a Pentium 3) or small PC will do the job.
  2. Sound card: This PC should have a soundcard, at least with one mic input and one headphones output.
  3. I/O: You will need, speakers or headphones and a microphone, or some cable the connect the source of the sound to the PC that will be doing the audio processing.
  4. Software: You will need a GNU/Linux distribution with at least OSS (Open Sound System) audio driver and GCC compiler.

The Open Sound System is one of the the first Linux driver built, and like other devices like Ethernet and serial ports, it has a well defined API and abstraction models of different audio devices like soundcards, DSPs, synthesizers, MIDI devices, etc. You can download the OSS programming guide at http://www.opensound.com/pguide/oss.pdf

I use the Fedora Core 6 distribution because I am using old PCs to this (a 7 years old PC and a 5 years old PC).

You will require also some Linux basic skills like browsing directories, compiling with GCC and so on. It would be better if you know how to install the Linux distribution, if you don’t know how to do it, there are plenty of HOWTOs guides in the web.

Once you have everything installed, the next thing you do is setting the soundcard. In the OS desktop you can do this by setting the mic input for recording, and also set the capture option.

When you have the soundcard configured then you can copy the code listed at http://www.dsprelated.com/showcode/78.php and create a .c file with it, and compile it with GCC, there should not be any problem.

Then run the compiled program and you should be able to connect an audio signal in the mic input and hear that signal in the headphones or speakers output of the PC.



Rate this article:
0
Rating: 0 | Votes: 0
 
   
 
posted by Gabriel Rivas
Gabriel Rivas received a BSc in Electrical Engineering at the Technological University of Panama, republic of Panama in 2006. He has worked as embedded software engineer for about 5 years. As a hobby musician he enjoys doing DSP for audio processing.

all articles by Gabriel Rivas

Would you like to be notified by email when Gabriel Rivas publishes a new blog?

  


Comments


mboigner
Said:
Wouldn´t it be better to go with ALSA which is much newer? Or use some sound "middleware" like PulseAudio? OSS is pretty old...
2 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
grivas
Said:
OSS still have big demand, and is good enough to use it as an audio processing engine. Maybe for more advanced applications ALSA and other software may be better.
2 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
Sorry, you need javascript enabled to post any comments.