This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
I am developing an application that transmits and receives with OPUS codec using CC1352P.
Please let me know how to set TLV320 Audio Read/Write at the same time.
AudioHAL_startStream(tlv320Handle1, AUDIOHAL_OUTPUT);
AudioHAL_startStream(tlv320Handle2, AUDIOHAL_INPUT);
ccs : v9_2
sw : rfAudioTx_CC1352P1_LAUNCHXL_tirtos_ccs
AudioHAL_Params_init(&audioHalParams);
audioHalParams.frameSize = PCM_FRAME_SIZE;
audioHalParams.numChannels = NUM_CHAN;
audioHalParams.readBuf = readBuf;
audioHalParams.writeBuf = writeBuf; // added
audioHalParams.bitDepth = AUDIOHAL_BITDEPTH_16;
audioHalParams.samplingFrequency = SAMPLE_RATE;
audioHalParams.readBufDepth = AUDIOHAL_DEFAULT_BUF_DEPTH;
audioHalParams.writeBufDepth = AUDIOHAL_DEFAULT_BUF_DEPTH; //added
audioHalParams.dataReadyCB = audioDataReadyCB;
audioHalParams.eventCB = audioEventCB;
audioHalParams.direction = AUDIOHAL_INPUT_OUTPUT; //change from AUDIOHAL_INPUT
tlv320Handle = AudioHAL_open(Board_AUDIOHAL_CODEC, &audioHalParams);
AudioHAL_startStream(tlv320Handle, AUDIOHAL_INPUT); // MIC Read OK
AudioHAL_startStream(tlv320Handle, AUDIOHAL_INPUT_OUTPUT); // MIC Read FAIL
I want both read and write on mainThread.
Thank you.
My test environment is follows.
- SimpleLink Audio Plugin - 3.30.00.06
- Development Tools
- CC1352P1 Launchpad
- easyLink
I tested on rfAudioTx project.
Please take a look at the Audiohal_echo example.
It uses AudioHAL_startStream(tlv320Handle, AUDIOHAL_INPUT_OUTPUT);
I do not think you can AudioHAL_startStream twice in a row with the same handle.
Siri
1. I knew AudioHAL_startStream(tlv320Handle, AUDIOHAL_INPUT_OUTPUT) is work well on Audiohal_echo example.
2. I did not AudioHAL_startStream twice in same handle.
1) I just test AudioHAL_startStream(AUDIOHAL_INPUT) on rfAudioTx example. It work properly.
2) and I build and test AudioHAL_startStream(AUDIOHAL_INPUT_OUTPUT) again. It does not work.
I want AudioHAL_startStream(AUDIOHAL_INPUT_OUTPUT) works properly on rfAudioTx example.
(It means AudioHAL_readBufGet(tlv320Handle, (void *)audioIn) works well.)
I think you are missing the
audioHalParams.dataNeededCB = &audioDataNeeded;
Even if the callback does not do anything, it is being called from the i2sWriteCallback, so it needs to be presenet when you have selected if you set the direction as AUDIOHAL_INPUT_OUTPUT or AUDIOHAL_OUTPUT.
You will find it in bot the audio_exho example and the rfAudioRx example
Siri