Possible to run irexec with xbmc standalone?
#1
Question 
I've recently moved to running XBMC standalone (9.11 stable) on Ubuntu 9.04. However, when I did so, I lost the ability to autostart irexec like I do when my gnome session starts. (which means a few of my custom mapped IR commands that use irexec don't work in standalone).

Is it possible to autostart irexec when running XBMC in a standalone session?

I realize this is probably a Linux noob question, but I've Googled without luck and would appreciate a pointer.

Thanks in advance.
Reply
#2
myrison Wrote:I've recently moved to running XBMC standalone (9.11 stable) on Ubuntu 9.04. However, when I did so, I lost the ability to autostart irexec like I do when my gnome session starts. (which means a few of my custom mapped IR commands that use irexec don't work in standalone).

Is it possible to autostart irexec when running XBMC in a standalone session?

I realize this is probably a Linux noob question, but I've Googled without luck and would appreciate a pointer.

Thanks in advance.

I love answering my own questions Big Grin, so I'll update this here for future Googlers. Also note that it turned out I needed to start irxevent (not irexec), which is what the code below does.

One thing that threw me off initially is that for some reason, xbmc-standalone appears to be installed in two locations on my machine after adding the xbmc-standalone package to ubuntu. The location that requires customization to launch other services with the xbmc-standalone session is:

/usr/local/bin/xbmc-standalone

open this file for editing via:
Code:
sudo nano /usr/local/bin/xbmc-standalone

Then, ensure that line in blue is added into the file:

Code:
#!/bin/sh

[color=blue]irxevent &[/color]

if which pulse-session; then
  pulse-session xbmc --standalone "$@"
else
  xbmc --standalone "$@"
fi

Control+X saves the file once you've edited it. Restart the session (or reboot) and then run "ps -ef" from the terminal when you've rebooted to confirm that you see irxevent running in the list of processes.
Reply
#3
Hi!

Although this post is rather old I ll maybe have some luck with you guys.

I am trying to start irxevent on my XBMCLive installation to use my remote in Ultrastardx(with Execuer plugin) but I cant get it work...Sad

When I try to start irxevent (-d) I get " Can't open DISPLAY."

XBMC runs in standalone!

I already tried to add irexevent & in /usr/bin/xbmc-standalone but without success!

What do I have to do to get work? Huh
Any ideas?

Thanks in advance.
Reply
#4
Did you follow the steps immediately above and that didn't work?

Also check out my blog as I've recently written a lot about starting, autostarting, resuming irxevent and irexec (which are probably better solutions than the one above, but a bit more involved).
------------------------------------------
Dharma Quick Setup Guide:
XBMC tips on the TechNazgul Blog
------------------------------------------
Reply
#5
Hi!

Wow, that was a fast answer... =)

Yes, I followed your steps from above but in my case it looks a bit different.

Code:
/usr/bin/xbmc-standalone
in comparison to
Code:
sudo nano /usr/local/bin/xbmc-standalone
from your post

also the code from my xbmc-standalone looks a bit different.

Autostarting irxevent didn't the trick either. I tried to start it through rc.local and I tried also to
Code:
irxevent /home/xbmc/.lircrc &
(for testing purposes I just run this via console; I don't think its necessary to have it in autostart-is it?)
but whenever I do so I get "Can't open DISPLAY".
I do not have any troubles starting irexec.

I mean I am quite fresh to Linux but from my point of view the problem is that when ever I try to start irxevent I get
"Can't open DISPLAY"
Somewhere on the internet I ve read that irxevent needs a window manager and afaik XBMCLive is shipped without one. So I installed Xfwm4 but that did not help either...


Any ideas?

thanks
Reply
#6
If you are running xbmclive you probably want to move
Quote:irxevent &

to the runXBMC script. Where in the sequence I have no idea.

You could also try irxevent -d
It was a long time since I run this but I dont recognize (-d).

If you are testing on one consule and xbmc is running on another when you get the display problem you need to stop doing that or export display.
Reply
#7
Hi!

vikjon0 Wrote:If you are running xbmclive you probably want to move


to the runXBMC script. Where in the sequence I have no idea.
.

As far as I can remember I tried to start it from there also, but I am at work at the moment so I can no doublecheck it...

Code:
I dont recognize (-d).
of course I did not use the brackets.I just was to lazy to write both - sorry!
I tried either irxevent or irxevent -d

Quote:If you are testing on one consule and xbmc is running on another when you get the display problem you need to stop doing that or export display
that sounds as it could to the trick...Nod
XBMC runs on tty7(default) and I am connected either via ssh or to tty1.
How can I get irxevent to run on the correct console?
Would it be ok to put the irxevent start script to a button on the remote and start it with irexec?

thanks again
Reply
#8
Hmm, I admit, I'm stumped. As I looked at my own config with Dharma (I'm now running xbmc-live), I realized that I'm not using irxevent at all. When I try the command I also get the same error and everything I read makes it sound like it does rely on something like Gnome/KDE/etc (which is not included with live) so that it can send commands to a specific window opened up by the GUI.

Not to dissuade you from what you are doing, but are you sure that you can't do what you want to do with irexec?
------------------------------------------
Dharma Quick Setup Guide:
XBMC tips on the TechNazgul Blog
------------------------------------------
Reply
#9
Hey!

To be honest I dont know whether irexec is sufficient...
What I want to do is to control Ultrastardx with my remote. I start Ultrastardx via Executer plugin.
I ll try if it works with irexec either but I think I can remember that if you want to send a command to specific application you need to get irxevent(I think I read that somewhere). Maybe or even hopefully I am wrong.
I ll let you know as soon as I have tested...
Reply
#10
Hey!

Ok, I tried several things but unfortunately I cant my remote to with ultrastardx.
As I already mentioned I start ultrastardx via executes plugin.
I disable lircd through executer plugin setting before ultrastardx gets started.
My .lircrc contains the following:
Code:
begin
      prog = irexec
      remote = Antec_Veris_RM200
      button = KEY_LEFT
      config = Key Left
      repeat = 0
      delay = 0
   end

Is that ok? Huh
Is there something I can do to proof if irexec runs properly?


thanks
Reply
#11
ps aux|grep irexec

will tell you if it's running... and just to be sure, note that a response like this:
<user> 8892 0.0 0.0 6160 696 pts/6 S+ 20:01 0:00 grep --color=auto irexec

does NOT mean that it's running. That's just telling you that your search for irexec is running. If you get a line back showing another process and PID, then it is running.

Now, to another question, what exactly is the script above supposed to do? The way I've seen this be used in the past is that "config" calls a script that performs a specific set of actions. Button should be an actual irw command from your remote, which I'm assuming KEY_LEFT is, but "Key Left" as the action has me confused.

Where is 'key left' defined? I'm not sure that's going to work as written as I don't think the system is going to know what to do with it. If ultrastar dx doesn't have any sort of remote support built in, this might be a fruitless effort for you. Maybe you could buy a USB wireless keyboard and just use that? (I have no idea what ultrastar dx does and am too lazy to look it up, so if the keyboard doesn't make sense, we can keep hacking away at this)
------------------------------------------
Dharma Quick Setup Guide:
XBMC tips on the TechNazgul Blog
------------------------------------------
Reply
#12
Hi!

Sorry for my late answer, but there were several parties I had to attend Cool ...

Ok, irxexec is definitely running!
Quote:Where is 'key left' defined?
That sounds not good because I dont know Oo - I presumed that "key left" would simulate a keyboard press, a left one in this case...
Would it be possible to map keyboard inputs to the remote so that within ultrastardx my RC is simulating my keyboard?


Quote:Maybe you could buy a USB wireless keyboard
A already considered that but this is just my last resort... Confused

Thanks!
Reply
#13
You might need to do a bit of googling at this point on how to properly set up irexec, but basically, if you're going to try to map global keys using irexec, you need to use the key names as stored in Linux. I can't honestly remember if you have to use irxevent to do this as opposed to irexec, but you might have to.

Here is a good set of examples I found using Google. His 'key' examples all use irxevent, so you might be back to exploring that path.

You may also want to check out linux keycodes for keys/names.

And read the irxevent manual, where it mentions how these commands should be written.

Quote:some more examples:

config = Key Up xawtv
config = Key Down xawtv
config = Key q xawtv
config = Key ctrl-c mpg123
config = Key shift-Page_Up rxvt

In BNF this looks like:

LINE = "config =" <KEY|BUTTON|XYKEY> <TARGET> |
"config =" <KEY|BUTTON|XYKEY> "Focus" <TARGET>
XYKEY = "xy_Key" <x_position> <y_position> <MOD><KEYSPEC>
KEY = "Key" <MOD><KEYSPEC>
MOD = ["shift-"]["numlock-"]["ctrl-"]["alt-"]["meta-"]
["numlock-"]["mod3-"]["mod4-"]["mod5-"]["altgr-"]["scrlock-"]
KEYSPEC = Keyname | "KeySym:"KeySym | "KeyCode:"KeyCode
BUTTON = "Button" <1..5> <x_position> <y_position>
TARGET = Windowname | "WindowID" id | "CurrentWindow" | "RootWindow"
Keyname:

is the key symbol that is declared in X windows. E.g. "Up" refers to the cursor arrow pointing up. "KP_Add" is the plus sign on the key pad. Just take a look at irxevent.keys (in the documentation directory) if you are not sure about a symbol's name.

At this point you should be fully armed and dangerous. I look forward to hearing back with the solution you come up with (even if it ends up being the keyboard). Big Grin
------------------------------------------
Dharma Quick Setup Guide:
XBMC tips on the TechNazgul Blog
------------------------------------------
Reply
#14
Hey!

Thanks - I will definitely have a look on that when I am back home. Nerd

The only think I will have problems with is irxevent. As already mentioned I cannot get it run. irxevent just reports "Cant' open DISPLAY" back ... Sad
I already tried to run it with the launcher plug-in but without success. Maybe it will work if I write a "start irxevent.sh" script and map that one to a RC button with irexec...

I ll keep you updated ...
Reply
#15
Hey!

Ok, I got irexec to run without any problems.
for testing purposes I wrote a miniscript which excutes "nano" Rofl and it worked perfectly, but nothing else from that point.

In the meanwhile I decided to switch to XBMCbuntu because I bought a SSD and therefore did some research about it. I found out that since kernel 2.3.33 SSDs are fully supported(eg trim) and I just have 2.6.32... therefore I thought its maybe a good idea to switch to XBMCbuntu.
As a benefit I maybe could get irxevent to work properly with ultrastardx...Eek

Thanks and I ll keep you updated .. .
Reply

Logout Mark Read Team Forum Stats Members Help
Possible to run irexec with xbmc standalone?0