voiceCallService start automatically

Hello All,

When I turn on the platform, is it possible to start the voiceCallService automatically? Are there any issues with starting it directly?

You can write a script to start it

thank you for the response. I ran the voiceCallApp application, and if a call comes in while the device is in sleep mode, the system crashes. The last log I saw is as follows:

modemDaemon[4212]/modemDaemon T=main | le_mrc.c SignalStrengthIndHandlerFunc() 879 | Signal Strength Ind Handler called with RAT.1 and ss.-98
swi-mdm9x28-wp user.warn Legato: -WRN- | audioDaemon[4156]/le_pa_audio T=unknown | pa_audio.c CallHandler() 375 | CallHandler called
swi-mdm9x28-wp user.warn Legato: -WRN- | audioDaemon[4156]/le_pa_audio T=unknown | pa_audio.c CallHandler() 427 | Identify call ID 0
swi-mdm9x28-wp user.info Legato: INFO | modemDaemon[4212]/le_pa T=unknown | pa_mcc_qmi.c CallHandler() 690 | QMI ID.1 State.SETUP (0x0A) Type.0x00 Dir.0x02 Mode.0x02 Mparty.0 ALS.0
user.warn Legato: -WRN- | voiceCallService[4605]/voiceCallService T=main | voiceCallServiceServer.c VoiceSessionStateHandler() 383 | Unknown Call event. 0
client_loop: send disconnect: Broken pipe

Do you have any suggestions for this issue?

Which application are you running?
Do you see problem with this sample app?

I used this example: https://github.com/legatoproject/legato-af/tree/master/apps/sample/voiceCallApp. It works correctly when the device is not in sleep mode; I tested it. However, when I make a call while the device is in sleep mode, it crashes.

Then why don’t you keep the device wake when making call?

The issue is that when a call comes to the device in sleep mode, it crashes.

if you just “app start voiceCallService” without running your app, will it crash?

I suspect there might be an error due to initiating the voiceCallService later. I will look into that.

static le_result_t OpenAudioMic
(
    le_voicecall_CallRef_t reference
)
{
    le_result_t res;

    MdmRxAudioRef = le_voicecall_GetRxAudioStream(reference);
    LE_ERROR_IF((MdmRxAudioRef==NULL), "le_voicecall_GetRxAudioStream returns NULL!");


    MdmTxAudioRef = le_voicecall_GetTxAudioStream(reference);
    LE_ERROR_IF((MdmTxAudioRef==NULL), "le_voicecall_GetTxAudioStream returns NULL!");

    LE_DEBUG("OpenAudio MdmRxAudioRef %p, MdmTxAudioRef %p", MdmRxAudioRef, MdmTxAudioRef);
    LE_INFO("Connect to Mic and Speaker");

    // Redirect audio to the in-built Microphone and Speaker.
    FeOutRef = le_audio_OpenSpeaker();
    LE_ERROR_IF((FeOutRef==NULL), "le_audio_OpenSpeaker returns NULL!");

    FeInRef = le_audio_OpenMic();
    LE_ERROR_IF((FeInRef==NULL), "le_audio_OpenMic returns NULL!");

    AudioInputConnectorRef = le_audio_CreateConnector();
    LE_ERROR_IF((AudioInputConnectorRef==NULL), "AudioInputConnectorRef is NULL!");

    AudioOutputConnectorRef = le_audio_CreateConnector();
    LE_ERROR_IF((AudioOutputConnectorRef==NULL), "AudioOutputConnectorRef is NULL!");

    if (MdmRxAudioRef && MdmTxAudioRef && FeOutRef && FeInRef && AudioInputConnectorRef && AudioOutputConnectorRef)
    {
        res = le_audio_Connect(AudioInputConnectorRef, FeInRef);
        LE_ERROR_IF((res!=LE_OK), "Failed to connect RX on Input connector!");

        res = le_audio_Connect(AudioInputConnectorRef, MdmTxAudioRef);
        LE_ERROR_IF((res!=LE_OK), "Failed to connect mdmTx on Input connector!");

        res = le_audio_Connect(AudioOutputConnectorRef, FeOutRef);
        LE_ERROR_IF((res!=LE_OK), "Failed to connect TX on Output connector!");
        res = le_audio_Connect(AudioOutputConnectorRef, MdmRxAudioRef);
        LE_ERROR_IF((res!=LE_OK), "Failed to connect mdmRx on Output connector!");
    }

    return LE_OK;
}
[Example](https://github.com/legatoproject/legato-af/tree/master/apps/sample/voiceCallApp)

Finally, my question is this: In this example, I want to use the digital microphone. Will this require any changes to the hardware or software? Because when I run the voiceCall example, it does not transmit sound from the digital microphone on the board.

you might need to check the schematic and see if those required pins are connected

It says ‘digital mic. default’.

not sure if this helps:

Is there an easier way to change the GPIO?

you can try to solder a wire there.
BTW, i saw that in the schematic, the control the GPIO expander is by i2c, you can try whether you can send out the i2c command to control it

You might also need to try “gpioexp” command
e.g.
gpioexp 1 5 output normal high >/dev/null

I followed your advice. I even used GENERIC_LED to make sure it’s set.

FeOutRef = le_audio_OpenSpeaker();
LE_ERROR_IF((FeOutRef==NULL), "le_audio_OpenSpeaker returns NULL!");
FeInRef = le_audio_OpenMic();
LE_ERROR_IF((FeInRef==NULL), "le_audio_OpenMic returns NULL!");

When I do it this way, there is still no sound. Even though I have set it.

      FeOutRef = le_audio_OpenPcmTx(0);
      LE_ERROR_IF((FeOutRef==NULL), "OpenPcmTx returns NULL!");
      FeInRef = le_audio_OpenPcmRx(0);
      LE_ERROR_IF((FeInRef==NULL), "OpenPcmRx returns NULL!");

I changed it to this and got this error.

voiceCallApp[30300]/voiceCallComponent T=main | voiceCallApp.c OpenAudioMic() 258 | Connect to Mic and Speaker
audioDaemon[30208]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 1942 | Set the following path: 0 (in.6 out.5)
audioDaemon[30208]/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=4.[0x04]
audioDaemon[30208]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 2033 | Cannot set the audio physical interface to 0
voiceCallApp[30300]/voiceCallComponent T=main | voiceCallApp.c OpenAudioMic() 290 | Failed to connect mdmTx on Input connector!
audioDaemon[30208]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 1942 | Set the following path: 0 (in.4 out.7)
audioDaemon[30208]/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=4.[0x04]
audioDaemon[30208]/le_pa_audio T=main | pa_audio.c pa_audio_SetDspAudioPath() 2033 | Cannot set the audio physical interface to 0
voiceCallApp[30300]/voiceCallComponent T=main | voiceCallApp.c OpenAudioMic() 295 | Failed to connect mdmRx on Output connector!

I saw the AT!AVCFG command has PCM interface, have you tried that?

AT!AVCFG
ERROR

I got an ERROR.

you can have a look on the AT command user guide:

These are my results. In terms of the digital microphone on the card, what should be present?

AT!AVCFG?
!AVCFG: 0,1,2
!AVCFG: 1,1,2
!AVCFG: 2,1,2
!AVCFG: 3,1,2
!AVCFG: 4,1,2
!AVCFG: 5,1,2
!AVCFG: 6,1,2
!AVCFG: 7,1,2
!AVCFG: 8,1,2
!AVCFG: 9,1,2

OK

no idea, i have no experience on using PCM