I have a question about LeEco built in remote control app. The question is that why is that app having feature such as 'Mock Location'. Is there any possible reason for that as per your knowledge.
I really can't answer that. I am wondering myself.
I have a question about LeEco built in remote control app. The question is that why is that app having feature such as 'Mock Location'. Is there any possible reason for that as per your knowledge.
I had a quick look qt this. But i think they have modified the lirc driver in kernel to work with their hardware. also their dts is different.Another (failed) try:
Instead of writing our own infrared HAL implementation, I thought it might be easier to just look at the implementation of other devices.
I came across the Xiaomi Mi 5 ("gemini") which also has an infrared device, the same ro.product.board (msm8996) and the same architecture.
I just replaced the HAL implementation file on the LePro3 (/system/lib64/hw/consumerir.default.so) with the one from the latest Cyanogenmod nigthly build (the file there is named: /system/lib64/hw/consumerir.msm8996.so).
First success: The .so file was loaded successfully, but the Consumer IR Service failed to start, as the Xiaomi HAL implementation uses LIRC to communicate with the infrared blaster (using the device file /dev/lirc0) which is not provided by the default kernel of the LePro 3.
As the Consumer IR Service failed to start, the device stuck in a bootloop, logging regularly this error:
Code:11-24 16:24:02.459 I/SystemServer( 1570): Consumer IR Service 11-24 16:24:02.460 E/ConsumerIrLirc( 1570): fail to open /dev/lirc0 error -1 11-24 16:24:02.460 E/ConsumerIrService( 1570): Can't open consumer IR transmitter, error: -1 11-24 16:24:02.460 E/System ( 1570): ****************************************** 11-24 16:24:02.461 E/System ( 1570): ************ Failure starting core service 11-24 16:24:02.461 E/System ( 1570): java.lang.RuntimeException: FEATURE_CONSUMER_IR present, but no IR HAL loaded! 11-24 16:24:02.461 E/System ( 1570): at com.android.server.ConsumerIrService.<init>(ConsumerIrService.java:51) 11-24 16:24:02.461 E/System ( 1570): at com.android.server.SystemServer.startOtherServices(SystemServer.java:508) 11-24 16:24:02.461 E/System ( 1570): at com.android.server.SystemServer.run(SystemServer.java:282) 11-24 16:24:02.461 E/System ( 1570): at com.android.server.SystemServer.main(SystemServer.java:180) 11-24 16:24:02.461 E/System ( 1570): at java.lang.reflect.Method.invoke(Native Method) 11-24 16:24:02.461 E/System ( 1570): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 11-24 16:24:02.461 E/System ( 1570): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
So, if somebody could compile a kernel which provides a lirc interface (/dev/lirc0), we could just use the HAL from Xiaomi and the problem also would be solved.
Hi @darkobas! Thanks for looking into this.I had a quick look qt this. But i think they have modified the lirc driver in kernel to work with their hardware. also their dts is different.
Hi @darkobas! Thanks for looking into this.
I also realized that lirc is very probably not an option for the IR chip used in the LEX720 device. The lirc kernel driver would need to implement the proprietary serial protocol which is currently done by the QuickSetSDK in userspace (altough it would be a beautiful and clean solution to have a working lirc driver).
Btw, I recently also switched to your OmniROM 7.1.2 build for my daily used phone. Thanks for your work! :good:
trying to make atleast the stock app work.
stuck at this at the moment
05-09 12:26:19.217 6581 6581 I UEI.SmartControl.LeTV: ### init IR Blaster...
05-09 12:26:19.220 6581 6581 E UEI.SmartControl.LeTV: no permission on read/write serial port!
05-09 12:26:19.221 6581 6581 E UEI.SmartControl.LeTV: java.io.IOException: no permission on read/write serial port!
05-09 12:26:19.221 6581 6581 E UEI.SmartControl.LeTV: at com.uei.driver.SerialDataComm.f(Unknown Source)
05-09 12:26:19.221 6581 6581 E UEI.SmartControl.LeTV: at com.uei.driver.SerialDataComm.<init>(Unknown Source)
if (file != null && file.canRead() && file.canWrite()) {
... does some stuff here
return; // and RETURNS
}
this.logger.logError("no permission on read/write serial port!", new Object[0]);
throw new IOException("no permission on read/write serial port!");
...
intent.putExtra("Port", this.platformParams.getSerialName()); // <--- HERE the client app specifies the full path to the tty device file
intent.putExtra("Baudrate", this.platformParams.getSerialPort());
boolean result = bindService(intent, this.mSetupServiceConnection, 1);
So I've spent a few hours digging around, and here's what I have so far. The serial port to which the app is trying to bind should be /dev/ttyHSL1, but it's missing in nougat.
Furthermore following @androcheck great writeup on the matter I saw that sys/remote/enable wasnt being toggled at all.( on remote control app startup it should change its value to 1, thus powering up the IR chip). I tried toggling it manually, but nothing changed.
I restored my 6.0.1 to grab some logs, and saw some processes that werent present in nougat. Mainly "ss", " ss_ir", "ss_UEI_IRbiz", who, among other things, toggle the sys/remote/enable switch, and bind quicksetsdk to /dev/ttyHSL1.
So after returning to Nougat, I was offered to update the remote control app, and I did. Now it crashes on startup, but guess what? The processes I've mentioned that I saw on Marshmallow were now present the app toggles the switch to activate IR now as it should, but the serial port itself is still missing (if I presume correctly it's missing from the kernel?)
Hope I was of some use to you with this info, I'll post the grabbed logs in a min.
@trizex Thanks for your reply.I wrote a bit about it couple of months ago. Screenshots of 6.0 working IR logcat grabs are in this post
https://xdaforums.com/showpost.php?p=71677801&postcount=117
@trizex Thanks for your reply.
@darkobas: which kernel did you test with? Did you test with your EAS kernel?
I did a quick grep over the source and the only occurrences of "ttyHSL" I found where in:
- Documentation/devicetree/bindings/tty/serial/msm_serial.txt
- drivers/tty/serial/msm_serial_hs_lite.c
I've checked the config in "arch/arm64/configs/zl1_defconfig" and it seems that CONFIG_SERIAL_MSM_HSL is not enabled.
Could you try again with this config enabled?
P.S.: I didn't build the kernel or ROM myself until now. Is it possible that you could provide me a local manifest to work with?
config SERIAL_MSM_HSL
tristate "MSM UART High Speed: Legacy mode Serial Driver"
depends on (ARM || ARM64) && ARCH_MSM
select SERIAL_CORE
default n
help
Select this module to enable MSM high speed UART driver in
legacy mode.
config SERIAL_MSM_HSL_CONSOLE
bool "MSM High speed serial legacy mode console support"
depends on SERIAL_MSM_HSL=y
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
default n
config SERIAL_MSM_HSL_DYNAMIC_CONSOLE
bool "Dynamic command line support for the HSL console"
depends on SERIAL_MSM_HSL_CONSOLE
default n
Yeah i have enabled hsl. just chmoding it didnt help.@trizex Thanks for your reply.
@darkobas: which kernel did you test with? Did you test with your EAS kernel?
I did a quick grep over the source and the only occurrences of "ttyHSL" I found were in:
- Documentation/devicetree/bindings/tty/serial/msm_serial.txt
- drivers/tty/serial/msm_serial_hs_lite.c
I've checked the config in "arch/arm64/configs/zl1_defconfig" and it seems that CONFIG_SERIAL_MSM_HSL is not enabled.
Could you try again with this config enabled?
P.S.: I didn't build the kernel or ROM myself until now. Is it possible that you could provide me a local manifest to work with?
The write to "/sys/remote/enable" is done by the LeEco Remote app (package: com.letv.android.remotecontrol) not the QuickSet SDK. On the stock ROM this file had a special SELinux type assigned (sysfs_ir_enable) and it was taken care of that the LeEco remote app was allowed to write it:
u:object_r:sysfs_ir_enable:s0
Yeah original.Regarding your logcat: I'm not totally sure, but it looks for me like this means the client (IR remote app) tries to use a deviceId/functionId combination (64028/0), which the QuickSet SDK doesn't know of. Are you testing with the original LeEco Remote app / QuickSet SDK service combination or are you using a different app or quickset sdk?
I'm also not sure yet where the configuration for QuickSet (remote devices and functions) actually is coming from (where it's loaded from). Maybe your versions are totally fine, but somehow the configuration is messed up (it's really hard to tell, the code is obfuscated and hard to follow).
And regarding this:
The write to "/sys/remote/enable" is done by the LeEco Remote app (package: com.letv.android.remotecontrol) not the QuickSet SDK. On the stock ROM this file had a special SELinux type assigned (sysfs_ir_enable) and it was taken care of that the LeEco remote app was allowed to write it:
Code:u:object_r:sysfs_ir_enable:s0
No source.@androcheck @darkobas
https://xdaforums.com/showpost.php?p=72297591&postcount=6
Apparently they got it working.... Of any use to us on Omni?
No source.
And considering the M solution. Probably not.
Sent from my LEX720 using Tapatalk
Will that also work on the official LOS 14.1? What steps are needed?got the stock app to work on omni! (with sepolicy enforcing ofcourse)
Eagerly awaiting your solution didnt realize how much I used IR until I lost the ability togot the stock app to work on omni! (with sepolicy enforcing ofcourse)
E/ConsumerIrService(10728): Can't open consumer IR HW Module, error: -2
D/ConsumerIrHal( 3445): transmit for 2272 uS at 37647 Hz
consumerir_module_t HAL_MODULE_INFO_SYM = {
.common = {
.tag = HARDWARE_MODULE_TAG,
.module_api_version = CONSUMERIR_MODULE_API_VERSION_1_0,
.hal_api_version = HARDWARE_HAL_API_VERSION,
.id = CONSUMERIR_HARDWARE_MODULE_ID,
.name = "Demo IR HAL",
.author = "The Android Open Source Project",
.methods = &consumerir_module_methods,
},
};
# strings /system/lib64/hw/consumerir.default.so
...
Demo IR HAL
The Android Open Source Project
...
static int consumerir_transmit(struct consumerir_device *dev __unused,
int carrier_freq, const int pattern[], int pattern_len)
{
int total_time = 0;
long i;
for (i = 0; i < pattern_len; i++)
total_time += pattern[i];
/* simulate the time spent transmitting by sleeping */
ALOGD("transmit for %d uS at %d Hz", total_time, carrier_freq);
usleep(total_time); // <<------- IT IS JUST SLEEPING, DOING NOTHING!
return 0;
}
# power on IR controller:
echo 1 > /sys/remote/enable
# power-off IR controller:
echo 0 > /sys/remote/enable
// snippet from: kernel/drivers/misc/ir_maxq616.c
if (enable == 0) {
if (irdata->power_on) {
gpio_set_value(irdata->en_gpio, 0);
irdata->power_on = 0;
}
} else {
if (irdata->power_on == 0) {
gpio_set_value(irdata->en_gpio, 1);
msleep(1500);
irdata->power_on = 1;
}
}