From owner-freebsd-multimedia Wed Nov 5 10:19:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA26523 for multimedia-outgoing; Wed, 5 Nov 1997 10:19:28 -0800 (PST) (envelope-from owner-freebsd-multimedia) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id KAA26453 for ; Wed, 5 Nov 1997 10:17:47 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id SAA23167; Wed, 5 Nov 1997 18:01:54 +0100 From: Luigi Rizzo Message-Id: <199711051701.SAA23167@labinfo.iet.unipi.it> Subject: Teletext decoding with the Hauppauge... To: multimedia@freebsd.org Date: Wed, 5 Nov 1997 18:01:54 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Enclosed is a very primitive program, which, together with the Bt848 patches that I submitted a few days ago allow you to capture teletext data. The program is very raw since it was meant as a command-line tool to control tuner parameters (channel, brightness, etc.) and was later extended to access the I2C peripherals and then further extended to capture txt pages. As it is now, you can run it and then issue commands like txt 120 to capture page 120, etc. -- when a page is done it is displayed on stdout. Fancy user interfaces will come next year... I am not sure if the card can only capture teletext, or also close-captioning or other "extended" services available around the world. As an example, it _might_ be able to capture Intercast data (but decoding them is a completely different issue...) in the locations where this service is available. The patch for the Bt848 driver for those who have lost it is the following: in /sys/pci/brooktree848.c, as one of the switches in tuner_ioctl(), add the following: static int tuner_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr ) { ... case BT848_I2CWR: /* XXX */ { u_long par = *(u_long *)arg; u_char write = (par >> 24) & 0xff ; int i2c_addr = (par >> 16) & 0xff ; int i2c_port = (par >> 8) & 0xff ; u_long data = (par) & 0xff ; if (write) { i2cWrite( bktr, i2c_addr, i2c_port, data); } else { data = i2cRead( bktr, i2c_addr); } *(u_long *)arg = (par & 0xffffff00) | ( data & 0xff ); } break; in /sys/i386/include/ioctl_bt848.h add the following (near the definition of other ioctl()s : /* * b7-b0: data (read/write) * b15-b8: internal peripheral register (write) * b23-b16: i2c addr (write) * b31-b24: 1 = write, 0 = read */ #define BT848_I2CWR _IOWR('x', 57, u_long) /* i2c read-write */ Cheers Luigi begin 664 txt.c.gz M'XL(`&K08#0``\U8>W/;-A+_6_P46W4$IB`R2.$W% M..20Q>#%42;C$*Z8%'&>*O;2"/+(RT0>3J9KQXMF, M13Z$`O4QC*$>IL`D1TD^IYT,OO#%=2S]0AONPW@!>4*"D1?G(**,3[A,NZ3S M`B2+)JBZC&=PQ>4"<`^$_(J'I;@4>,3&(9F%/*ZER/B6Y,PWA.N!Y!.19L@- MS#SEI.4,KD4VA0%\.!V10A[+R2R+-I-H.>.^8!DW*O:X,.'95LHS&$LQF681 M3],.>%,613SL`,^\;H>HIKCX>E4W`Z<#)$"`>,@S/D>HV00Q5P81:.>#P:Z[ MLP<^]V*?2\1M@"0R$RQ$(--,Z5BJHC%#8P8=..K`4$%;`@;74X&"/!898PY\ MGDC4$_$5$3$7,V082YCRN;5O&`"0H3*#1B.1R&!5/1@4Z]>(TQ$,&PT%*]GX MWAU"PJ5(IEPBPP%Z+T-SCH`$")P4Z/P+F^U)!-B3E`)7S M6<9*'20I00[3F-P5H,@\_!$9^:#`G931BR)J%$LB2O(,TCB7GE)V`*9]>"5\ M'G?`.51QW.UV+<-HX!_#2#DOXM:GY)`0XP@#C]:@M648/XK("W-<[*>9+^+N M].WJ5"C&=^86Z5;@15EX?UK$WMWI/$+_^JMS7,I("3)^]'F`B02CCR?'9S6* M&?.F.*\97HXI"U=9K!+,T*VQ5!S)SPJ-`_5NS)B(3)IDG@IG":T6N[*,KX0J MA17,:?Y`#=5Z>@&.VX//!X8F"<`T%4C``0C4U=W=PY?V(;A*Z9)2'NCWM#2BTU0!O.&##38J+JR"0B(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