USB IR device

Ideas and dreaming will go this forum

nbd
Posts: 161
Joined: Wed Jan 13, 2010 12:02 pm

Re: USB IR device

Post by nbd »

Hello, what if I replace the fprintf with syscall? Or gcc would still bork the code?

Anyway, I'd be delighted if you get the system(3) thing to work. Or come up with some other way to pass that keycode, it might be usable in some other places too..
nbd
Posts: 161
Joined: Wed Jan 13, 2010 12:02 pm

Re: USB IR device

Post by nbd »

Thanks to sbav1 (for the system(3) part) now I have successfully controlled my amp volume with TV's remote. It is not yet very responsive, but it is a start. Next I'll try to drop the system(3) call and use direct library call.
nbd
Posts: 161
Joined: Wed Jan 13, 2010 12:02 pm

Re: USB IR device

Post by nbd »

Well, it turns out it's not so easy after all. I tried to load the needed .so library just before pvr.so in the loader.c, but that only caused exeDSP to dump core. I tried to load with RTLD_GLOBAL and RTLD_NODELETE flags. With RTLD_LOCAL it didn't crash but the modified pvr.so (which tries to use those functions presented in the other .so) couldn't be loaded and it complained about undefined symbol.
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: USB IR device

Post by sbav1 »

nbd wrote:Well, it turns out it's not so easy after all. I tried to load the needed .so library just before pvr.so in the loader.c, but that only caused exeDSP to dump core. I tried to load with RTLD_GLOBAL and RTLD_NODELETE flags. With RTLD_LOCAL it didn't crash but the modified pvr.so (which tries to use those functions presented in the other .so) couldn't be loaded and it complained about undefined symbol.
I think separate external daemon process linked with iguana/lirc libraries may be better solution, you can send captured keycodes to it by IPC message queue or TCP/IP socket.
nbd
Posts: 161
Joined: Wed Jan 13, 2010 12:02 pm

Re: USB IR device

Post by nbd »

Yes, that has crossed my mind, but I lack the skills to do that (I think I could cook something up, but it's going to be a long road of trial/error). Do you know btw, is it possible to detect that the key is being held down? Is there some internal variable maybe that indicates that? Also the key release should be detected.

I see exeDSP has functions like:

_ZN10CViewerApp20t_ProcessKeyReleasedEPK7PTEvent
_ZN9KeyCommon19SendKeyReleaseInputEi (<-- I think this is the relevant one)

If I could utilize the key release, then I could use lirc (it can repeat the IR command until release event occurs)

Currently I don't use lirc, because I'm able to communicate with the iguana device through its own client/daemon mechanism. I have asked the iguana developers if they could assist me on building a simple prog just to send IR signals by communicating directly to the device. Currently the daemon listens to one socket where clients send their commads. (Which brings us back to the point of trying to communicate with sockets...)
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: USB IR device

Post by geo650 »

nbd wrote:_ZN9KeyCommon19SendKeyReleaseInputEi (<-- I think this is the relevant one)
Maybe I will not help you much, but I wanted to tell you, that you are absolutely right! This function is called every time a remote control button is released. I am going to use it in Atari800 emulator (port) release 2. Thanks.
nbd
Posts: 161
Joined: Wed Jan 13, 2010 12:02 pm

Re: USB IR device

Post by nbd »

Maybe I will not help you much
Actually you did! By using your code from the atari port, I can utilize the key release. Gotta try someday..

Post Reply

Return to “[B] Brainstorm”