1 1
wyzco

Le Potato Wake/Power ON by IR Remote

Recommended Posts

Good Morning,

I would like to Power ON or Wake the Board by IR Remote.
However I cannot find instructions anywhere on how to enable the IR wake or what the code is for wake etc.

Can you please point me in the right direction?

From: https://loverpi.com/blogs/news/first-look-at-libre-computer-board-aml-s905x-cc-le-potato-hardware-overview

it states: 

Quote

Other great features include the IR receiver. You can set the IR receiver to wake the board up with remotes provided you set the software bits up.

 

IR Shutdown works but then I cannot wake the board by IR.

Thank you for any help and for all the time the developers donate to this.
Much appreciated.

Share this post


Link to post
Share on other sites

Hi,

 

I guess in order to receive the wake up signal, some parts of the board must be powered. Where the little bit weird note here for Image 8 playes a role, but is it now an issue or is it fixed @Da Xue ?

 

Quote

Some known issues with this release and additional improvement work:

  • shutdown/suspend/wakeup

 

I am also wondering if the receiver does work with  NEC  and  Philips protocol, depending on the driver/software?

 

Share this post


Link to post
Share on other sites

@Tido It needs microcode for the Cortex M chip to support suspend and then a lot of software work to get out of it. It will be quite a while before that kind of work gets mainlined if at all.

Share this post


Link to post
Share on other sites
On 5/28/2018 at 10:01 AM, Tido said:

does work with  NEC  and  Philips protocol

on the libre computer board CPU schematic I found an IRM-3638N3 Remote control receiver.

Is this correct:

  • 38 kHz

The most commonly used protocol is the NEC protocol, which specifies a carrier frequency of 38 kHz. The NEC protocol is used by the vast majority of Japanese-manufactured consumer electronics.

The Philips RC-5 and RC-6 protocols both specify a carrier frequency of 36 kHz.


If I attach an USB-IR-Receiver (SMK in the picture), is it possible to 'turn off' the onboard ir-receiver?   How would I do that?

 

ir-receiver_and_remote_rc6.thumb.jpg.4e0bc5cfcacdfce0b13ec0fe6de21dcb.jpg

 

 

And this is what the output looks like:

root@amlogic:~# dmesg 
[  417.797405] usb 1-1.3: new full-speed USB device number 5 using xhci-hcd
[  417.898973] usb 1-1.3: New USB device found, idVendor=0609, idProduct=031d
[  417.898999] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  417.899013] usb 1-1.3: Product: eHome Infrared Transceiver
[  417.899027] usb 1-1.3: Manufacturer: SMK
[  417.899040] usb 1-1.3: SerialNumber: SM006evO
[  417.957099] Registered IR keymap rc-rc6-mce
[  417.957426] input: Media Center Ed. eHome Infrared Remote Transceiver (0609:031d) as /devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3:1.0/rc/rc0/input5

[  417.958052] rc0: Media Center Ed. eHome Infrared Remote Transceiver (0609:031d) as /devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3:1.0/rc/rc0

[  417.962495] IR NEC protocol handler initialized
[  417.964607] IR RC5(x) protocol handler initialized
[  417.967217] IR RC6 protocol handler initialized
[  417.967218] IR Sony protocol handler initialized
[  417.969599] IR JVC protocol handler initialized
[  417.970533] IR SANYO protocol handler initialized
[  417.970687] input: MCE IR Keyboard/Mouse (mceusb) as /devices/virtual/input/input6
[  417.972695] lirc_dev: IR Remote Control driver registered, major 219 
[  417.974693] IR MCE Keyboard/mouse protocol handler initialized
[  417.975527] rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0
[  417.975546] IR LIRC bridge handler initialized
[  418.197098] mceusb 1-1.3:1.0: Registered SMK eHome Infrared Transceiver with mce emulator interface version 1
[  418.197110] mceusb 1-1.3:1.0: 2 tx ports (0x0 cabled) and 2 rx sensors (0x0 active)
[  418.197194] usbcore: registered new interface driver mceusb



root@amlogic:~# lsusb 
Bus 001 Device 005: ID 0609:031d SMK Manufacturing, Inc. eHome Infrared Receiver

 

 

Share this post


Link to post
Share on other sites

well, I would need to spend some time playing with it, but I doubt the notch filters on those are so amazing that they don't see +/- 2 khz difference in carrier frequency, probably the reason for grabbing a 38 kHz, the other options look like 36 and 40 kHz.  I would need to sit down with one and play with it for a while to be sure though.

Share this post


Link to post
Share on other sites

@Tido because of this issue with the IR being linked to the closed-source blobs (wakeup/suspend stuff), Khadas used a separate micro controller to handle those functions.  It doesn't look good.

Share this post


Link to post
Share on other sites
On 6/2/2018 at 5:24 PM, TonyMac32 said:

I doubt the notch filters on those are so amazing that they don't see +/- 2 khz difference in carrier frequency

Good question, at least according to the data sheet you can get it likewise - let's assume they are so amazing (I watched the log while clicking with the RC6 remote control - not one biep).

Would it make sense to find out "how to turn off" the onboard receiver  and  how to attach (make use of) an external USB ir-receiver like the one on the picture?

Or is this a waste of time (turn off onboard)  - as long as there are no interference with other remotes?

 

4 hours ago, TonyMac32 said:

Khadas used a separate micro controller

Tony, thank you for your investigation. So you found out about a sad and smart move in one.

Sad: it was less of a hassle (or cost) for Khadas to add an additional chip instead of getting Cortex M chip to take care of that tasks in standby (suspend).

Smart: they found a way to give the customer what they are looking for, like it was a product from one of the big players in streaming-business

 

Share this post


Link to post
Share on other sites
On 6/4/2018 at 3:27 AM, Tido said:

Good question, at least according to the data sheet you can get it likewise - let's assume they are so amazing (I watched the log while clicking with the RC6 remote control - not one biep).

Would it make sense to find out "how to turn off" the onboard receiver  and  how to attach (make use of) an external USB ir-receiver like the one on the picture?

Or is this a waste of time (turn off onboard)  - as long as there are no interference with other remotes?

 

Tony, thank you for your investigation. So you found out about a sad and smart move in one.

Sad: it was less of a hassle (or cost) for Khadas to add an additional chip instead of getting Cortex M chip to take care of that tasks in standby (suspend).

Smart: they found a way to give the customer what they are looking for, like it was a product from one of the big players in streaming-business

 

It is a matter of time and money to get the standby implementation completed in mainline. Currently there are much higher priorities. Reducing the power consumption from 0.8W to 0.1W does have interesting applications. With a secondary MCU (not based on Amlogic's design), you would have to keep some out-of-tree power management code that is different from every other board in mainline. There are benefits and costs to that design decision although I don't think the MCU cost that much.

Share this post


Link to post
Share on other sites
6 hours ago, Da Xue said:

Reducing the power consumption from 0.8W to 0.1W does have interesting applications.

Are you refering to this Cortex M inside of s905x ?

Power Management

  • Power management auxiliary processor in a dedicated always-on (AO) power domain that can communicate with an external PMIC
  • Multiple external power domains controlled by PMIC, and internal ones controlled by software
  • Multiple sleep modes for CPU, system, DRAM, etc.
  • Multiple internal PLLs for DVFS operation
  • Multi-voltage I/O design for 1.8V and 3.3V

Is there no code at all to go to standby and turn on again ?

Share this post


Link to post
Share on other sites
On 6/13/2018 at 9:23 AM, Tido said:

Are you refering to this Cortex M inside of s905x ?

Power Management

  • Power management auxiliary processor in a dedicated always-on (AO) power domain that can communicate with an external PMIC
  • Multiple external power domains controlled by PMIC, and internal ones controlled by software
  • Multiple sleep modes for CPU, system, DRAM, etc.
  • Multiple internal PLLs for DVFS operation
  • Multi-voltage I/O design for 1.8V and 3.3V

Is there no code at all to go to standby and turn on again ?

I am referring specifically to the Khadas VIM. It uses a proprietary power sequence that is different than the Amlogic reference design (p212). That means if we sponsor work for mainline Linux support of suspend and resume of reference platforms, that code may or may not work for the VIM and it may require extra code has to be implemented specifically for their design.

Share this post


Link to post
Share on other sites
3 hours ago, Da Xue said:

Khadas VIM

I am not interested in this VIM, I have a Le Potato. I was just answering to TonyMac's comment.


 

Let's return to Le Potato. To use suspend/standby

On 5/29/2018 at 8:32 AM, Da Xue said:

It needs microcode for the Cortex M chip to support suspend and then a lot of software work to get out of it.

is there a binary Blob available that we could talk to, to use suspend or standby ?

 

Share this post


Link to post
Share on other sites
On 6/15/2018 at 2:42 AM, Tido said:

I am not interested in this VIM, I have a Le Potato. I was just answering to TonyMac's comment.

 


 

Let's return to Le Potato. To use suspend/standby

is there a binary Blob available that we could talk to, to use suspend or standby ?

 

It is probably in Amlogic's openlinux BSP.

Share this post


Link to post
Share on other sites

The wakeup from power-off is indeed managed by the Cortex-M processor with some code loaded in the boot time.

This code can be modifier and is present in amlogic's u-boot source :

https://github.com/BayLibre/u-boot/blob/n-amlogic-openlinux-20170606/board/amlogic/gxl_p212_v1/firmware/scp_task/pwr_ctrl.c#L184

 

But, it's linked to the Amlogic kernel implementation, and supporting it with mainline linux will need some work.

Share this post


Link to post
Share on other sites
15 hours ago, Neil Armstrong said:

The wakeup from power-off

May I ask some question  :-)

  • I guess in order to wake up the board, it must be able to go into suspend/standby mode on Cortex-M (A53 part is off) is you meant by power-off, right?
  • The code you link above (pwr_ctrl.c) has to be in the Linux Kernel ?
  • The code you link above (pwr_ctrl.c) must be referenced in the U-Boot ?

 

Share this post


Link to post
Share on other sites

Power-Off and Suspend is managed by the same code.

 

The code I linked is build in the "FIP" binaries packages with U-boot, these can be changed to match the platform. It's technically part of u-boot, but is build in the same time in the amlogic source tree.

 

Under Linux, each driver would need to setup the registers to permit the Cortex-M3 to acknowledge the inputs and wakeup.

Share this post


Link to post
Share on other sites
On 6/21/2018 at 5:27 PM, Neil Armstrong said:

and supporting it with mainline linux will need some work.

In order to have proper HW support (for KODI for example) I am running an older kernel: config-3.14.29

Is it easier to implement it there or about the same ?

 

Share this post


Link to post
Share on other sites

I found something on the internet that I add here for the collection.. once someone get to it

 

a kernel setting implements ‘shutdown’ as a special reboot variant setting an u-boot flag. When you power down your device it reboots into u-boot, turns off almost everything and only the OpenRISC core inside the SoC remains active with minimal power consumption if your power supply is efficient.

Then you define wakeup sources (power button, IR, even BT or Wi-Fi are possible but this is all device dependent and you have to define the stuff correctly in the so called sys_config.fex) and as soon as such a wakeup event is triggered (press the power button on your IR remote) the OpenRISC core wakes the ARM cores and Android or Linux boot normally.

 

Share this post


Link to post
Share on other sites

I would guess there are some similarities between the Allwinner method and the Amlogic one, both using a small mcu to handle the laundry and cooking.  ;-)  But, a look at the Amlogic kernel would be the most certain way to know

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1