I’ve been attempting to manipulate the outgoing audio stream from the modem to the caller. We currently have the device setup to use I2S to bring audio in from our codec on the board, and then transmit that to the current caller. In Legato I’m doing the following:
COMPONENT_INIT
{
le_audio_ConnectService();
le_voicecall_ConnectService();
le_audio_StreamRef_t modemTxRef = le_audio_OpenModemVoiceTx();
le_audio_StreamRef_t playToneRef = le_audio_OpenPlayer();
le_audio_StreamRef_t i2sRxRef = le_audio_OpenI2sRx(LE_AUDIO_I2S_STEREO);
le_audio_ConnectorRef_t audioTxConnector = le_audio_CreateConnector();
le_result_t result;
result = le_audio_Connect(audioTxConnector, i2sRxRef);
result = le_audio_Connect(audioTxConnector, modemTxRef);
if (LE_OK != result) {
Debug::Log(Debug::LogLevel::DEBUG_ERR, "Unable to connect Modem Voice TX audio stream [%p] to TX connector. Error: %d", modemTxRef, result);
}
result = le_audio_Connect(audioTxConnector, playToneRef);
if (LE_OK != result) {
Debug::Log(Debug::LogLevel::DEBUG_ERR, "Unable to connect DTMF player audio stream [%p] to TX connector. Error: %d", playToneRef, result);
}
}
Some interesting logging statements:
Dec 11 16:01:04 swi-mdm9x28-wp user.info Legato: INFO | audioDaemon[1086]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 1942 | Set the following path: 1 (in.8 out.5)
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | audioDaemon[1086]/swiQmi T=main | swiQmi.c swiQmi_CheckResponse() 799 | Sending QMI_SWI_M2M_AUDIO_SET_AVCFG_REQ_V01 failed: rc=0 (), resp.result=1.[0x01], resp.error=5.[0x05]
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | audioDaemon[1086]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 2033 | Cannot set the audio physical interface to 1
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | VoiceManagerExe[1129]/VoiceManager T=main | debug.cpp Log() 43 | L4G-VoiceManager: Unable to connect Modem Voice TX audio stream [0x1a9] to TX connector. Error: -6
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | audioDaemon[1086]/swiQmi T=main | swiQmi.c swiQmi_CheckResponse() 799 | Sending QMI_SWI_M2M_AUDIO_SET_MEDIA_REQ_V01 failed: rc=0 (), resp.result=1.[0x01], resp.error=5.[0x05]
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | audioDaemon[1086]/le_pa_audio T=main | media_routing.c media_routing_SetDspAudioPath() 208 | Cannot set the audio media interface to 5
Dec 11 16:01:04 swi-mdm9x28-wp user.err Legato: =ERR= | VoiceManagerExe[1129]/VoiceManager T=main | debug.cpp Log() 43 | L4G-VoiceManager: Unable to connect DTMF player audio stream [0x3a9] to TX connector. Error: -6
Dec 11 16:04:27 swi-mdm9x28-wp user.warn Legato: -WRN- | VoiceManagerExe[1129]/VoiceManager T=main | debug.cpp Log() 40 | L4G-VoiceManager: Error [-6] playing dtmf tone on stream: 0x3a9
Also, when I attempt to increase or decrease the gain, or mute/unmute the audio stream I get no errors, but the commands don’t modify the stream either.
I have used those commands, and they do work as expected however, DTMF tones using !AVTONEPLAY or +VTD/+VTS do not work as expected. With those commands I am getting the following errors:
Ideally, I’d still like to use the Legato API to mute/unmute, modify gain, and play DTMF tones, but if I can get tones, mute/unmute, and gain control via AT commands, I’d be happy with that as well.
I downloaded the file you provided 0-to-9_8k.wav and placed in the root folder.
The command never works for me:-
AT!AVAUDIO=3,1,/home/root/0-to-9_8k.wav
ERROR
But this works and I am able to hear it via headset.
AT!AVAUDIO=1,1,/home/root/0-to-9_8k.wav
Good catch. My hardware isn’t set up for me to hear locally, so I couldn’t test that way. I’m curious to see if there’s a config change required to get remote play to work.
Yes, I am assuming after I get OK for AT!AVAUDIO=3,1 and when I try atd(Number) it should play the wav file for both my headset and receiver headset. Unfortunately AT!AVAUDIO=3,1 always gives me error. I tried replicating your firmware choice and profile but no luck.
at!avcfg=5,1,2
OK
AT!AVSETPROFILE=5
OK
AT!AVAUDIO=1,1,/home/root/0-to-9_8k.wav
OK
at!avaudio=1,0
OK
AT!AVAUDIO=3,1,/home/root/0-to-9_8k.wav
ERROR
Yes, I am using Mangoh Green board. I am able to execute the mangohVoiceCall application and talk with the receiver. But when I call using the microcom, I hear only the periodic beep sound on the receiver end. Do you have suggestions to figure out what is failing?