LinHES Forums
http://forum.linhes.org/

Irblaster repeat
http://forum.linhes.org/viewtopic.php?f=17&t=16224
Page 1 of 1

Author:  thrillhouse [ Sun Aug 26, 2007 7:53 am ]
Post subject:  Irblaster repeat

So I have a PVR-500 hooked up to the cable coming out of the wall and then an IR blaster to control my DCT-2000 which inputs to the first s-video input on the PVR-500. I set up the sources so that channels 2-73 are hooked up the tuners on the PVR-500 and the digital channels go through the s-video cable. The IR blaster works a majority of the time, but sometimes it misses a number or two. What do I need to change in the channel_change script to make it repeat the number again, or is there a better solution??

Here is the channel_change.sh:

mueller@holloway:~/channel$ cat /etc/irblaster/channel_change.sh
#!/bin/bash

echo "changing to $1"

REMOTE_NAME=\
$(grep ^[[:space:]]*name[[:space:]] /etc/irblaster/irblasterd.conf |
awk '{ print $2 }')

echo $REMOTE_NAME

for digit in $(echo $1 | sed -e 's/./& /g'); do
sleep 0.2
/usr/bin/irsend --device=/dev/irblasterd SEND_ONCE $REMOTE_NAME $digit
sleep 0.5
done

Author:  wrooster [ Sun Aug 26, 2007 8:51 pm ]
Post subject:  Re: Irblaster repeat

thrillhouse wrote:
The IR blaster works a majority of the time, but sometimes it misses a number or two. What do I need to change in the channel_change script to make it repeat the number again, or is there a better solution?


read "IMPORTANT NOTE #2" about 3/4ths of the way down
http://losdos.dyndns.org:8080/public/my ... HOWTO.html

while my writeup linked to above is outdated due to the irblaster auto-configuration introduced in later KnoppMyth releases, the problem described in that section is still valid.

hence,

Code:
root@mythtv:/# ps -C irblasterd
  PID TTY          TIME CMD
 3006 ?        00:00:00 irblasterd


so the current PID on my machine is 3006.

we can manually up the irblasterd priority as follows,

Code:
root@mythtv:/# renice -15 3006


note that the PID is also recorded in a file when irblasterd is started up via the /etc/init.d/irblaster script,

Code:
root@mythtv:/etc/init.d# cat /var/run/irblasterd.pid
3006


this is handy, as such,

Code:
root@mythtv:/etc/init.d# renice -15 `cat /var/run/irblasterd.pid`
3006: old priority 0, new priority -15


ergo, we can use this bit of info to change the priority right after irblasterd is started, as shown in this snippet from /etc/init.d/irblaster

Code:
   
    ...
    echo -n "Starting irblaster daemon:"
    start-stop-daemon --start \
        --startas /usr/sbin/irblasterd --pidfile /var/run/irblasterd.pid \
        -- --driver=default --device=/dev/irblaster \
        --pidfile=/var/run/irblasterd.pid --output=/dev/irblasterd \
        /etc/irblaster/irblasterd.conf < /dev/null
    echo "."

    if [ -s /var/run/irblasterd.pid ]
    then
      renice -15 `cat /var/run/irblasterd.pid`
    fi

    ;;
    ...


thus,

Code:
root@mythtv:/etc/init.d# ./irblaster start
Starting irblaster daemon:.
6065: old priority 0, new priority -15




jim aka the wrooster

ETA:
i would also make sure that you have enough inter-digit gap. play around with longer times and see if that makes a difference.

Author:  thrillhouse [ Mon Aug 27, 2007 6:33 am ]
Post subject: 

I think I figured out why it is doing that. The cable box is hooked up to tuner 2 and I have the myth box set to use the tuner with the least things scheduled on it. So right away when I tune in to watch tv it uses turner 1. So when the IR blaster sends the channel, it has to switch to the second encoder first. Once its on that encoder, the channel changing is not a problem. So either I need a way to repeat it with a long enough pause for the box to switch to the second encoder or put that in the script before it sends the channel. I assume it would be much less of a pain in the ass to just send the channel again. Any thoughts??

Author:  wrooster [ Mon Aug 27, 2007 7:17 pm ]
Post subject: 

thrillhouse wrote:
Any thoughts??


it's not very clear what your issue actually is.

your first post indicates that "The IR blaster works a majority of the time, but sometimes it misses a number or two."

your second post indicates that "So either I need a way to repeat it with a long enough pause for the box to switch to the second encoder."

if you need a pause, simply put a sleep statement in the script before any commands are sent to the cable box.

thrillhouse wrote:
So when the IR blaster sends the channel, it has to switch to the second encoder first.


the IR blaster does not "switch" anything.

i believe that the solution could be as simple as only having your channel change script send channel change commands to the cable box via the IR balster if the requested channel is above 73.

Code:
#!/bin/bash

if [ $1 -gt 73 ]
then
  echo "changing to $1"
else
  exit 0
fi

... insert rest of channel_change.sh script here...




jim aka the wrooster

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/