[PATCH] Native WinLIRC support to XBMC for Windows
#1
Lightbulb 
Hello,

Basically yesterday I added native WinLIRC support to my XBMC compile. If anyone is intersted. I modified the IRServerSuite.cpp and IRServerSuite.h (IRSS code) as a "template" and instead of it connecting to IRServerSuite, changed it to connect directly to LIRC. It will still use IRSSmap.xml for mapping.

Since I cannot attach the code, I will provide links to them. Anytime I download the SVN, i just replace the IRServerSuite.cpp and IRServerSuite.h files with my versions. I am hoping some real devs will incorporate it.

Replacement code for IRServerSuite.cpp
http://pastebin.com/f53d83c1a

Replacement code for IRServerSuite.h
http://pastebin.com/f7e0560c1

For the record IRSS is great. Nod
Reply
#2
How does this compare with the linux-based LIRC support that is already in SVN? Can we code-reuse here?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
I'm not familiar with linux's lirc communication method. I know in windows communication is done via tcp/ip over port 8765 and doesnt directly interface with the serial port.

I did a quick glance of Lirc.cpp and would say remote code command structure recieved in both are 100% alike.

I used IRSS since its implementation was already set up for windows. Will be more than happy to provide any assistance.
Reply
#4
Right. I think the best plan of attack would be to post diffs (preferable) or the complete files in a trac report (http://trac.xbmc.org) so that we can track it and get the code reviewed etc.

Thanks!
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
I assumed that Winlirc uses the same syntax as LIRC so we might use the same code (just change the LIRC device to a windows socket).
Since I don't have any Winlirc compatible remote I couldn't test it. I would appreciate if you could hook up using the lirc code instead of the IRSS classes if possible.

Thanks,
WiSo
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#6
Question 
Does this mean that this WinLIRC implementation is an EventClient for XBMC's EventServer?
http://wiki.xbmc.org/?title=EventServer

By the way, here you find our "HOW-TO submit a patch" (prefered patch format, etc.) article:
http://wiki.xbmc.org/?title=HOW-TO_submit_a_patch

Other good to know XBMC Development Notes and References:
http://wiki.xbmc.org/?title=Appendix_D:_...ment_Notes

Wink

PS! Everyone can find out more about WinLIRC on their official website:
http://winlirc.sourceforge.net
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
WiSo Wrote:I assumed that Winlirc uses the same syntax as LIRC so we might use the same code (just change the LIRC device to a windows socket).
Since I don't have any Winlirc compatible remote I couldn't test it. I would appreciate if you could hook up using the lirc code instead of the IRSS classes if possible.

Thanks,
WiSo

The IRSS class and LIRC class are both alike. The code for both are similar (functions, definitions) which is why I used the IRSS class. The HAS_LIRC preprocessor definition in system.h in XBMC decides to use the LIRC classes + LIRC.xml for mapping under linux. Otherwise with will use IRSS classes + IRSSmap.xml.
Reply
#8
Gamester17 Wrote:Does this mean that this WinLIRC implementation is an EventClient for XBMC's EventServer?
http://wiki.xbmc.org/?title=EventServer

By the way, here you find our "HOW-TO submit a patch" (prefered patch format, etc.) article:
http://wiki.xbmc.org/?title=HOW-TO_submit_a_patch

Other good to know XBMC Development Notes and References:
http://wiki.xbmc.org/?title=Appendix_D:_...ment_Notes

Wink

PS! Everyone can find out more about WinLIRC on their official website:
http://winlirc.sourceforge.net

Thanks for the links Gamester17. I will definately look through those links which I have some spare time.

I really did not have much time in my schedule to examine all the code so but I am sure whether it underneath it uses an EventClient or mine. If I was to take a guess it would depend on whether or not the IRSS class used the EventClient. IRSS code for handing off clicks is very similar to LIRC. In fact, it seems that that the only difference between between IRSS and LIRC classes is that IRSS connects via TCP/IP and utilizes the IRSSmap.xml instead of the LIRCmap.xml.

I did not have any issues using IRSS but since I had access to the code I just decided to fiddle in order to get WinLIRC working. Since it seemed like IRSS added an additional layer of latency for user input command via TCP/IP.
- WinLirc (TCP/IP)->IRSS (TCP/IP)->XBMC (UDPHuh)
Reply
#9
Gamester17 Wrote:Does this mean that this WinLIRC implementation is an EventClient for XBMC's EventServer?

Nope. WinLirc and Lirc offers an API to request input, our EventServer waits for input afaik. Using the EventServer would require an additional program (eventclient) on the PC.

What's the plan with Lirc on Linux? Should it went into an EventClient and go out of XBMC? If yes I would propose the same for WinLirc. If not it should be an own class like Lirc but seperated from the IRSS sources.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#10
Any updates here? I really would like to have the winlirc support integrated if you could just do the requested changes.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
WiSO,

I have created new classes for WinLirc. Implementation is the same as Lirc and that means its the same as IRSSMap. Heres the problem: The IRSS class is a replacement class for the LIRC class under windows. It is determined during compile time whether to use IRSS or LIRC class for the g_RemoteControl object that handles events within Application.cpp.

If we need support for both IRSS and WinLIRC, that would probably mean WinLirc will need to be handled by the EventServer.

Unfortunately other than weekends I do not have much time to work on the code. But I will try.
Reply
#12
It's ok and take your time. TBH I didn't looked into it yet but maybe Charly has an idea?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#13
Lightbulb 
@htpcNOOB, may I suggest that you in any case submit a ticket for what you got now on trac
http://trac.xbmc.org
Then everyone can at least try to brainstorm on how to best convert it into an EventClient Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
Gamester17 Wrote:@htpcNOOB, may I suggest that you in any case submit a ticket for what you got now on trac
http://trac.xbmc.org
Then everyone can at least try to brainstorm on how to best convert it into an EventClient Wink

Added patch: http://trac.xbmc.org/ticket/4851.

I was reluctant to do so because as I've mentioned, my version replaces IRSS Shocked.
Reply
#15
Question 
@htpcNOOB, is it true that WinLIRC only supprts serial (RS232) attached IR/IrDA receivers?

If it supports USB IR/IrDA receivers, which exact version and fork(?) or WinLIRC do you use?

Huh
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
[PATCH] Native WinLIRC support to XBMC for Windows2