зеркало из https://github.com/mozilla/gecko-dev.git
Bug 823798 - Route FM radio through analog path. r=mwu a=blocking-b2g
This commit is contained in:
Родитель
9036a0e047
Коммит
c34423960e
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче