From owner-freebsd-multimedia@FreeBSD.ORG Sun May 11 15:50:01 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E99E37B401 for ; Sun, 11 May 2003 15:50:01 -0700 (PDT) Received: from maild.telia.com (maild.telia.com [194.22.190.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AB3C43FAF for ; Sun, 11 May 2003 15:50:00 -0700 (PDT) (envelope-from home@jukkis.net) Received: from d1o989.telia.com (d1o989.telia.com [213.65.228.241]) by maild.telia.com (8.12.9/8.12.9) with ESMTP id h4BMnwoF003252 for ; Mon, 12 May 2003 00:49:59 +0200 (CEST) X-Original-Recipient: Received: from localhost (h80n2fls32o989.telia.com [217.208.125.80]) by d1o989.telia.com (8.10.2p2/8.10.1) with ESMTP id h4BMnwc27368 for ; Mon, 12 May 2003 00:49:58 +0200 (CEST) From: Jukka Simila To: multimedia@freebsd.org Content-Type: text/plain Organization: Message-Id: <1052693541.31937.64.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 May 2003 00:52:21 +0200 Content-Transfer-Encoding: 7bit Subject: Control MPlayer with Hauppauge IR remote X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2003 22:50:01 -0000 Long story with some (IMHO) great news: A while ago when I upgraded my mobo, fxtv stopped working (I wrote about it to this list but never got it work) Then I discovered that MPlayer -tv works beautifully. Only thing missing was the remote control, which I really like to use, since I like to channelsurf. I couldn't figure out how to add hauppauge remote as input source to MPlayer,so I wrote this piece of software URMon, "Universal Remote Monitor" (working title :P). The program is still in *VERY* early alpha, I have no idea how ugly the code might look to someone's eyes, but in the hopes that it is useful to someone, I rolled a tarball and put it to http://www.jukkis.net/urmon.tar.gz It consists of two separate programs, 'urmon', which monitors an IPC message queue, and when it receives a message, it translates it to keyboard keypresses, and sends them to X with XTestFakeKeyEvent. Second program, in this case 'urmon_hauppauge', handles the hauppauge remote, ie. opens bktr device and polls it, and when it detects a keypress, it sends it to the message queue that urmon is listening. This approach (I hope) allows *very* easy addition of other IR remotes, like PixelView's. They just need to be separate programs that send keypresses to the message queue. At the moment, the remotekey->keypress translations are hard- coded to source (see util.c), and I can successfully control MPlayer with it. (read: I can change channels, toggle fullscreen and close mplayer :) Also, at the moment, urmon_hauppauge leaves TVCards audio unmuted, and urmon/urmon_hauppauge exit when 'TV' key is pressed. I will have to figure a way to control the muting/unmuting, perhaps thru mixer instead of bktr, but in the meanwhile this leaves the program usable practically only for controlling mplayer in TV mode. (As in 'start urmon when mplayer -tv starts, close tv with remote') So if you are adventurous/eager to use MPlayer with remote, feel free to try the program. My plan is to have the translations user configurable, so that there's a config file for MPlayer, XMMS, Xine, Ogle, whatever, you name it. All the program does is effectively change the remote control to a limited keyboard. I'm just cooling off from the coding mode and transforming back to designing mode, I need to figure a good way to switch between the translation tables, and I'm thinking I'll add a possibility to run commands, like start tv, or radio, or dvdplayer.. but I need to think about that first. Well designed is 50% done, or something. Some example configs, if you have trouble getting mplayer -tv to work (I did): Here's my ~/.mplayer/input.conf: 1 tv_set_channel 1 2 tv_set_channel 2 3 tv_set_channel 3 4 tv_set_channel 4 5 tv_set_channel 5 6 tv_set_channel 6 7 tv_set_channel 7 8 tv_set_channel 8 (I only got 8 channels..) I start mplayer with a shell script tvmplayer: >cat ~/bin/tvmplayer #!/bin/sh ~/bin/urmon > /dev/null& ~/bin/urmon_hauppauge >/dev/null& mplayer -tv on:driver=bsdbt848:input=1:norm=PAL:\ chanlist=europe-west:channel=5:width=768:height=576:\ channels=E4-SVT1,E5-SVT2,E12-Kanal_3,E7-TV4,E10-Kanal_5,\ E8-MTV,E9-Discovery,E11-Eurosport -really-quiet If you reply please cc to me, for some reason I don't get mail from multimedia list althou I'm supposed to be subscribed. FWIW, //Jukkis