Kodi Community Forum

Full Version: Have to run xbmc with sudo for the remote to work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I have some kind of permission problem probably an easy one, it usually is, but I'm stuck and I need help to figure out where it might be.

The trouble is that when I run xbmc (XBMC PRE-11.0 Compiled: May 30 2011 with PVR from Lars Op den Kamps repository running on Ubuntu 11.04 kernel 2.6.38-8) with my ordinary user the remote won't work. I use the startup command "xbmc --lircdev /var/run/lirc/lircd" to point it to the right lircd. But I get these errors in the xbmc.log:

INFO: LIRC Initialize: using: /var/run/lirc/lircd
DEBUG: LIRC: Failed to initialize Inotify. LIRC device will not be monitored.
DEBUG: Failed to connect to LIRC. Retry in 10s.
INFO: Loading special://xbmc/system/Lircmap.xml
INFO: Loading special://profile/Lircmap.xml
INFO: LIRC Initialize: using: /var/run/lirc/lircd
DEBUG: LIRC: Failed to initialize Inotify. LIRC device will not be monitored.
DEBUG: Failed to connect to LIRC. Retry in 20s.


and after a while it gives up.

But if I run "sudo xbmc --lircdev /var/run/lirc/lircd" everything works as expected as seen in the log:

INFO: LIRC Initialize: using: /var/run/lirc/lircd
INFO: LIRC Initialize: sucessfully started
INFO: Loading special://xbmc/system/Lircmap.xml
INFO: Loading special://profile/Lircmap.xml


The thing is that everything has been running without sudo up until a day ago. The only change I can think of is a couple of apt-upgrade, but neither upgraded xbmc or lirc (just a lot of mythtv packages), but something must have happened of course. Also I have no problem using lirc with other applications such as mythtv without running it as sudo. So there is nothing wrong with lirc. Irw shows the right output etc, etc.

I have tried to chmod /var/run/lirc/lircd to 777 but still the same problem.
Might it have anything to do with Inotify failing?

Thanks for any suggestions.

Regards,
Is the /var/run/lirc directory readable by non-root users?
Yup, both readable and executable.
I've realised that by running irexec (which I use to start xbmc) with sudo also works. This kind of solves my problem or at least is an acceptable workaround. But I'm still kind of curious about why this happens.
hauj0bb Wrote:I've realised that by running irexec (which I use to start xbmc) with sudo also works. This kind of solves my problem or at least is an acceptable workaround. But I'm still kind of curious about why this happens.

Does your user need to be a member of Lirc group or anything? Guess it might not be the case if they can read/write the appropriate folders/files.
Well... I don't think so. Since mythtv can work with lirc running as the same user it doesn't seem to be a general problem with the user and lirc. Seems more to be something with xbmc.
I found the cause! It turned out that I cannot have Spotify running in the background. Don't ask me why, since lirc works with every other application that I've tried with Spotify running at the same time. Spotify doesn't use lirc either to my knowledge so it must be something else that interferes with xbmc.

Anyways, now it works and this information might be of some use for someone.