[General Questions and Answers] zsoerenm:
Hello there,

I'm building Android for HTC M7 (see here: https://xdaforums.com/t/rom-11-0-unofficial-m7-all-lineageos-18-1-for-microg-stable.4439595/) with the following Docker image:

GitHub - lineageos4microg/docker-lineage-cicd: Docker microservice for LineageOS Continuous Integration and Continous Deployment

Docker microservice for LineageOS Continuous Integration and Continous Deployment - lineageos4microg/docker-lineage-cicd

github.com

My manifest.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="htc-msm8960-dev/android_device_htc_m7" path="device/htc/m7" remote="github" revision="lineage-18.1" />
<project name="zsoerenm/android_device_htc_m7-common" path="device/htc/m7-common" remote="github" revision="lineage-18.1-label_mpdecision" />
<project name="htc-msm8960-dev/android_kernel_htc_msm8960" path="kernel/htc/msm8960" remote="github" revision="lineage-18.1" />
<project name="htc-msm8960-dev/android_device_htc_msm8960-common" path="device/htc/msm8960-common" remote="github" revision="lineage-18.1" />
<project name="htc-msm8960-dev/proprietary_vendor_htc" path="vendor/htc" remote="github" revision="lineage-18.1" />
</manifest>

Currently FM Radio is not working.

Looking at the build log, I found that https://github.com/LineageOS/android_vendor_qcom_opensource_fm-commonsys is used.

e.g.

[ 98% 462/467] including vendor/qcom/opensource/libfmjni/Android.mk ...
...
[ 28% 22103/76729] //vendor/qcom/opensource/fm-commonsys/jni:libqcomfm_jni clang++ android_hardware_fm.cpp
[ 28% 22104/76729] //vendor/qcom/opensource/fm-commonsys/jni:libqcomfm_jni clang++ ConfFileParser.cpp
[ 28% 22105/76729] //vendor/qcom/opensource/fm-commonsys/jni:libqcomfm_jni clang++ ConfigFmThs.cpp
[ 28% 22106/76729] //vendor/qcom/opensource/fm-commonsys/jni:libqcomfm_jni clang++ FmPerformanceParams.cpp
...
[ 49% 37708/76729] //vendor/qcom/opensource/fm-commonsys/fmapp2:FM2 aidl
...
[ 50% 38860/76729] //vendor/qcom/opensource/fm-commonsys/fmapp2:FM2 fix manifest

BTW: I'm surprised that this is actively maintained. Very cool!

Now the question is: How do I activate FM radio?

When I open the preinstalled FM-Radio App, it says: Operation failed

and in the logcat I find this:

06-04 20:31:50.553 4369 4369 E FMRadio : FmReceiver constructor
06-04 20:31:50.553 4369 4369 D FMService: fmOn: RadioBand :1
06-04 20:31:50.553 4369 4369 D FMService: fmOn: Emphasis :1
06-04 20:31:50.553 4369 4369 D FMService: fmOn: ChSpacing :2
06-04 20:31:50.554 4369 4369 D FMService: fmOn: RdsStd :1
06-04 20:31:50.554 4369 4369 D FMService: fmOn: LowerLimit :87500
06-04 20:31:50.554 4369 4369 D FMService: fmOn: UpperLimit :108000
06-04 20:31:50.554 4369 4369 V FMRadio : enable: CURRENT-STATE : FMOff ---> NEW-STATE : FMRxStarting
06-04 20:31:50.554 4369 4369 D FmTransceiver: Fail to Open -1
06-04 20:31:50.554 4369 4369 E FMRadio : enable: Error while turning FM On
06-04 20:31:50.554 4369 4369 E FMRadio : enable: CURRENT-STATE : FMRxStarting ---> NEW-STATE : FMOff
06-04 20:31:50.554 4369 4369 D FMService: mReceiver.enable done, Status :false
06-04 20:31:50.554 4369 4369 D FMService: in stop
06-04 20:31:50.562 4369 4369 E FMRadio : mService.fmOn failed
06-04 20:31:50.562 4369 4369 D FMRadio : disaplyDialog 13
06-04 20:31:50.619 4369 4429 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE

I tried to add the following to BoardConfigCommon.mk

BOARD_HAVE_QCOM_FM := true
COMMON_GLOBAL_CFLAGS += -DQCOM_FM_ENABLED

(see here: https://github.com/zsoerenm/android...mmit/ba35097128d3d0ea730402630bfdad4662a8fe63)

And there is some old code here:

android_device_htc_m7/device.mk at lineage-18.1 · htc-msm8960-dev/android_device_htc_m7

Contribute to htc-msm8960-dev/android_device_htc_m7 development by creating an account on GitHub.

github.com

# FM radio
PRODUCT_PACKAGES += \
FM2 \
libqcomfm_jni \
qcom.fmradio

However, FM Radio is still not working with the same error as above.

What do I need to do to enable FM-Radio? @bgcngm @LuK1337