Skip to contentSkip to conversation

pcm_prepare, and pcm_trigger

DISCUSSION John Kacur 2 participants 4 messages Nov 25, 2008

lore
Share & tools
lore

John Kacur

author
#0 lore raw

More ASoC fundamentals questions.

when doing

cat 8k8bitpcm.wav > /dev/dsp

I'm seeing neither

myplatform_pcm_prepare,

nor

myplatform_pcm_trigger

called.

Is this normal? Who calls these functions?

Thanks

#1 lore raw
Quoted 6 lines · John Kacur

cat 8k8bitpcm.wav > /dev/dsp

myplatform_pcm_prepare,
myplatform_pcm_trigger

Is this normal? Who calls these functions?

I'd expect to see those called. They're called by the core in response to ALSA API operations - since you're using /dev/dsp the actual ALSA API client will be the OSS emulation you're using (normally the in-kernel one). For the purposes of development it's generally easier if you work with the ALSA APIs and use utilities like aplay to test. This avoids the layer of indirection added by OSS emulation, making bringup a bit clearer.

author
#2 lore raw
Quoted 9 lines · Mark Brown
Quoted 6 lines · John Kacur

cat 8k8bitpcm.wav > /dev/dsp

myplatform_pcm_prepare,
myplatform_pcm_trigger

Is this normal? Who calls these functions?

Quoted 8 lines

I'd expect to see those called. They're called by the core in response to ALSA API operations - since you're using /dev/dsp the actual ALSA API client will be the OSS emulation you're using (normally the in-kernel one). For the purposes of development it's generally easier if you work with the ALSA APIs and use utilities like aplay to test. This avoids the layer of indirection added by OSS emulation, making bringup a bit clearer.

Thanks again for the info.

On the embedded board I'm working on, compiling the alsa utilities isn't an option, we have the OSS emulation as a requirement.

#3 lore raw
Quoted 2 lines · John Kacur

On the embedded board I'm working on, compiling the alsa utilities isn't an option, we have the OSS emulation as a requirement.

That's sadly not uncommon for actual deployment but normally during development it's possible to install the ALSA utilities to make that process easier, even if they don't appear on production systems.