View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Irblaster repeat
PostPosted: Sun Aug 26, 2007 7:53 am 
Offline
Joined: Thu Jan 18, 2007 6:06 pm
Posts: 39
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


Top
 Profile  
 
 Post subject: Re: Irblaster repeat
PostPosted: Sun Aug 26, 2007 8:51 pm 
Offline
Joined: Thu Feb 19, 2004 6:52 pm
Posts: 117
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 6:33 am 
Offline
Joined: Thu Jan 18, 2007 6:06 pm
Posts: 39
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??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 7:17 pm 
Offline
Joined: Thu Feb 19, 2004 6:52 pm
Posts: 117
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


Top
 Profile  
 

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


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 5 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