FORUMS
Remove All Ads from XDA

[REF] How Infrared is (not) working on LePro3 - some infos for IR devs

235 posts
Thanks Meter: 414
 
Post Reply Email Thread
12th January 2017, 09:31 AM |#21  
Quote:
Originally Posted by Swastik Raj Chauhan

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.
12th January 2017, 10:18 AM |#22  
Quote:
Originally Posted by androcheck

I really can't answer that. I am wondering myself.

Oh ok. Thats why it doesn't seem safe to me.
23rd April 2017, 02:45 PM |#23  
darkobas's Avatar
Senior Member
Thanks Meter: 9,191
 
Donate to Me
More
Quote:
Originally Posted by androcheck

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.

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.

Sent from my LEX720 using Tapatalk
The Following User Says Thank You to darkobas For This Useful Post: [ View ] Gift darkobas Ad-Free
27th April 2017, 09:44 AM |#24  
Quote:
Originally Posted by darkobas

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!
9th May 2017, 01:53 PM |#25  
darkobas's Avatar
Senior Member
Thanks Meter: 9,191
 
Donate to Me
More
Quote:
Originally Posted by androcheck

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!

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)
The Following User Says Thank You to darkobas For This Useful Post: [ View ] Gift darkobas Ad-Free
9th May 2017, 04:42 PM |#26  
Quote:
Originally Posted by darkobas

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)

Hi,
I've decompiled the QuickSet SDK and this log message only appears in this context (where "file" is the serial device file under /dev which is used to send commands to the IR system):

Code:
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!");
So this means it cannot find the tty file or has not the permissions to read/write to it (also take care of SE linux context!).
On the original stock ROM the device file /dev/ttyHSL1 is used.

Additional info:
The information which device file should be used, normally comes from the client application (which binds the QuickSet SDK service). The QuickSet service itself only defines a fallback default within its strings.xml (<string name="SerialPort_LeTV">/dev/ttyMT3</string>).

The serial device file path to use is added to the intent sent to the service (see "Port" below):

Code:
...
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);
9th May 2017, 05:01 PM |#27  
Senior Member
Thanks Meter: 134
 
More
I wrote a bit about it couple of months ago. Screenshots of 6.0 working IR logcat grabs are in this post
https://forum.xda-developers.com/sho...&postcount=117

Quote:
Originally Posted by trizex

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.

9th May 2017, 05:29 PM |#28  
Quote:
Originally Posted by trizex

I wrote a bit about it couple of months ago. Screenshots of 6.0 working IR logcat grabs are in this post
https://forum.xda-developers.com/sho...&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 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 Following User Says Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
9th May 2017, 05:35 PM |#29  
GalaticStryder's Avatar
Senior Member
Flag Porto Alegre
Thanks Meter: 4,763
 
Donate to Me
More
Quote:
Originally Posted by androcheck

@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?

Legacy HSL needs to be enabled not only for IR but for other OEM components.

The stock Kernel has introduced SERIAL_MSM_HSL_DYNAMIC_CONSOLE for that purpose.

Code:
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
To build the Kernel only, just use the minimal repo, I updated it to 7.1.2: https://github.com/GalaticStryder/omniscience
9th May 2017, 05:42 PM |#30  
darkobas's Avatar
Senior Member
Thanks Meter: 9,191
 
Donate to Me
More
Quote:
Originally Posted by androcheck

@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?

Yeah i have enabled hsl. just chmoding it didnt help.
also quickset doesnt seem to try enable the ir.... ill continue 2morrow.

Sent from my LEX720 using Tapatalk
The Following User Says Thank You to darkobas For This Useful Post: [ View ] Gift darkobas Ad-Free
9th May 2017, 05:59 PM |#31  
GalaticStryder's Avatar
Senior Member
Flag Porto Alegre
Thanks Meter: 4,763
 
Donate to Me
More
Logcat from stock ROM + Lambda
Hope this helps: https://pastebin.com/raw/0J6c27kw
Post Reply Subscribe to Thread

Tags
hal, infrared, quickset sdk, serial device

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes