Guitar Tuner app probs with using /dev/dsp on 2.6.28

c_c cchandel at
Tue Jan 27 17:11:54 CET 2009

  I've developed a guitar tuning app for the freerunner that uses FFT
followed by harmonic spectrum product to detect the fundamental freq of a
guitar string.
  While the app is pretty basic (as of now) and my DSP skills are almost
non-existent, the app gives 1Hz accuracy about 75% of the time. The
remaining 25% it still detects a harmonic as the fundamental freq.
  The major problem I'm facing though (apart from the rough, non-optimised
code with a hacked together UI!) is that I can't seem to read from the mic
using /dev/dsp using the alsa gsmhandset.state. I need to use the
voice-recoding.state (from the ML) to get data. And, the state needs to be
changed after I start reading data. Also, I need to change the state back to
stereoout.state before the program quits. Otherwise, I get a kernel oops (on
the tracker - I think).
  So, here's the question that begs asking. 
  What's the best way to read data from the mic for a program like this?

  I would also be grateful if some DSP guru can take a look at my (hack ;-)
code and suggest some improvements to the downsampling I'm doing for the
HSP. Also, I think I need a low pass filter. Can someone point me in the
right direction? 

  The FFT should be fine since I'm using FFTW. But, can that be made better
(in performance if nothing else)?

  Any other suggestions for the UI/anything else are also welcome.

  The code is available here  and at 
View this message in context:
Sent from the Openmoko Devel mailing list archive at

More information about the devel mailing list