hmc
Active Member
Hi guys,
I want to port a program to the Pandora. It uses Microphone input using OSS, JACK or ALSA.
My guess was, that ALSA is the best choice, so I disabled JACK support and am now trying to configure ALSA.
However, it doesn't work. Maybe someone can help?
I can successfully record audio from the microphone using
arecord -f cd -D hw:0,1 test.wav
So I assume ALSA works correctly and the device to use is "hw:0,1".
Now, if I configure my application to use ALSA and device "hw:0,1", I get an error message, that channel count cannot be set.
In the sources, I identified this code to cause that error:
if ((err = snd_pcm_hw_params_set_channels(audio->capture_handle,
hw_params, channels)) < 0) {
sprintf(error_message, "Cannot set channel count.\n%s.", snd_strerror(err));
throw(error_message);
}
"channels" is 1.
The function snd_pcm_hw_params_set_channels() is an alsa-lib function, so I assume there must be a way to make it work correctly with the Pandora's microphone? Any experience with this?
I have changed channels to 2 and recompiled, but the same error message.
Then I commented out the entire block of code above, but this lets the application crash entirely.
Any idea how to proceed form here?
By the way: The application is "Lingot", a guitar tuner program.
Thanks!
Daniel
I want to port a program to the Pandora. It uses Microphone input using OSS, JACK or ALSA.
My guess was, that ALSA is the best choice, so I disabled JACK support and am now trying to configure ALSA.
However, it doesn't work. Maybe someone can help?
I can successfully record audio from the microphone using
arecord -f cd -D hw:0,1 test.wav
So I assume ALSA works correctly and the device to use is "hw:0,1".
Now, if I configure my application to use ALSA and device "hw:0,1", I get an error message, that channel count cannot be set.
In the sources, I identified this code to cause that error:
if ((err = snd_pcm_hw_params_set_channels(audio->capture_handle,
hw_params, channels)) < 0) {
sprintf(error_message, "Cannot set channel count.\n%s.", snd_strerror(err));
throw(error_message);
}
"channels" is 1.
The function snd_pcm_hw_params_set_channels() is an alsa-lib function, so I assume there must be a way to make it work correctly with the Pandora's microphone? Any experience with this?
I have changed channels to 2 and recompiled, but the same error message.
Then I commented out the entire block of code above, but this lets the application crash entirely.
Any idea how to proceed form here?
By the way: The application is "Lingot", a guitar tuner program.
Thanks!
Daniel
Last edited by a moderator: