Some customers use a third-party video player, there is stereo and mono switch between, found no effect after switching
The reason is because in the HAL layer default does not handle the upper stereo turn mono command, so there will be no effect,
you can add related processing as follows:
1 Modification AudioMTKHardware.cpp
Add: Static String8 Keysetstereo2monomode = String8 ("Enablestereooutput");
2. Modify status_t audiomtkhardware::setparameters (const STRING8 &keyvaluepairs)
In Exit_setparameters:
Add Before:
Copy Code code as follows:
if (Param.getint (keysetstereo2monomode, value) = = No_error) {
ALOGD ("Setparameters ():%s value=%d", keyvaluepairs.string (), value);
((audiomtkstreammanager*) Maudiomtkstreammanager)->forcesterer2mono (value);
}
3. Modify AudioMTKStreamManager.h
Add Public method Definition:
Copy Code code as follows:
status_t Forcesterer2mono (bool flag);
status_t Audiomtkstreammanager::forcesterer2mono (BOOL flag)
{
Force all stream to standby
ALOGD ("Forcesterer2mono =%d", flag);
if (Mstreamoutvector.size ()) {
for (size_t i = 0; i < mstreamoutvector.size (); i++) {
Audiomtkstreamout *ptempout = (Audiomtkstreamout *) mstreamoutvector.valueat (i);
Ptempout->setstereotomonoflagforce (flag);
}
}
return no_error;
}
4. Modify AudioMTKStreamOut.h
T add definition:
Copy Code code as follows:
status_t Setstereotomonoflagforce (BOOL flag);
status_t Audiomtkstreamout::setstereotomonoflagforce (BOOL flag)
{
Alogd ("Setstereotomonoflagforce =%d") Flag);
Msterotomono = flag;
return no_error;
}