USBX Ux Device Audio - Playback and Recording
I have Playback set up and running. I also have recording set up as well. It enumerates. It shows up as STM32 Microphone. But it does not capture anything.
I notice that playback is not playing sounds either. So I traced it to this: as soon as I have BSP_AUDIO_IN_Init() called, playback doesn't play sounds.
I wonder if there's an issue with having both instances be 0?
// Initialize Audio Play and Record structures
AudioPlayInit.Device = AUDIO_OUT_DEVICE_HEADPHONE;
AudioPlayInit.ChannelsNbr = 2;
AudioPlayInit.SampleRate = AUDIO_FREQUENCY_48K;
AudioPlayInit.BitsPerSample = AUDIO_RESOLUTION_16B;
AudioPlayInit.Volume = VOLUME_SPEAKER_DEFAULT;
AudioRecordInit.Device = AUDIO_IN_DEVICE_ANALOG_MIC; // Use instance 0 SAI/codec
AudioRecordInit.ChannelsNbr = 2;
AudioRecordInit.SampleRate = AUDIO_FREQUENCY_48K;
AudioRecordInit.BitsPerSample = AUDIO_RESOLUTION_16B;
AudioRecordInit.Volume = VOLUME_MICROPHONE_DEFAULT;
// Initialize Audio Output Device
if(BSP_AUDIO_OUT_Init(0, &AudioPlayInit) != BSP_ERROR_NONE)
{
Error_Handler();
}
// Initialize Audio Input Device
if (BSP_AUDIO_IN_Init(0, &AudioRecordInit) != BSP_ERROR_NONE)
{
Error_Handler();
}
The reason why both instances are 0 is because I want to use SAI/codec lines, and I have a headset that is a headphone and microphone in the same jack.
Thoughts on why initializing the input device kills the playback?
