What are my plugin development options for XBMC for Linux?
#1
Hi, I hope i've landed in the right forum for this but here it goes...

I've looked through all documentation I could find on the wiki and such and what I want to do is create a plugin for xbmc on linux wich would give better support for the WiiRemote, mostly because I'd like to understand the innerworkings of XBMC so I can develop other plugins... and for the fun of it ofc Smile
From what I've understand there are 2 options for plugins in XBMC
1: Plugin script/plugin wich would then load and handle the wiiremote, although this is from my viewpoint not ideal because I'd like to have some visual conformation of planned gesture support. Also even the simples infinte loop wouldn't work, but this might be an error of mine. But the idea is that the plugin runs always (if choosen) and that doesn't seem to be the idea behind the python scripts.

2: make a dll wrapper for my lib and load it in DllLoader and then hardcode support for it into xbmc. But this does not seem the smartest option because I want the plugin to be a plugin. Not any hardcoded extras of the XBMC source.
Although this may be circumvented by loading needed things when the dll is loaded and then just rely on eventbased program (wich cwiid supports).

The thing I wanted were a more definite plugin system, with a set of common functions and interfaces wich would automaticly load when needed, as a usual plugin works. ex Miranda, anything C# based, Media portal.

Is there something i've missed? Is there already plugins with open source wich i could look at? I excuse myself if I step on a thin thread here but I'm very new to XBMC and therefor I hope you can mind the newbie questions Smile
Reply
#2
XBMC doesn't really have a general purpose Plugin API, atleast not that I'm aware of
Afaik, we only have 2; MusicVisualization and Screensaver

What you want is a more general purpose API, this approach has it's advantages and also clear disadvantages. Why don't you look into coding this support into the main app itself ? You only need SVN write access if you want to add it to our SVN tree, but a patch works just as well
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
Did you read through these two previos topic threads?:
http://forum.xbmc.org/showthread.php?tid=27622
http://forum.xbmc.org/showthread.php?tid=30192

I think for the WiiRemote (and also the PS3 gamepad) I think it would be better if you add native support to XBMC (or the Linux distrobution that XBMC runs on) for it/them via a Linux bluetooth library/package and a C/C++ module for that device, ...(I'm not sure though if that module should be added to be built-into XBMC or be compiled into the Linux kernel).

I think best is if you look at how the Linux kernel developers added Xbox gamepad (a.k.a. XPAD) support to the kernel and how the Xbox 360 gamepad module (the modified XPAD module not yet integrated into the official Linux kernel).

...the big difference is that WiiRemote and the PlayStation 3 gamepads are wireless using bluetooth
http://wiki.bluez.org/wiki/
http://en.wikipedia.org/wiki/Bluez
http://en.wikipedia.org/wiki/Bluetooth
http://en.wikipedia.org/wiki/Bluetooth_protocols
http://en.wikipedia.org/wiki/Bluetooth_specification
http://en.wikipedia.org/wiki/Bluetooth_profile
Quote:BlueZ is the official Bluetooth stack for Linux. Its goal is to make an implementation of the Bluetooth wireless standards specifications for Linux. As of 2006, the BlueZ stack supports all core Bluetooth protocols and layers. It was initially developed by Qualcomm, and is available for Linux kernel versions 2.4.6 and up.

In addition to the basic stack, the Bluez-utils and Bluez-firmware packages contain low level utilities such as dfutool which can interrogate the Bluetooth adapter chipset to determine whether its firmware can be upgraded.
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
#4
Well cwiid is the library for wiiremote and it is just a apt-get away in both gutsy and hardy, think feisty to actually. Bluez is built in the kernel.

Do you mean that linux would handle them and xbmc would treat them as mouse/joystick? no exceptions?

Or you mean a more hardcoded implementation? the later is better as I pictured it.

I've read through the thread with the wiiremote. It gets the job done but my idea were that I wanted to have some some visual confirmation of the gestures, and this would have to be rendered in XBMC, if anyone have played Quake wars they find the likeness to the quick chat.
I wanted to have the A button bring up a quick meny wich have 3 zones, 1 up, 1 left and 1 right and to use this is alike the quick chat for quake wars.
press and hold the A-Button and move the wiimote to the right (enough the enter that zone) and then release the A-button, this would trigger the next item.

alike controls would be with the plus and minus buttons but these would have a different (exactly the same working) meny.
Abutton:
up = PlayPause
left = Previous Item
right = Next Item

Minus-button
up = mute
left = Lower Volume
Right = Raise Volume

Plus-button
Up = ?
Left = Seek Back
Right = Seek Forward

These solutions would bring quite easy and intuitivt use of the motion detection.
Here's some fast and not very beautifull mockups
Image
As you can see here is Pause selected and awaiting the release of the A-button.

I couldn't find any you tube videos showing of the quake wars version but it's really handy and it takes seconds to get the hang of.

This idea would only be apropriate in fullscreen mode, movie pictures or music.


Most people don't have the wiiremote and thats why I figured plugin would be best but I'm not certain how xbox gamepads are handled in xbmc and I'll look through the code and see what I can find.
Reply
#5
Gamester17 Wrote:Did you read through these two previos topic threads?:
http://forum.xbmc.org/showthread.php?tid=27622
http://forum.xbmc.org/showthread.php?tid=30192

I think for the WiiRemote (and also the PS3 gamepad) I think it would be better if you add native support to XBMC (or the Linux distrobution that XBMC runs on) for it/them via a Linux bluetooth library/package and a C/C++ module for that device, ...(I'm not sure though if that module should be added to be built-into XBMC or be compiled into the Linux kernel).

Darn, I read the second to fast and didn't read it carefully Smile

Uhm the wiiremote is supereasy to have linux support for and shipped with xbmc when it has it's own live cd. Bluez already shipped with the kernel and
cwiid is kind of greatly developed. It has bindings with python / C# and C. Wich makes it super easy to use in XBMC. The only prob. is that it's linux only, although this could be fixed with making a dll wich is OS/specific but has the same functions and calls inside XBMC, so it wouldn't matter.

I hope I haven't missunderstood anything and perhaps said something not already known Smile (I'm tired, just got home from work)
Reply
#6
Smile 
Topfs2 Wrote:Or you mean a more hardcoded implementation?
Yes I meant that you should hardcode it into XBMC, (however depend on cwiid package being installed), but customizable via keymap.xml
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
Well this got a bit delayed because of the holiday but i've searched around and there is some choices for this and one is to have cwiid's own written input handler wich works kind of great. It does what needed and sends a keyboard command when said button on the wiiremote. This is almost good although it will mess up the keyboard commands, it works but not perfect, not in my opinion.

I'll fiddle around and see if maybe it can be perfect with no real hardcoding although I've written some code wich would make XBMC the server role instead of an extra app.

Probably easiest way to go is the first, although the second seems more stable as you may use keyboards in conjunction with the wiiremote, with mapping capabilities on both.

I'll see if I may be able to mimic the sdl joystick way otherwise, although this isn't the way cwiid is "normaly" but it could perhaps be done likeso in XBMC so the keymap.xml would read
<joystick name="Wiiremote">
this may be a later issue
could equally be
<wiiremote> Smile
Reply
#8
Oh forgot to say.
For those who wish to try the cwiid input way may do like this.
for 7.10
sudo aptitude install libcwiid0 lswm wmgui wminput

start wminput by typing
sudo wminput -c ir_ptr

if you want this to be an always on thing to reconnect to the wiiremote if disconnected

sudo wminput -d -c ir_ptr

Oh, for those of you with no sensorbar
skip "-c ir_ptr" to have it change the mousecursor with acceleration data instead

Although you really need to fiddle with the settings and I'll probably will post one that works good here

Sources:
https://help.ubuntu.com/community/CWiiD
http://ubuntuforums.org/showthread.php?t...put&page=1
http://abstrakraft.org/cwiid/wiki/wminput
Reply
#9
Wink 
Topfs2 Wrote:the second seems more stable as you may use keyboards in conjunction with the wiiremote, with mapping capabilities on both
The use of a standard USB keyboard is clearly a requirement for it to have a chance of being implemented into our official branch of XBMC, ...and it would have to nativly integrate into XBMC (so try to avoid too dirty hacks will you)
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
Ok, I have written all that I need to have the wiiremote to be natively supported!

Although, I am in a bit of a problem with SDL_Threads as it isn't working with member functions, how does XBMC solve this generally? I cannot find a thread manager of some sort? if someone could point me in the right direction I have a patch ready in no time Smile

The reason for threads is that the wiiremote cannot initialize the connections therefor i need the host to just poll for the wiiremote. this is the best solution I've found to this problem as of yet but I'll look around some more.
Reply
#11
By the way, it doesn't override the keyboard or anything. You just edit the keymap.xml with for example this information:

<wiiremote>
<a>Select</a>
<left>Left</left>
<b>PreviousMenu</b>

<right>Right</right>
<up>Up</up>
<down>Down</down>
<plus>VolumeUp</plus>
<minus>VolumeDown</minus>
<home>XBMC.ActivateWindow(Home)</home>
<one>XBMC.ActivateWindow(Home)</one>
<two>Up</two>
</wiiremote>


although the mouse part is harder because from what I can tell XBMC doesn't support multiple mouses (for obvious reasons) therefor the Wiiremote will override the mouse temporary whilst there are IR sources nearby. If it's used in short. Although this doesn't mess up the mouse in any way and is as carefully integrated as possible.
I've added support for it to be able not to utilse the IR capabilities if one would like to use the wiiremote as a more normal gamepad.
Reply
#12
Wink 
Topfs2 Wrote:I am in a bit of a problem with SDL_Threads as it isn't working with member functions, how does XBMC solve this generally? I cannot find a thread manager of some sort? if someone could point me in the right direction I have a patch ready in no time
You are probably best of asking in the XBMC Linux port development channel on IRC:
http://www.xboxmediacenter.com/wiki/?tit...ct_methods

there you should be able to catch most of the other XBMC for Linux developers:
http://www.xboxmediacenter.com/wiki/?tit...developers
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
What are my plugin development options for XBMC for Linux?0