[linux-audio-dev] programming question (w/code)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] programming question (w/code)
From: Paul Coccoli (pcoccoli_AT_earthlink.net)
Date: Sat Nov 24 2001 - 20:15:53 EET


Hello all

I'm trying to learn audio programming the hard way (by just doing it), so
I wrote a simple tone generating program that reads MIDI input from
/dev/midi00. The problem is that there's a long delay between when I hit
a key on my MIDI controller and when the sound actually comes out of my
speakers. My debugging statements show up right away, however (indicating
which MIDI message was received). I've tried adjusting the size of the
buffer that I write to before writing to the soundcard, but nothing seems
to change it. I can make the buffer as small as 16 bytes and I still have
the same problem. Perhaps it has something to do with the soundcard's
buffer?

Obviously I am doing something insanely wrong, but I haven't figured out
what it is. Note that I'm not having any other latency-related issues on
my system: xsynth works like champ, the Ultramaster Juno-6 works fine
(with 3 voices), I can record sound while playing WAV files in XMMS and
the recording sounds great. I've tried my code on two different systems
and I get the same result.

Attached is my source code (it's pretty small). If somebody could give it
a quick look and see if they notice anything stupid, I'd really appreciate
it.



New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Nov 24 2001 - 20:06:41 EET