Skip to contentSkip to conversation

alsa driver api

DISCUSSION Michel Benoit 2 participants 2 messages May 2, 2007 – May 3, 2007

lore
Share & tools
lore
#0 lore raw

Hi

Does anyone have some code examples that show how to send pcm samples directly to an alsa driver. I'm (still) having trouble building/using alsa-lib and I want to make sure that my driver works correctly. If I understand correctly it is possible to send sound samples using the alsa driver api only (no alsa-lib).

All I want to do for now is send a fixed sine wave to the driver. I saw some code snippets that seemed to do just that in a recent email on this list but it would help a lot if I could have a look at the complete application.

Thanks,

Michel

#1 lore raw
Quoted 8 lines · Michel Benoit

Hi

Does anyone have some code examples that show how to send pcm samples directly to an alsa driver. I'm (still) having trouble building/using alsa-lib and I want to make sure that my driver works correctly. If I understand correctly it is possible to send sound samples using the alsa driver api only (no alsa-lib).

Quoted 8 lines

All I want to do for now is send a fixed sine wave to the driver. I saw some code snippets that seemed to do just that in a recent email on this list but it would help a lot if I could have a look at the complete application.

Thanks,

Michel

There is an alsa tool already available to do the task. It is called "speaker-test"

speaker-test -c2 -Dplug:front -twav    (voices)
speaker-test -c2 -Dplug:front -tsine   (sine wave)
speaker-test -c2 -Dplug:front -tpink   (pink noise)

You can then use any device name you wish to test.

James