LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 04-02-2013, 03:14 AM   #1
fmr
Member
 
Registered: Oct 2009
Posts: 31

Rep: Reputation: 0
Question Lirc works, but XBMC does not respond to Infrared input


Hi, I have a strange situation with Lirc and XBMC:

Lirc is set up to work with my homemade IR receiver, plugged into /dev/ttyS0 on my media PC. (Ubuntu 10.04 with XBMC Eden)

Running irw gives the desired results: The correct button names (e.g. key_up) are displayed on stdout as I press them on the remote. XBMC starts as a service, xbmc-live, on boot. It does not respond to IR button presses at all. My configuration is as follows:

In /etc/lirc:

hardware.conf:

Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Custom"
REMOTE_MODULES="lirc_dev lirc_serial"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="Serial Port (UART) : Direct TV Receiver"
TRANSMITTER_MODULES="lirc_dev lirc_serial"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc0"
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF="directtv/general.conf"
TRANSMITTER_LIRCD_ARGS=""

START_LIRCD="true"

LOAD_MODULES="true"

LIRCMD_CONF=""

FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
lg_vcr_remote.conf:

Code:
begin remote

  name  lg_vcr_remote
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       8963  4458
  one           590  1604
  zero          590   554
  ptrail        559
  repeat       8972  2276
  gap          107364
  toggle_bit_mask 0x0

      begin codes
          key_power                0x20DF10EF
          key_vcr2                 0x7689A857
          key_mute                 0x20DF906F
          key_menu                 0x76896897
          key_tv                   0x20DFD02F
          key_clear                0x7689F807
          key_ejectclosecd         0x768900FF
          key_up                   0x20DF00FF
          key_down                 0x20DF807F
          key_left                 0x20DFC03F
          key_right                0x20DF40BF
          key_ok                   0x7689718E
          key_stop                 0x7689807F
          key_pause                0x7689D02F
          key_record               0x7689906F
          key_rewind               0x768940BF
          key_play                 0x768910EF
          key_fastforward          0x7689C03F
          key_1                    0x7689A05F
          key_2                    0x7689609F
          key_3                    0x7689E01F
          key_4                    0x768930CF
          key_5                    0x7689B04F
          key_6                    0x7689708F
          key_7                    0x7689F00F
          key_8                    0x768938C7
          key_9                    0x7689B847
          key_0                    0x768920DF
          key_again                0x76896D92
          key_exit                 0x76891DE2
      end codes

end remote
lircd.conf:

Code:
include "/usr/share/lirc/extras/transmitters/directtv/general.conf"
include "/etc/lirc/lg_vcr_remote.conf"
In /home/xbmc/.xbmc/userdata:

Lircmap.xml:

Code:
<lircmap>
	<remote device="lg_vcr_remote">
		<play>key_play</play>
		<pause>key_pause</pause>
		<stop>key_stop</stop>
		<forward>key_fastforward</forward>
		<reverse>key_rewind</reverse>
		<left>key_left</left>
		<right>key_right</right>
		<up>key_up</up>
		<down>key_down</down>
		<select>key_ok</select>
		<menu>key_menu</menu>
		<record>key_record</record>
		<mute>key_mute</mute>
		<power>key_power</power>
		<one>key_1</one>
		<two>key_2</two>
		<three>key_3</three>
		<four>key_4</four>
		<five>key_5</five>
		<six>key_6</six>
		<seven>key_7</seven>
		<eight>key_8</eight>
		<nine>key_9</nine>
		<zero>key_0</zero>
		<clear>key_clear</clear>
		<back>key_exit</back>
	</remote>
</lircmap>
keymap/remote.xml:

Code:
<keymap>
	<global>
		<remote>
			<play>Play</play>
			<pause>Pause</pause>
			<stop>Stop</stop>
			<forward>FastForward</forward>
			<reverse>Rewind</reverse>
			<left>Left</left>
			<right>Right</right>
			<up>Up</up>
			<down>Down</down>
			<select>Select</select>
			<pageplus>PageUp</pageplus>
			<pageminus>PageDown</pageminus>
			<back>ParentDir</back>
			<menu>PreviousMenu</menu>
			<title>ContextMenu</title>
			<info>Info</info>
			<skipplus>SkipNext</skipplus>
			<skipminus>SkipPrevious</skipminus>
			<display>FullScreen</display>
			<start>PreviousMenu</start>
			<record>Screenshot</record>
			<volumeplus>VolumeUp</volumeplus>
			<volumeminus>VolumeDown</volumeminus>
			<mute>Mute</mute>
			<power>XBMC.ShutDown()</power>

			<three>VolumeUp</three>
			<six>VolumeDown</six>

			<seven>XBMC.ActivateWindow(MyVideos)</seven>
			<eight>XBMC.ActivateWindow(MyMusic)</eight>
			<nine>XBMC.ActivateWindow(MyPictures)</nine>
			<zero>XBMC.ActivateWindow(Home)</zero>
		</remote>
	</global>
	
	<Home>
		<remote>
			<menu>XBMC.Skin.ToggleSetting(HomeViewToggle)</menu>
			<info>XBMC.ActivateWindow(SystemInfo)</info>
			<clear>XBMC.ActivateWindow(Weather)</clear>
			<hash>XBMC.ActivateWindow(Settings)</hash>
		</remote>
	</Home>
	
	<MyFiles>
		<remote>
			<one>Highlight</one>
			<four>Copy</four>
			<seven>Move</seven>
			<clear>Delete</clear>
		</remote>
	</MyFiles>
	
	<MyMusicPlaylist>
		<remote>
			<back>Playlist</back> <!-- Close playlist -->
			<clear>Delete</clear>
			<two>MoveItemUp</two>
			<five>MoveItemDown</five>
		</remote>
	</MyMusicPlaylist>
	
	<MyMusicPlaylistEditor>
		<remote>
			<one>Queue</one>
		</remote>
	</MyMusicPlaylistEditor>
	
	<MyMusicFiles>
		<remote>
			<one>Queue</one>
		</remote>
	</MyMusicFiles>
	
	<MyMusicLibrary>
		<remote>
			<one>Queue</one>
		</remote>
		
	</MyMusicLibrary>
	
	<FullscreenVideo>
		<remote>
			<left>StepBack</left>
			<right>StepForward</right>
			<up>BigStepForward</up>
			<down>BigStepBack</down>
			<back>SmallStepBack</back>
			<menu>OSD</menu>
			<start>OSD</start>
			<title>CodecInfo</title>
			<info>Info</info>
			<enter>AspectRatio</enter>
			<select>AspectRatio</select>
		</remote>
	</FullscreenVideo>
	
	<FullscreenInfo>
		<remote>
			<title>CodecInfo</title>
			<info>Close</info>
		</remote>
	</FullscreenInfo>
	
	<PlayerControls>
		<remote>
			<menu>Close</menu>
		</remote>
	</PlayerControls>
	
	<Visualisation>
		<remote>
			<left>PreviousPreset</left>
			<right>NextPreset</right>
			<up>IncreaseRating</up>
			<down>DecreaseRating</down>
			<back>LockPreset</back>
			<title>ShowPreset</title>
			<select>XBMC.ActivateWindow(VisualisationPresetList)</select>
			<menu>XBMC.ActivateWindow(MusicOSD)</menu>
			<start>OSD</start>
			<info>Info</info>
		</remote>
	</Visualisation>
	
	<MusicOSD>
		<remote>
			<menu>Close</menu>
			<title>Info</title>
			<info>ShowPreset</info>
		</remote>
	</MusicOSD>
	
	<VisualisationSettings>
		<remote>
			<menu>Close</menu>
		</remote>
	</VisualisationSettings>
	
	<VisualisationPresetList>
		<remote>
			<menu>Close</menu>
		</remote>
	</VisualisationPresetList>
	
	<SlideShow>
		<remote>
			<info>CodecInfo</info>
			<right>NextPicture</right>
			<left>PreviousPicture</left>
			<title>Info</title>
			<select>Rotate</select>
			<back>PreviousMenu</back>
		</remote>
	</SlideShow>
	
	<ScreenCalibration>
		<remote>
			<select>NextCalibration</select>
			<enter>NextCalibration</enter>
			<zero>ResetCalibration</zero>
			<display>NextResolution</display>
			<xbox>NextResolution</xbox>
		</remote>
	</ScreenCalibration>
	
	<GUICalibration>
		<remote>
			<select>NextCalibration</select>
			<enter>NextCalibration</enter>
			<zero>ResetCalibration</zero>
		</remote>
	</GUICalibration>
	
	<SelectDialog>
		<remote>
			<back>Close</back>
		</remote>
	</SelectDialog>
	
	<VideoOSD>
		<remote>
			<back>PreviousMenu</back>
			<menu>Close</menu>
			<start>Close</start>
		</remote>
	</VideoOSD>
	
	<VideoMenu>
		<remote>
			<menu>OSD</menu>
			<back>PreviousMenu</back>
			<info>Info</info>
			<title>CodecInfo</title>
			<zero>Number0</zero>
			<one>Number1</one>
			<two>Number2</two>
			<three>Number3</three>
			<four>Number4</four>
			<five>Number5</five>
			<six>Number6</six>
			<seven>Number7</seven>
			<eight>Number8</eight>
			<nine>Number9</nine>
		</remote>
	</VideoMenu>
	
	<OSDVideoSettings>
		<remote>
			<back>Close</back>
			<menu>Close</menu>
			<start>Close</start>
		</remote>
	</OSDVideoSettings>
	
	<OSDAudioSettings>
		<remote>
			<back>Close</back>
			<menu>Close</menu>
			<start>Close</start>
		</remote>
	</OSDAudioSettings>
	
	<VideoBookmarks>
		<remote>
			<back>Close</back>
			<menu>Close</menu>
			<start>Close</start>
			<zero>Delete</zero>
		</remote>
	</VideoBookmarks>
	
	<MyVideoLibrary>
		<remote>
			<clear>Delete</clear>
		</remote>
	</MyVideoLibrary>
	
	<MyVideoFiles>
		<remote>
			<one>Queue</one>
		</remote>
	</MyVideoFiles>
	
	<MyVideoPlaylist>
		<remote>
			<back>Playlist</back> <!-- Close playlist -->
			<clear>Delete</clear>
			<two>MoveItemUp</two>
			<five>MoveItemDown</five>
		</remote>
	</MyVideoPlaylist>
	
	<VirtualKeyboard>
		<remote>
			<back>BackSpace</back>
			<star>Shift</star>
			<hash>Symbols</hash>
			<zero>Number0</zero>
			<one>Number1</one>
			<two>Number2</two>
			<three>Number3</three>
			<four>Number4</four>
			<five>Number5</five>
			<six>Number6</six>
			<seven>Number7</seven>
			<eight>Number8</eight>
			<nine>Number9</nine>
			<pageminus>CursorLeft</pageminus>
			<pageplus>CursorRight</pageplus>
		</remote>
	</VirtualKeyboard>
	
	<MyPictures>
	</MyPictures>
	
	<ContextMenu>
		<remote>
			<title>Close</title>
			<back>Close</back>
		</remote>
	</ContextMenu>
	
	<FileStackingDialog>
		<remote>
			<back>Close</back>
		</remote>
	</FileStackingDialog>
	
	<Scripts>
		<remote>
			<info>XBMC.ActivateWindow(ScriptsDebugInfo)</info>
		</remote>
	</Scripts>
	
	<NumericInput>
		<remote>
			<zero>Number0</zero>
			<one>Number1</one>
			<two>Number2</two>
			<three>Number3</three>
			<four>Number4</four>
			<five>Number5</five>
			<six>Number6</six>
			<seven>Number7</seven>
			<eight>Number8</eight>
			<nine>Number9</nine>
			<back>BackSpace</back>
		</remote>
	</NumericInput>
	
	<Weather>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</Weather>
	
	<Settings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</Settings>
	
	<MyPicturesSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</MyPicturesSettings>
	
	<MyProgramsSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</MyProgramsSettings>
	
	<MyWeatherSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</MyWeatherSettings>
	
	<MyMusicSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</MyMusicSettings>
	
	<SystemSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</SystemSettings>
	
	<MyVideosSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</MyVideosSettings>
	
	<NetworkSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</NetworkSettings>
	
	<AppearanceSettings>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</AppearanceSettings>
	
	<Profiles>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</Profiles>
	
	<systeminfo>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</systeminfo>
	
	<shutdownmenu>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</shutdownmenu>
	
	<submenu>
		<remote>
			<back>PreviousMenu</back>
		</remote>
	</submenu>
	
	<MusicInformation>
		<remote>
			<back>Close</back>
		</remote>
	</MusicInformation>
	
	<MovieInformation>
		<remote>
			<back>Close</back>
		</remote>
	</MovieInformation>
	
	<LockSettings>
		<remote>
			<menu>Close</menu>
			<back>PreviousMenu</back>
		</remote>
	</LockSettings>
	
	<ProfileSettings>
		<remote>
			<menu>Close</menu>
			<back>PreviousMenu</back>
		</remote>
	</ProfileSettings>
	
	<PictureInfo>
		<remote>
			<right>NextPicture</right>
			<left>PreviousPicture</left>
			<info>Close</info>
			<back>Close</back>
		</remote>
	</PictureInfo>
</keymap>
Any help would be appreciated.

Regards,
fmr
 
Old 04-03-2013, 04:09 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,246

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Enable debug mode: create file "/home/xbmc/.xbmc/userdata/advancedsettings.xml" with this content
Code:
<advancedsettings>
    <loglevel>1</loglevel>
</advancedsettings>
Run xbmc, press some keys on remote and then look into "/home/xbmc/.xbmc/temp/xbmc.log". Paste output here.
 
1 members found this post helpful.
Old 04-04-2013, 05:02 AM   #3
fmr
Member
 
Registered: Oct 2009
Posts: 31

Original Poster
Rep: Reputation: 0
Question

Great idea! I didn't know about the loglevel.

xbmc.log is attached, because it is too big for the post... xbmc.log

The sad thing is: All of the "DEBUG: LIRC: Update - NEW at" entries are keyboard presses on the tty2 console. I tested this by rebooting (for a clean log) and just going to tty2 (you'll see CTRL+ALT registered in the log file, but not F2), pressing up, down, left and right (on my actual keyboard) a few times, and checking the log. It seems that keyboard presses such as up, down, left, right, home, delete, etc. are registered as LIRC events, but not the Alphanumerical keys or ENTER.

However, none of my IR button presses show up in the log.
 
Old 04-04-2013, 06:02 PM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,246

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
It is weird, keyboard presses presented as LIRC events. Can you disable transmitter in hardware .conf, restart lircd and then test? Check also lirc logs
Code:
grep lirc /var/log/syslog
Check what you have started related to lirc
Code:
ps -Af | grep 'lirc\|ir'
Your keyboard is not connected by serial port?
 
Old 04-05-2013, 06:01 PM   #5
fmr
Member
 
Registered: Oct 2009
Posts: 31

Original Poster
Rep: Reputation: 0
Disabling the "transmitter" in hardware.conf fixed the weird Keyboard-presses-as-Lirc-commands problem!

Pressing buttons in XBMC still did nothing, and caused no events in the log.

I had an idea and did:
Code:
# service xbmc-live stop
# service lirc stop
# service lirc start
# service xbmc-live start
And my remote control worked in XBMC!! So it seems that Lirc should start before XBMC. Problem is, XBMC is an UpStart script, while Lirc is using sysvinit. I am very new to UpStart, and still find it confusing. I think I should convert Lirc to an UpStart service, and let XBMC depend on it. But I really don't know how!!

/etc/init/xbmc-live.conf:
Code:
# xbmc-live
#
# init XBMC environment
#

description     "XBMCLive"
author          "Luigi Capriotti"

start on (filesystem and stopped udevtrigger)

stop on runlevel [06]

script
	get_opt() {
		echo "$@" | cut -d "=" -f 2
	}

	CMDLINE=$(cat /proc/cmdline)

	#Process command line options
	XBMC_PARAMS=""
	for i in ${CMDLINE}; do
		case "${i}" in
		xbmc\=*)
		      XBMC_PARAMS=$(get_opt $i)
		      ;;
		esac
	done
	echo $XBMC_PARAMS > /tmp/xbmcliveParams

	if grep "boot=live" /proc/cmdline ; then
		# Relies on init scripts to mount boot device on a specified directory
		BOOTMEDIAMOUNTPOINT="/live/image"
	fi

	BOOTHOOKSDIRECTORY="/etc/xbmc"

	xbmcUser=xbmc
	# Read configuration variable file if it is present
	[ -r /etc/default/xbmc-live ] && . /etc/default/xbmc-live
	if ! getent passwd $xbmcUser >/dev/null; then
		xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//')
	fi

	# Executes pre-hooks (if any) in the System "Hooks" directory
	if [ -d $BOOTHOOKSDIRECTORY/live.d ]; then
	  for hook in $(find $BOOTHOOKSDIRECTORY/live.d -type f -perm /u=x,g=x,o=x | sort)
	  do
	        $hook $BOOTMEDIAMOUNTPOINT $XBMC_PARAMS  || true
	  done
	fi

	# Executes pre-hooks (if any) in the user "Hooks" directory
	if [ -d /home/$xbmcUser/.xbmc/live.d ]; then
	  for hook in $(find /home/$xbmcUser/.xbmc/live.d -type f -perm /u=x,g=x,o=x | sort)
	  do
	        $hook $BOOTMEDIAMOUNTPOINT $XBMC_PARAMS  || true
	  done
	fi

	runXBMC
end script
/usr/bin/runXBMC just launches XBMC in standalone mode.

Thanks for the help so far!
 
Old 04-15-2013, 03:42 PM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,246

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
sysvinit scripts are normal executable files, so you can invoke it (with appropriate flags start and stop) in your "/etc/init/xbmc-live.conf" before running "xbmc" and remove links to lirc startup script in "/etc/rc*.d" directories.

Or you can add to xbmc upstart script to "start on" your custom event (for example "lirc") and emit it by "initctl emit lirc" in lirc script, after starting "lircd".

I had set in my xbmc.conf "start on stopped rc RUNLEVEL=[2345]". So it should start after all rc* scripts.

Last edited by eSelix; 04-15-2013 at 03:47 PM.
 
  


Reply

Tags
configuration, infrared, lirc, xbmc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xbmc multimedia; almost nothing works Xeratul Debian 1 01-20-2013 11:52 PM
Using XBMC 10.0 slackbuild to compile XBMC 11.0 almost works farmerdave Slackware 20 06-11-2012 02:05 PM
infrared remote configuration without lirc sem7ex Linux - Newbie 4 10-16-2009 03:37 AM
Vostro 1500 infrared receiver with LIRC elyk53 Linux - Hardware 3 06-17-2009 01:47 PM
Hama lirc infrared. How to install that ? frenchn00b Linux - Hardware 19 10-12-2007 02:48 PM


All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration