Remote not recognized in MMS if startet by root

problems with keyboard, lirc or evdev

Moderator: Moderator

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Remote not recognized in MMS if startet by root

Postby fbn » Wed Mar 26, 2008 3:58 pm

Hi,

I've configured MMS to work with keyboard and remote at the same time with irxevent (thanks to acmelabs: http://forum.mymediasystem.org/viewtopic.php?t=372).

It works great if I start MMS as normal user (media in my case), but the remote won't work if I start MMS as root with the -u media parameter. If I do that, only keyboard works but not the remote.

I tried mms -u media -input lirc and now the remote works but not the keyboard.

I need to start MMS as root if I resume my HTPC from hibernate, because the resume-script runs as root ...

Any idea why MMS would ignore irxevent (at least that seems to happen) if I start it as root?

Thanks,
Frank

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Remote not recognized in MMS if startet by root

Postby acmelabs » Wed Mar 26, 2008 4:11 pm

fbn wrote:Hi,

I've configured MMS to work with keyboard and remote at the same time with irxevent (thanks to acmelabs: http://forum.mymediasystem.org/viewtopic.php?t=372).

It works great if I start MMS as normal user (media in my case), but the remote won't work if I start MMS as root with the -u media parameter. If I do that, only keyboard works but not the remote.

I tried mms -u media -input lirc and now the remote works but not the keyboard.

I need to start MMS as root if I resume my HTPC from hibernate, because the resume-script runs as root ...

Any idea why MMS would ignore irxevent (at least that seems to happen) if I start it as root?

Thanks,
Frank

-input lirc won't work, it can't. This workaround can only work with -input keyboard, because your lircd is sending phantom keypresses to mms, so it thinks this imput is coming from the keyboard.

But I don't have the slightest clue, why the other stuff isn't working. Permissions? Could you check /dev/lirc*?
And how did you manage to get lirc working after hibernate? I have to unload and load lirc-serial after s3, else no lirc here!

Regards,
Andreas

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Remote not recognized in MMS if startet by root

Postby acmelabs » Wed Mar 26, 2008 4:24 pm

fbn wrote:Hi,

I've configured MMS to work with keyboard and remote at the same time with irxevent (thanks to acmelabs: http://forum.mymediasystem.org/viewtopic.php?t=372).

It works great if I start MMS as normal user (media in my case), but the remote won't work if I start MMS as root with the -u media parameter. If I do that, only keyboard works but not the remote.

I tried mms -u media -input lirc and now the remote works but not the keyboard.

I need to start MMS as root if I resume my HTPC from hibernate, because the resume-script runs as root ...

Any idea why MMS would ignore irxevent (at least that seems to happen) if I start it as root?

Thanks,
Frank

This workaround is crap (you will notice delays, and you must keep irxevent running.) I can say that, I my workaround ;-)
BTW: Please Vote here: http://bugs.mymediasystem.org/?do=details&task_id=430
Last edited by acmelabs on Wed Mar 26, 2008 4:27 pm, edited 1 time in total.

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Re: Remote not recognized in MMS if startet by root

Postby fbn » Wed Mar 26, 2008 4:26 pm

acmelabs wrote:-input lirc won't work, it can't. This workaround can only work with -input keyboard, because your lircd is sending phantom keypresses to mms, so it thinks this imput is coming from the keyboard.


Yes I know that, what I meant is that mms -u media -i lirc actually works (with the remote only) while mms -u media -i keyboard does not work with the remote (only with the keyboard) but it *should* work both with -i keyboard as I'm running irxevent.

But I don't have the slightest clue, why the other stuff isn't working. Permissions? Could you check /dev/lirc*?
And how did you manage to get lirc working after hibernate? I have to unload and load lirc-serial after s3, else no lirc here!


Permissions are good ... because lirc in general is working (tried with -i lirc and irw as root). It seems that irxevent is ignored if I start mms as root. Does that work for you?

1. start irxevent as normal user
2. mms as user, keyboard and remote should work
3. sudo bash
4. mms -u media -i keyboard
5. try keyboard and remote, only keyboard should work

lirc works just fine after hibernate, I don't have to do anything. The only thing I've changed is the resume script that starts mms.

Are you using a serial receiver or a usb one? I have a serial one, maybe that's the difference? And I'm on Ubuntu 8.04 alpha 6.

Frank

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Wed Mar 26, 2008 4:27 pm

And by the way Andreas: Do you work full time in this forum? I rarely see such fast replies ... :)

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Wed Mar 26, 2008 4:28 pm

fbn wrote:And by the way Andreas: Do you work full time in this forum? I rarely see such fast replies ... :)

I live here :!:
Did you check it with irw already?

-> serial -> homebrew

and don't forget to vote: http://bugs.mymediasystem.org/?do=details&task_id=430
Last edited by acmelabs on Wed Mar 26, 2008 4:30 pm, edited 1 time in total.

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Wed Mar 26, 2008 4:30 pm

yes I did. irw gets signals as root and as user. but I don't think that really matters as irw does not use or watch irxevent ... have you tried on your box?

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Wed Mar 26, 2008 4:31 pm

fbn wrote:yes I did. irw gets signals as root and as user. but I don't think that really matters as irw does not use or watch irxevent ... have you tried on your box?
no, not since Lorenzo introduced this -u stuff.
I'm not at home currently, I can't verify atm. But tonight.

Regards
Andreas

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Wed Mar 26, 2008 4:35 pm

would be great if you could test it, thanks.

I did some more research:

I started irxevent as root also - still the same behavior.

Then I tried again as root with -u media, keyboard works remote not - as before. I launched a video with mplayer and surprise, the remote works with mplayer as it should. But after leaving mplayer and changing back to mms there is still no remote functionality so it seems to be a bug related to the -u switch in mms :(

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Wed Mar 26, 2008 6:42 pm

fbn wrote:would be great if you could test it, thanks.

I did some more research:

I started irxevent as root also - still the same behavior.

Then I tried again as root with -u media, keyboard works remote not - as before. I launched a video with mplayer and surprise, the remote works with mplayer as it should. But after leaving mplayer and changing back to mms there is still no remote functionality so it seems to be a bug related to the -u switch in mms :(

mplayer is no problem, because it can handle both methods at same time, and its config is comming form .lircrc. So this is a nice test, but a meaningless conclusion.

And I'm afraid I can't test. In the livingroom isn't possible tonight, and my devel machine lacks of lirc.

...let me think... must use brain...ohh - I hate that :)

bbl

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Wed Mar 26, 2008 7:31 pm

hm okay what I've meant is that mplayer is also started from within mms -u as root. But you are right, it's different.

Hopefully it's not a bug in mms as this behavior would be annoying on a long term ;)

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: Remote not recognized in MMS if startet by root

Postby lorenzodes » Wed Mar 26, 2008 9:53 pm

fbn wrote:Hi,
I tried mms -u media -input lirc and now the remote works but not the keyboard.


Ok :)

I need to start MMS as root if I resume my HTPC from hibernate, because the resume-script runs as root ...

No, you don't need to run MMS as root. It doesn't matter if the said script must be executed as root, you can launch mms as root and tell it to drop root privileges using the -u switch.

Any idea why MMS would ignore irxevent (at least that seems to happen) if I start it as root?

Thanks,
Frank


Please, paste the output of mms.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Thu Mar 27, 2008 8:27 am

Hi Lorenzo,

I said it wrong, I don't have to start mms as root - the system script resume.sh runs as root and therefore I have to use the -u switch.

I also compared the output of mms -u and mms without -u and it's the same (no difference).

Debug level is the default, does it help to increase this value? (can not test atm)

User avatar
fbn
Posts: 89
Joined: Sat Mar 08, 2008 3:38 pm

Postby fbn » Sat Mar 29, 2008 11:12 am

Hi, I'm still having this issue, every time I start my machine and load MMS so it's pretty annoying for us and I don't know a workaround.

Other way would be to ask in Ubuntu forums if it's possible to tell resume.sh to run as user instead of root but I'm not sure if that is possible or will break something else ...

Frank

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sat Mar 29, 2008 1:13 pm

fbn wrote:Hi, I'm still having this issue, every time I start my machine and load MMS so it's pretty annoying for us and I don't know a workaround.

Other way would be to ask in Ubuntu forums if it's possible to tell resume.sh to run as user instead of root but I'm not sure if that is possible or will break something else ...

Frank


You would probably need to pass MMS the proper environment variable.

Unfortunately I don't have lirc here installed so I can't test :(
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"


Return to “input”

Who is online

Users browsing this forum: No registered users and 3 guests