LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Controlling xine with lirc (https://www.linuxquestions.org/questions/linux-software-2/controlling-xine-with-lirc-753204/)

Woodsman 09-06-2009 11:20 PM

Controlling xine with lirc
 
I installed an HVR-1600 MCE-Kit as a TV capture card. Capture card works fine.

The kit comes with an MCE USB remote control and transceiver. The exact model is the black one (1069/335) as seen in the MythTV MCE_Remote page. This remote is considered a second generation USB device.

I'm running 13.0 32-bit with a 2.6.30.5 kernel. As the current 0.8.5 stable version of lirc does not support the 2.6.30 kernel series, I built lirc cvs (0.8.6pre2).

I created an rc.d script to automatically start the lirc daemon when booting. Using the irw command I confirmed each button is working. I found an lircd.conf.mceusb2 for the remote. As far as I can tell the remote works as expected.

I'm running irexec as a daemon.

Now I'm trying to control xine with lirc. I created an ~/.lircrc file. Here is a snippet:

Code:

##########LAUNCHING BUTTONS#######################

#Start Xine
begin
 prog = irexec
 button = home
 config = /usr/bin/xine
end

######XINE############
begin
 prog = xine
 button = play
 config = Play
end

begin
 prog = xine
 button = pause
 config = Pause
end

begin
 prog = xine
 button = stop
 config = Stop
end

begin
 prog = xine
 button = red
 config = Quit
end

begin
 prog = xine
 button = mute
 config = Mute
end

######XINE############

When I press the Home button xine starts as expected. Yet once running, no commands get passed to xine. All I have attempted thus far is to start a TV recording and then try to pause or stop the video or terminate xine. No luck. I do not understand how the button commands are passed to each application. I'd like to think I'm missing something obvious, but after surfing the web and reading the lirc docs I'm stumped.

For testing and comparison purposes I have XBMC 9.04 installed in separate partitions. The remote control nicely manages the XBMC interface. I haven't yet figured out how that's done as I haven't found an lircrc config file anywhere.

I appreciate any help.

Scuzz 09-07-2009 11:23 AM

Hello Woodsman

I had the same problem with xine in slackware-13.0

i removed xine-ui with removepkg
then i downloaded xine-ui-0.99.5.tar.gz from http://www.xine-project.org/releases

and compiled it like this ./configure --enable-lirc then i did a make and a make install.

after it was compiled my .lircrc file that was already made in my home directory worked right off the bat.

I would have to guess that the slackware package of xine-ui that comes with slackware-13.0 isn't built with lirc enabled.

But i cant confirm this considering im still in the very basic stages of learning linux.

Here is the format of my lircrc file
Code:

# fullscreen toggle
begin
        remote = Philips
        button = KEY_HOME
        prog  = xine
        repeat = 2
        config = ToggleFullscreen
end

I got that format by running xine --keymap=lirc >pick-any-filename
then i added in my own values.
Hope this helps in anyway.

Woodsman 09-07-2009 12:50 PM

Quote:

I would have to guess that the slackware package of xine-ui that comes with slackware-13.0 isn't built with lirc enabled.
I wondered about that. I checked the 13.0 build script and the xine configure file. I found an explicit --disable-lirc option but no --enable-lirc option. Therefore I concluded that lirc is enabled by default in xine. :scratch: Yet with your report I again browsed the configure file and found a snippet referencing an --enable-lirc option.

I modified the stock build script. I rebuilt the package and updated the package. No change. :) I'll presume then that lirc is enabled by default.

I ran xine with the --keymap option. That created an lircrc shell with a bunch of xxxxx options. I presume I have to manually replace the xxxxx with an actual button name that I derive from irw. I don't know the proper remote name to use. If I understand correctly I don't have to insert one because the default is all (*).

I modified the lircrc file to no avail. :)

Despite the moment of hope you provided, I still have no response from xine using the remote control. I must be missing something that is not obvious to me. :scratch:

Scuzz 09-07-2009 01:38 PM

i ran irrecord for my lircd.conf and named my own keys.

as you can see from the above, my home key is KEY_HOME
and so on.

but i think as long as irw reports back the same keys pressed from your remote thats in your lircd.conf i think that portion of it is correct.

can you post your lircd.conf for me too look at ?

The reason i still think its xine-ui is because i didnt even touch my lircrc file at all once i removed xine-ui.
literally right after xine-ui compiled form the link i provided everything worked.
so that still leaves me to believe that the slackware xine-ui package is still at fault.
If it was enabled by default then im curious why the exact lircrc file i have working now wont work with it.

Woodsman 09-07-2009 02:03 PM

Quote:

If it was enabled by default then im curious why the exact lircrc file i have working now wont work with it.
I don't know.

Do you load irexec as a daemon?

Quote:

can you post your lircd.conf for me too look at ?
Sure. I checked the codes with irw and they match.

Code:

#
# brand:                        HP
# model no. of remote control:  TSGH-IR01
# devices being controlled by this remote: HP Slimline S3100y
#
# Derived from MCEUSB2 lircd.conf file (lircd.conf.mceusb) found at:
# https://help.ubuntu.com/community/Install_Lirc_Feisty

#
# RC-6 config file
#
# source: http://home.hccnet.nl/m.majoor/projects__remote_control.htm
#        http://home.hccnet.nl/m.majoor/pronto.pdf
#
# used by: Philips
#
#########
#
# Philips Media Center Edition remote control
# For use with the USB MCE ir receiver
#
# Dan Conti  dconti|acm.wwu.edu
#
# Updated with codes for MCE 2005 Remote additional buttons
# *, #, Teletext, Red, Green, Yellow & Blue Buttons
# Note: TV power button transmits no code until programmed.
# Updated 12th September 2005
# Graham Auld - mce|graham.auld.me.uk
#
# Radio, Print, RecTV are only available on the HP Media Center remote control
#
#
# Updated with codes for MCE 2007 Remote additional buttons
# Visualization, Aspect, SlideShow, Eject
# Note:
# Renamed some buttons: DVD->DVDMenu, More->MoreInfo, Star->Asterisk, Hash->Pound
# Note:
# Blue, Yellow, Green, Red, and Teletext buttons do not exist on the HP remote

begin remote

  name        mceusb
  bits                16
  flags  RC6|CONST_LENGTH
  eps                  30
  aeps                100

  header      2667  889
  one          444  444
  zero          444  444
  pre_data_bits        21
  pre_data        0x37FF0
  gap              150000
  toggle_bit          22
  rc6_mask    0x100000000


      begin codes

#unused by HP remote
        Blue              0x00007ba1
        Yellow              0x00007ba2
        Green              0x00007ba3
        Red              0x00007ba4
        Teletext      0x00007ba5

#ba6 - bae unused
        BA6          0x00007ba6
        BA7          0x00007ba7
        BA8          0x00007ba8
        BA9          0x00007ba9
        BAA          0x00007baa
        BAB          0x00007bab
        BAC          0x00007bac
        BAD          0x00007bad
        BAE          0x00007bae

        Radio        0x00007baf
        Print        0x00007bb1

#bb2 - bb4 unused
        BB2          0x00007bb2
        BB3          0x00007bb3
        BB4          0x00007bb4

        Videos        0x00007bb5
        Pictures      0x00007bb6
        RecTV        0x00007bb7
        Music        0x00007bb8
        TV            0x00007bb9

#bba - bbf unused
        BBA          0x00007bba
        BBB          0x00007bbb
        BBC          0x00007bbc
        BBD          0x00007bbd
        BBE          0x00007bbe
        BBF          0x00007bbf
#bc1 - bca unused
        BC1          0x00007bc1
        BC2          0x00007bc2
        BC3          0x00007bc3
        BC4          0x00007bc4
        BC5          0x00007bc5
        BC6          0x00007bc6
        BC7          0x00007bc7
        BC8          0x00007bc8
        BC9          0x00007bc9
        BCA          0x00007bca

        Eject        0x00007bcb
        SlideShow    0x00007bcc
        Visualization 0x00007bcd

#bce - bcf unused
        BCE          0x00007bce
        BCF          0x00007bcf
#bd1 - bd7 unused
        BD1          0x00007bd1
        BD2          0x00007bd2
        BD3          0x00007bd3
        BD4          0x00007bd4
        BD5          0x00007bd5
        BD6          0x00007bd6
        BD7          0x00007bd7

        Aspect        0x00007bd8
        Guide        0x00007bd9
        LiveTV        0x00007bda
        DVD          0x00007bdb
#NoGap
        Back          0x00007bdc
        OK            0x00007bdd
        Right        0x00007bde
        Left          0x00007bdf
        Down          0x00007be0
        Up            0x00007be1
#NoGap
        Star          0x00007be2
        Hash          0x00007be3
#NoGap
        Replay        0x00007be4
        Skip          0x00007be5
        Stop          0x00007be6
        Pause        0x00007be7
        Record        0x00007be8
        Play          0x00007be9
        Rewind        0x00007bea
        Forward      0x00007beb
#NoGap
        ChanDown      0x00007bec
        ChanUp        0x00007bed
        VolDown      0x00007bee
        VolUp        0x00007bef
#NoGap
        More          0x00007bf0
        Mute          0x00007bf1
        Home          0x00007bf2
        Power        0x00007bf3
#NoGap
        Enter        0x00007bf4
        Clear        0x00007bf5
#NoGap
        Nine          0x00007bf6
        Eight        0x00007bf7
        Seven        0x00007bf8
        Six          0x00007bf9
        Five          0x00007bfa
        Four          0x00007bfb
        Three        0x00007bfc
        Two          0x00007bfd
        One          0x00007bfe
        Zero          0x00007bff
      end codes

end remote


XavierP 09-07-2009 02:21 PM

Moved to /Software as requested.

Scuzz 09-07-2009 02:22 PM

Try doing this

for remote = mceusb instead of xxxxxx

and here you show .

Code:

begin
 prog = xine
 button = stop
 config = Stop
end

maybe its case sensitive

your lircd.conf shows Stop not stop

so try changing it to this
Code:


begin
 prog = xine
 button = Stop
 config = Stop
end

maybe thats your issue

Scuzz 09-07-2009 03:32 PM

Sorry i missed your other question.

Yes i use irexec as a daemon also to start xine.

i start it with screen irexec &

then i close the window, if i dont use screen it wont work once the terminal window closes.

vik 09-07-2009 04:02 PM

Modifying your original script (case does matter):
Code:

##########LAUNCHING BUTTONS#######################

#Start Xine
begin
 prog = irexec
 remote = mceusb
 button = Home
 config = /usr/bin/xine
end

######XINE############
begin
 prog = xine
 remote = mceusb
 button = Play
 config = Play
end

begin
 prog = xine
 remote = mceusb
 button = Pause
 config = Pause
end

begin
 prog = xine
 remote = mceusb
 button = Stop
 config = Stop
end

begin
 prog = xine
 remote = mceusb
 button = Red
 config = Quit
end

begin
 prog = xine
 remote = mceusb
 button = Mute
 config = Mute
end

######XINE############

Try this out. Also, make sure this file is in your home directory, named .lircrc
Xine doesn't look for this file anywhere else.

Scuzz 09-07-2009 04:31 PM

Quote:

Originally Posted by vik (Post 3673496)
Xine doesn't look for this file anywhere else.

You can also make the .lircrc system wide by moving it too /etc
without the period infront of it of course.
it should work for every user account at that point.

Woodsman 09-07-2009 05:24 PM

Quote:

Try this out. Also, make sure this file is in your home directory, named .lircrc
Xine doesn't look for this file anywhere else.
Okay, I just tried that. No luck. :( I restarted the lirc daemon as well as irexec.

Quote:

You can also make the .lircrc system wide by moving it too /etc
Yes, I had been using that location. But I also try the home directory too.

I start the lirc daemon when I boot. I created an rc.d script to easily start/stop/restart. In that script I also start/stop irexec. The irw command responds perfectly to every button I press.

The fact that I can start xine with the remote control lets me know I have something correct. But nothing gets passed to xine.

Is there a specific pecking order to all of this? I'm convinced I am missing something basic.

Scuzz 09-07-2009 05:35 PM

try running this real quick,

irrecord bla.txt

does it startup and ask you to press keys or exit?
if its asking you to hit a bunch of keys on your remote then you can just not hit anything and it will quit.

I might have an idea on whats going on.

Let me know if it works for you as a user not as su.

sorry this might be something not even related, but i use a usb transceiver myself. is yours usb also ?

Woodsman 09-07-2009 05:50 PM

Quote:

irrecord bla.txt
does it startup and ask you to press keys or exit?
Hmm. Could be a clue there. As root, I received an error message:

Code:

irrecord -  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

irrecord: could not open /dev/lirc
irrecord: default_init(): Is a directory
irrecord: could not init hardware (lircd running ? --> close it, check permissions)

I do have /dev/lirc/0. I do have /var/run/lirc/lirc.pid and /var/run/lirc/lirc=.

Perhaps the package was built incorrectly?

Quote:

sorry this might be something not even related, but i use a usb transceiver myself. is yours usb also ?
Yes, this is a USB receiver. Refer to the first post for a picture link.

Scuzz 09-07-2009 06:03 PM

start lircd with

lircd /dev/lirc/0

i made a package of lirc with makepkg instead of the slackbuilds script.
chmod 666 /dev/lirc/0

then try your remote again

Woodsman 09-07-2009 06:17 PM

My rc.d script:

/usr/sbin/lircd -d /dev/lirc/0

I have a symlink at /dev/lirc0 pointing to /dev/lirc/0. Permissions are already 666, root:root.


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