jernejsk / OpenELEC-OPi2

OpenELEC - The living room PC for everyone
http://openelec.tv
87 stars 25 forks source link

Add power button support #12

Open gitchomik opened 8 years ago

gitchomik commented 8 years ago

More info in threads http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=940 and http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=817

Regards !

jernejsk commented 8 years ago

If somebody creates good pull request or patch I will consider it.

warik-zp commented 8 years ago

I found a solution: In script.bin: [wakeup_src_para] wakeup_src_bt = port:PL03<6><0>

[gpio_power_key] key_used = 1 key_io = port:PL03<6><0>

Code screenshot: https://imgur.com/WErESa8

Kernel with option: System Type -> Homlet platform bootup extend Device Drivers -> Input device support -> Keyboards -> sunxi IR RX support Device Drivers -> Input device support -> Keyboards -> gpio key for H3 prototype

jernejsk commented 8 years ago

sunxi IR RX is not strictly needed, only for turning it on/off with IR remote? I will port suspend/resume support to new IR driver in the future, I don't intent to go back to NEC only driver.

warik-zp commented 8 years ago

I'm talking about the power button. If use this option, we can add support power button?

jernejsk commented 8 years ago

I don't see logical connection between IR driver and power button. I also checked this IR driver code and still can't see the connection.

warik-zp commented 8 years ago

Oh. Sorry. This method add solution power on from IR and button.

jernejsk commented 8 years ago

Can you check if power button now works? Don't forget to clear u-boot first so script.bin gets recompiled.

warik-zp commented 8 years ago

Oaky. I'll try and let you know.

galeots commented 8 years ago

fix power button!?

jernejsk commented 8 years ago

Sorry, no. I will fix this when I will have nothing else to do. I spent too much time for this already.

galeots commented 8 years ago

Once solved this program is complete!

llonca13 commented 8 years ago

@jernej thanks for everything

To be honest i dont mind this power button/ir bug,if you can fox it great if no ill just leave it as a 0-24 working htpc/mysql library server :)

jernejsk commented 8 years ago

I highly suspect that this bug resides somewhere in graphics stack, but I have no idea how to locate it. I will first try to fix some issues in Kodi and later try to fix it again.

llonca13 commented 8 years ago

Hvala :)

llonca13 commented 8 years ago

You fixed itttt :) I tried the new version(25 april) and it works..i dont know for the ir because i have orangepi one..but the button works perfectly..shutdown in kodi puts it in suspended state(with the red light glowing) which is in my opinion alot better then turning it off :) And i also noticed the system info show correct amount of memory now

Thank you soooo much jernej I think this issue can be closed now Thank you

jernejsk commented 8 years ago

Are you pretty sure? It seems that it doesn't work on my OPi2. I need more reports...

llonca13 commented 8 years ago

yes im sureee :dancers: :) sorry to hear about your Opi2 but on Opi One you fixed the problem.

heres video : https://www.youtube.com/watch?v=wu8Ong0On2Q

jernejsk commented 8 years ago

Good for you, but I won't close it until it works reliably for everyone.

jernejsk commented 8 years ago

@galeots or anyone else, can you confirm that suspend/resume using button almost works IF there is NO USB mouse/keyboard connected?

galeots commented 8 years ago

@jernejsk Tomorrow I try to compile if I have time I'll tell you

galeots commented 8 years ago

@jernejsk The suspension goes without any connected USB devices. sata no longer working in the new version

jernejsk commented 8 years ago

@galeots, SATA can be fixed, just wait few days till I get back to my OPi.

In the mean time, I think I found the issue with USB. Please check issue #41 and test opiplus.fex change described there.

galeots commented 8 years ago

@jernejsk you can make sure that when goes in suspension turns off the fan !?

jernejsk commented 8 years ago

FAN is not official addon, so I wouldn't put this in image. I can help you with that on the forum. This is a bit off topic.

galeots commented 8 years ago

@jernejsk thx

jernejsk commented 8 years ago

@galeots Did you test fix in #41 ?

galeots commented 8 years ago

@jernejsk not work fix boot erase PG11 for sata

galeots commented 8 years ago

@jernejsk how are the works for fix the power button?

jernejsk commented 8 years ago

It works as long as you don't use USB hub with attached devices. This unfortunatelly means that you should not use USB devices on OPi2 and OPiPlus. You can use IR remote for a workaround.

galeots commented 8 years ago

@jernejsk but the bug has what is due !?

jernejsk commented 8 years ago

Sorry, I don't understand what you mean. Button works. The only issue is USB driver which hangs at suspend if there is hub with device connected.

galeots commented 8 years ago

@jernejsk the bug is due because usb does not suspend !?

jernejsk commented 8 years ago

Yes, I will close it once there will be no known problems with suspend / resume cycle.

galeots commented 8 years ago

@jernejsk however if you do leave without USB peripherals work suspension! if you take away and put USB peripherals and suspend doesn't go

jernejsk commented 8 years ago

That is what I'm saying. You have Plus. If you would have PC or One, you wouldn't have any of those problem.