View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Mon Apr 30, 2012 9:15 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 199
When I reboot my system, my remote control does not work. I've traced the problem to the "run" script in /etc/sv/lircd, the execution halts on this line:
Code:
in_kernel_support "disable"

I have the same problem when I try to turn lircd off using "sv" because in the finish script there is a similar line:
Code:
in_kernel_support "enable"


I do have 2 devices in /sys/class/rc:
Code:
# cat /sys/class/rc/rc0/protocols
rc-5 nec [rc-6] jvc sony [lirc]
# cat /sys/class/rc/rc1/protocols
other


I'd appreciate any suggestions.


Top
 Profile  
 
PostPosted: Mon Apr 30, 2012 10:14 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1194
Location: SC
The in_kernel_support function is in /usr/MythVantage/bin/install_functions.sh. Try copying it to a test file and run it to see where the error may be.


Top
 Profile  
 
PostPosted: Wed May 02, 2012 9:10 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 199
brfransen wrote:
The in_kernel_support function is in /usr/MythVantage/bin/install_functions.sh. Try copying it to a test file and run it to see where the error may be.


Thanks for your response. The execution stops at the first echo that is executed. As you can see, I am running this as root:
Code:
# bash -x in_kernel_support.sh
+ in_kernel_support disable
+ '[' -d /sys/class/rc ']'
++ ls -A /sys/class/rc
+ '[' 'rc0
rc1' ']'
++ find /sys/class/rc/rc0/ /sys/class/rc/rc1/ -name protocols
+ for file in '`find /sys/class/rc/*/ -name protocols`'
+ '[' disable = disable ']'
+ echo lirc
+ for file in '`find /sys/class/rc/*/ -name protocols`'
+ '[' disable = disable ']'
+ echo lirc

I think the problem is LCDd is already running and we are "switching" protocols on it. After doing all the echo commands, my VFD was messed-up and I had to reboot. One fix would be to have these run before LCDd starts, not sure if that is possible.


Top
 Profile  
 
PostPosted: Wed May 02, 2012 10:17 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1194
Location: SC
What do rc0 and rc1 look like after you manually echo lirc?


Top
 Profile  
 
PostPosted: Thu May 03, 2012 9:10 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 199
brfransen wrote:
What do rc0 and rc1 look like after you manually echo lirc?


I cannot echo to rc1 when is LCDd is running. When LCDd is not running, rc1 is always "other" (iMon). The rc0 (MCE usb) can be changed and appears to work properly:
Code:
$ cat /sys/class/rc/rc0/protocols
rc-5 nec rc-6 jvc sony [lirc]
$ cat /sys/class/rc/rc1/protocols
other


To work around this, I've created a /etc/runit/lirc.sh file for my system:
Code:
#!/bin/bash

LOG=/tmp/lirc.log
LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd"

for file in `find /sys/class/rc/*/ -name protocols`; do
  if grep -q lirc $file ; then
    echo lirc > $file
  fi
done

exec $LCMD >>$LOG 2>>$LOG

shamelessly stolen from LinHes scripts.


Top
 Profile  
 
PostPosted: Thu May 03, 2012 11:06 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1194
Location: SC
bobmyth,

Would you mind testing to see if this fixes it? Replace function in_kernel_support() in /usr/MythVantage/bin/install_functions.sh with:
Code:
function in_kernel_support() {
    #lifted from mythbuntu
    #For disabling other protocols, adjust to the new location in 2.6.37.    91
    if [ -d /sys/class/rc ] && [ "$(ls -A /sys/class/rc)" ]
    then
        SVSTOP=0
        if [ -d /service/lcdd ]; then
            sv stop lcdd
            SVSTOP=1
        fi
        for file in `find /sys/class/rc/*/ -name protocols`
        do
            if [ "$1" = "disable" ]
            then
                echo "lirc" > $file
            else
                echo "none" > $file
                for protocol in `cat $file`; do
                echo "+${protocol}" > $file
                done
            fi
        done
        if [ $SVSTOP -eq 1 ]; then
            sv start lcdd
        fi
    fi
}


Top
 Profile  
 
PostPosted: Mon May 07, 2012 9:00 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 199
I will report back.


Top
 Profile  
 
PostPosted: Wed May 09, 2012 10:24 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 199
@brfransen: the new function worked great. Thanks.

One suggestion related to lirc, in /etc/sv/lircd/run around line 29 it reads:
Code:
if [ -f /etc/runit/lirc.sh ]
then
    #program must not terminate.

    stat_runit "Starting lirc"

    /etc/runit/lirc.sh

Could this be changed to:
Code:
if [ -x /etc/runit/lirc.sh ]

This will allow a user to turn off execute and then use the standard boot-up script. If the script is not executable in the first place it wouldn't get executed anyway. Thanks.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu