[Spirit FM] mikereidis:
Hi, Thanks for your purchase. :)

My answer is long, and may benefit others, so I've copied it to my XDA thread.

I've hidden the debug log sending function due to way too many debug logs every day from pirates.

OneX+ audio problems are known. I'm surprised to hear you had speaker working, but I may have heard that before.

The OneX+ is disabled on Play for this reason (though stock ROMs work OK), but some ROM's change the "ro.product.device" which bypasses the disable.

I have a OneX LTE and a OneX International, but not a OneX+ and I'm not expecting to get one. All 3 have different FM chips, and audio is different too.

And the OneX+ is not similar to older HTCs, nor to newer ones like HTC One.

OneX International and OneX+ both appear to use some obscure audio chip, and the ALSA drivers seem similar, but clearly have some differences.

I've put many hours into trying to support the OneX+ remotely, with no phone, and have not had success.

Setting Audio-> Method to "HTC" always works on HTC stock ROMs, but on non-stock derived audio libraries, the only Audio-> Method settings that have much chance of working are those that work on my OneX International:

- For stock ROMs and ROMs using the stock audio libraries: "HTC OneX/X+ Int"

- For AOSP ROMs: "HTC OneX/X+ Int ALSA" (Note the "ALSA" suffix)

Here's my code for audio stop/mute:

else if (m_aud_meth == AM_HTCOneXpIntAlsa) {
ssd_run ("4 2 'Pcm Playback Route' 23 /dev/snd/controlC1"); // Downlink_Path_Off
ssd_run ("4 2 'Pcm Capture Route' 23 /dev/snd/controlC1"); // Uplink_Path_Off
ssd_run ("4 2 'Config AIC3008 DSP' 8 /dev/snd/controlC1"); // Playback_Default
setParameters ("FM_type=0");
}
else if (m_aud_meth == AM_HTCOneXpInt) {
setForceUse (FOR_MEDIA, FORCE_NONE);
setDeviceConnectionState (0x2000, DEVICE_STATE_UNAVAILABLE, "");
setParameters ("FM_type=0");
}

Code for speaker:

else if (m_aud_meth == AM_HTCOneXpIntAlsa) {
setParameters ("FM_type=0");
ssd_run ("4 2 'Pcm Playback Route' 16 /dev/snd/controlC1"); // FM_Out_Speaker
ssd_run ("4 2 'Pcm Capture Route' 16 /dev/snd/controlC1"); // FM_In_Speaker
ssd_run ("4 2 'Config AIC3008 DSP' 20 /dev/snd/controlC1"); // Playback_FM
setParameters ("FM_type=2");
}
else if (m_aud_meth == AM_HTCOneXpInt) {
setDeviceConnectionState (0x2000, DEVICE_STATE_AVAILABLE, "");
setForceUse (FOR_MEDIA, FORCE_SPEAKER);
setParameters ("FM_type=2");
}

Code for headset and notes for the mysterious AIC3008 audio chip files:

else if (m_aud_meth == AM_HTCOneXpIntAlsa) {
setParameters ("FM_type=0");
ssd_run ("4 2 'Pcm Playback Route' 17 /dev/snd/controlC1"); // FM_Out_Headphone
ssd_run ("4 2 'Pcm Capture Route' 17 /dev/snd/controlC1"); // FM_In_Headphone
ssd_run ("4 2 'Config AIC3008 DSP' 20 /dev/snd/controlC1"); // Playback_FM (Or volume to set to 50 ??)
setParameters ("FM_type=1");
/*/system/etc/AIC3008_REG_DualMic.csv
/system/etc/AIC3008_REG_DualMic_XC.csv
A17,FM_In_Headphone,SET,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,REGISTER,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,VALUE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
B17,FM_Out_Headphone,SET,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,REGISTER,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,VALUE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M

A23,Uplink_Path_Off,SET,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,REGISTER,0x00,0x7F,0x00,0x34,0x36,0x37,0x39,0x3B,0x3C,0x3D,0x00,0x51,0x52,0x53,0x54,0x00,0x33,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,VALUE,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x88,0x00,0x00,0x01,0x32,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
B23,Downlink_Path_Off,SET,w,w,w,w,d,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,REGISTER,0x00,0x7F,0x00,0x1B,0x00,0x1B,0x1F,0x20,0x1C,0x1D,0x24,0x25,0x2E,0x2F,0x28,0x29,0x2D,0x30,0x16,0x00,0x40,0x3F,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M
,,VALUE,0x00,0x00,0x01,0x30,0x05,0x00,0xB9,0xB9,0x7F,0xFF,0x7F,0x7F,0x7F,0x7F,0x39,0xB9,0x00,0x00,0x00,0x00,0x0C,0x00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^M */
}
else if (m_aud_meth == AM_HTCOneXpInt) {
//setForceUse (FOR_MEDIA, FORCE_SPEAKER);
// setDeviceConnectionState (0x2000, DEVICE_STATE_AVAILABLE, "");
// setForceUse (FOR_MEDIA, FORCE_NONE);
//setDeviceConnectionState (0x2000, DEVICE_STATE_AVAILABLE, "");
setParameters ("FM_type=1");
}

The ssd_run() function runs this audio/ALSA command utility: /data/data/com.mikersmicros.fm_unlock/files/ssd

The other functions are wrappers for the equivalent AudioManager functions.

In theory, poking the ALSA controls the right way should enable/disable FM audio, but something else could be needed too.

ALSA controls can be changed with the AlsaMixer app, or command line utilties such as my ssd, or alsamixer or amixer etc.