On Tue, Feb 1, 2011 at 12:23 PM, Dave Treacy <davetreacy@...> wrote:
> On Tue, Feb 1, 2011 at 2:27 AM, Jarod Wilson <jarod@...> wrote:
>> On Jan 31, 2011, at 7:49 AM, Dave Treacy wrote:
>> > Hi All,
>> > Firstly I want to give my appreciation of what you guys are doing. You should have seen the smile on my face the first time I booted a distro and the remote worked out of the box! And worked really well!
>> > but alas I have a power-on issue. that is it - and I cannot find a fix for it.
>> > I have honestly waited a few months before getting to this point. I have tried many different distro's (mainly live cd's as I don't want to ruin the wife's approval factor!) I have tried fedora 14 live, ubuntu 10.10 live, xbmcfreak-10.10 builds and the awesome superfast booting openelec.tv build.
>> > I have recently tried (and failed miserably) getting back in touch with my friend the old c compiler and taking just the wakeup routines (nvt_enable_wake etc) from Jarrods code into a little tool that was to set the wakeup registers. I was promptly told by my mate cc that I'm only allowed to mess about in user space, and kernel space is not something for me. I did this as a bit of trial and error to work out if something was not allowing these registers to be set.
>> > I have also tried heaps of different solutions like echo USBx> /proc/acpi/wakeup, echo CIR> /proc/acpi/wakeu, crawled through this list looking for asrock/nuvoton/power etc. posted on forums etc.
>> > One strange thing is that I have only found 2 other people with this problem. I am putting this down to everyone sticking to older or official xbmc builds with asrock drivers.
>> > I really hope I've missed something super simple! If I have feel free to hurl abuse!
>> Nah, there's an issue with the nuvoton-cir driver somewhere, and the wake
>> register is getting cleared out and not repopulated. Fixing it is on my
>> TODO list, I just haven't got to it yet.
>> Jarod Wilson
> Ahh thanks for giving me back my sanity!
> Now that its confirmed, I might have a poke around and see if I can
> find the problem.
Hi Jarod / all
Short story: So I've got it working. Changed CIR_WAKE_FIFO_LEN to 65
I've been poking about in the code for a week or so now, without any
luck - until last night. I've compiled a copy of openelec.tv for my
asrock minus the nuvoton-cir module so I could compile the module
separately for testing.
While putting everything back in the lounge room (so that everything
is working for the morning), I accidentally booted this custom
openelec. So naturally I shut it down & removed the media. Then for
some reason I hit the power button on the remote. Now I'm not sure
why I did that - It was late. But it booted.
So tonight, I commented out all instances of
nvt_cir_wake_regs_init(nvt), and nvt_enable_wake(nvt) and it works.
Perfectly. Powers on and resumes from suspend perfectly. After
thinking about it, it makes sense, you want your gear to power on
after a power outage!
so I ran the module working and not working with debugging enabled and
the differences are:
nuvoton_cir: * IRSTS: 0x41
nuvoton_cir: * FIFO CMP DEEP: 0x41
nuvoton_cir: * RD FIFO ONLY: 0x89
nuvoton_cir: * RD FIFO ONLY IDX: 0x7
nuvoton_cir: * IRSTS: 0x1
nuvoton_cir: * FIFO CMP DEEP: 0x43
nuvoton_cir: * RD FIFO ONLY: 0x11
nuvoton_cir: * RD FIFO ONLY IDX: 0x8
I found some references to 0x41 in the nuvoton lirc code, and saw that
they are setting the FIFO CMP DEEP register to 65 (0x41) instead of 67
Changed CIR_WAKE_FIFO_LEN to 65 in nuvoton-cir.h, removed comments,
complied and its all working again! Not sure why IRSTS is also set to
0x41, doesn't seem to matter.
Sorry for the long story :) Jarod, I hope this helps - at least its
removed 1 thing off your seemingly infinite TODO list! I've also no
idea how to get this fix into/onto/patch/svn/git etc or anything. :)
This was the only issue holding me up from deploying openelec.tv's
awesome XBMC distro. I'm all good to go now!
Cheers again for the code!,