[mythtv-users] Dvico MCE style remote + LIRC?

Buzz buzz at oska.com
Sun Aug 28 04:41:42 UTC 2005


I've got one of those dvico MCE remotes, and I'm actually just NOW trying to
get it to work....

There was aparently a patch released to lirc0.7pre4 (I think) that was
supposed to work, see:
http://www.users.on.net/~jani/dvico-mythtv-8.html

I don't know, as I'm running 0.7.2 which supposedly has dvico support
built-in, but it's not working for me at all, so I'm just starting to readup
on lircd, and maybe fix it. (who knows)   (All I can do so far is 'cat
/dev/hiddev0' and see raw IR data from the remote, but that's as far as I
get)....

Buzz.

BTW: 
This is my dvico remote test app, if you're interested (yes, it's aweful,
but I only wrote it this morning), all it does is tell you what button you
just pressed, by reading directly from the raw /dev/hiddev0 device:

-------buzz_dvico_remote.pl-------------
#!/usr/bin/perl -w
# script to test Fusion HDTV DVB-T MCE remote!
#
# fusion remote puts out binary data in the following strings (where XXX is
the variable number):
# ( out from the /dev/ device file )
# 1 0 9 0 1 0 0 0 70 0 1 0 254 XXX 0 0
#
# David Bussenschutt August 2005
#
# this script exits only on ctrl-c.
#
# (when using the set_map function, you should press any already defined key
10 times to exit and get a dump of the # newly defined key_map). 
#
#
use strict;
use Data::Dumper;

my $device = "/dev/hiddev0";
my $DEV;
open $DEV,$device or die( $!);

use Term::ReadKey;
ReadMode 4,$DEV;

# do we want to exit yet?
my $done = 0;

# the keycodes as determined/named by me, using the set_map function below #
my %key_map = (); # START WITH THIS DEFINITION IF YOU USE THE key_map
function.
my %key_map = (
          '90' => 'live',
          '21' => 'vol+',
          '206' => 'power--repeat',
          '71' => 'play_pause',
          '7' => '4',
          '80' => '5',
          '26' => 'dvd',
          '200' => '7--repeat',
          '18' => 'skip',
          '72' => '7',
          '84' => '6',
          '27' => '3',
          '194' => 'start--repeat',
          '95' => 'right',
          '201' => 'back--repeat',
          '151' => '2--repeat',
          '89' => 'i_more',
          '10' => 'guide',
          '31' => 'zoom',
          '11' => '1',
          '207' => 'ff--repeat',
          '142' => 'mp3--repeat',
          '208' => '5--repeat',
          '91' => 'left',
          '78' => 'power',
          '87' => 'mute',
          '77' => 'dvd_menu',
          '133' => 'vol---repeat',
          '149' => 'vol+--repeat',
          '210' => 'photo--repeat',
          '138' => 'guide--repeat',
          '199' => 'play_pause--repeat',
          '153' => 'folder--repeat',
          '15' => 'replay',
          '211' => 'down--repeat',
          '137' => 'ch---repeat',
          '81' => 'up',
          '66' => 'start',
          '73' => 'back',
          '76' => '8',
          '19' => 'ratio',
          '67' => 'rew',
          '204' => '8--repeat',
          '70' => 'tv',
          '139' => '1--repeat',
          '198' => 'tv--repeat',
          '129' => 'rec--repeat',
          '17' => 'ch+',
          '2' => 'dtv',
          '1' => 'rec',
          '88' => '9',
          '30' => 'cpf',
          '141' => 'stop--repeat',
          '222' => 'ok--repeat',
          '82' => 'photo',
          '25' => 'folder',
          '147' => 'ratio--repeat',
          '83' => 'down',
          '218' => 'live--repeat',
          '135' => '4--repeat',
          '14' => 'mp3',
          '215' => 'mute--repeat',
          '145' => 'ch+--repeat',
          '223' => 'right--repeat',
          '150' => 'setup--repeat',
          '131' => '0--repeat',
          '155' => '3--repeat',
          '130' => 'dtv--repeat',
          '217' => 'i_more--repeat',
          '143' => 'replay--repeat',
          '79' => 'ff',
          '22' => 'setup',
          '158' => 'cpf--repeat',
          '205' => 'dvd_menu--repeat',
          '212' => '6--repeat',
          '154' => 'dvd--repeat',
          '219' => 'left--repeat',
          '23' => '2',
          '13' => 'stop',
          '159' => 'zoom--repeat',
          '85' => 'alt-tab',
          '3' => '0',
          '94' => 'ok',
          '213' => 'alt-tab--repeat',
          '9' => 'ch-',
          '146' => 'skip--repeat',
          '209' => 'up--repeat',
          '216' => '9--repeat',
          '5' => 'vol-',
          '195' => 'rew--repeat'
);

# @raw contains the last binary data string of 16 characters my @raw; while
($done < 10) { # a daemon!
	# $key holds the next raw 'char' read in from the /dev/ device, 
	my $key = ''; 
	# $c counts the number of chars read from the /dev/ device in a
single go
	# and should always equal 16 when a input had been read correctly.
	my $c = 0;
	while ( not defined ( $key = ReadKey(-1,$DEV))) {  # no chr in
buffer means gap between button presses!
		my $but = button_hit(@raw) if $c == 15;
		print "$but\n" if defined $but;
		@raw = () if $c == 15;
		$c = 0 if $c == 15;
		$c++;
	}
	my $k = ord($key);
	push (@raw,$k);
}

sub button_hit {
	my @b = @_;
	return undef unless defined $b[0];
	#print "@b\n";
	# all bar $b[13] are statically checked here:
	if ( 	$b[0] == 1 && 
		$b[1] == 0 && 
		$b[2] == 9 && 
		$b[3] == 0 && 
		$b[4] == 1 && 
		$b[5] == 0 && 
		$b[6] == 0 && 
		$b[7] == 0 && 
		$b[8] == 70 && 
		$b[9] == 0 && 
		$b[10] == 1 && 
		$b[11] == 0 && 
		$b[12] == 254 && 
		$b[14] == 0 && 
		$b[15] == 0 )  {
		#print "key: $b[13]\n";
		# to build a new $key_map, uncomment this next line:
		#my $name = set_map($b[13]);
		return $key_map{$b[13]};
	}	
	return undef; # unless we are ready to end....
}


sub set_map {
	my $key = shift;
	if ( $key > 128 ) { 
		$key_map{$key} =  $key_map{$key-128}."--repeat"; 
		print "mapped to: $key_map{$key}\n";
		return $key_map{$key};
	} elsif (defined $key_map{$key} ) {
		print "(exit?:$done)...already mapped to: $key_map{$key}\n";
		$done ++;
		return "";
	} else {
		print "what is the name for that keypress ( $key):?\n";
		my $name = <STDIN>;
		chomp $name;
		$key_map{$key} = $name;
		return $key_map{$key};
	}
}

print Data::Dumper->Dump([\%key_map]);

ReadMode 0,$DEV;
-------buzz_dvico_remote.pl-------------

 

-----Original Message-----
From: mythtv-users-bounces at mythtv.org
[mailto:mythtv-users-bounces at mythtv.org] On Behalf Of clarence clarence
Sent: Sunday, 28 August 2005 12:53 PM
To: mythtv-users at mythtv.org
Subject: [mythtv-users] Dvico MCE style remote + LIRC?

Hello.

Has anyone successfully gotten the newer mce style remote that comes bundled
with the Dvico-Plus range of cards to work?

Cheers
Gary Ayre
_______________________________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users




More information about the mythtv-users mailing list