mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 823798 - Route FM radio through analog path. r=mwu a=blocking-b2g
This commit is contained in:
parent
22fb48a38c
commit
b4c929aa87
@ -160,12 +160,37 @@ initTavaruaRadio(hal::FMRadioSettings &aInfo)
|
||||
return;
|
||||
}
|
||||
|
||||
rc = setControl(V4L2_CID_PRIVATE_TAVARUA_SET_AUDIO_PATH, FM_DIGITAL_PATH);
|
||||
// Some devices do not support analog audio routing. This should be
|
||||
// indicated by the 'ro.moz.fm.noAnalog' property at build time.
|
||||
char propval[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.moz.fm.noAnalog", propval, "");
|
||||
bool noAnalog = !strcmp(propval, "true");
|
||||
|
||||
rc = setControl(V4L2_CID_PRIVATE_TAVARUA_SET_AUDIO_PATH,
|
||||
noAnalog ? FM_DIGITAL_PATH : FM_ANALOG_PATH);
|
||||
if (rc < 0) {
|
||||
HAL_LOG(("Unable to set audio path"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!noAnalog) {
|
||||
/* Set the mode for soc downloader */
|
||||
property_set("hw.fm.mode", "config_dac");
|
||||
/* Use analog mode FM */
|
||||
property_set("hw.fm.isAnalog", "true");
|
||||
/* start fm_dl service */
|
||||
property_set("ctl.start", "fm_dl");
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
sleep(1);
|
||||
char value[PROPERTY_VALUE_MAX];
|
||||
property_get("hw.fm.init", value, "0");
|
||||
if (!strcmp(value, "1")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fd.forget();
|
||||
sRadioEnabled = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user