I managed to make GSM module to work on rock5b, initiate calls, send receive SMS.
Currently I dont have sound in calls. Because sound system is different than RIL I decided to create new post here.
GSM module is recognized as USB sound device. I need to forward sound from audio input to GSM. And also from GSM to audio output.
DeviceVector rxSinkdevices{};
rxSinkdevices = mEngine->getOutputDevicesForAttributes(
attributes_initializer(AUDIO_USAGE_VOICE_COMMUNICATION), nullptr, fromCache);
if (!rxSinkdevices.isEmpty() && mAvailableOutputDevices.contains(rxSinkdevices.itemAt(0))) {
auto rxSinkDevice = rxSinkdevices.itemAt(0);
auto telephonyRxModule = mHwModules.getModuleForDeviceType(
AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
// retrieve Rx Source device descriptor
sp<DeviceDescriptor> rxSourceDevice = mAvailableInputDevices.getDevice(
AUDIO_DEVICE_IN_TELEPHONY_RX, String8(), AUDIO_FORMAT_DEFAULT);
// RX Telephony and Rx sink devices are declared by Primary Audio HAL
if (isPrimaryModule(telephonyRxModule) && (telephonyRxModule->getHalVersionMajor() >= 3) &&
telephonyRxModule->supportsPatch(rxSourceDevice, rxSinkDevice)) {
ALOGW("%s() device %s using HW Bridge", __func__, rxSinkDevice->toString().c_str());
return DeviceVector(rxSinkDevice);
}
}
// Note that despite the fact that getNewOutputDevices() is called on the primary output,
// the device returned is not necessarily reachable via this output
// (filter later by setOutputDevices())
return getNewOutputDevices(mPrimaryOutput, fromCache);