Date: Tue, 19 Jun 2001 10:43:56 +0100 (BST) From: Kevin Walton <kevin@unseen.org> To: <freebsd-multimedia@FreeBSD.ORG> Cc: Tim Pozar <pozar@lns.com> Subject: BKTR Audio/Tuning problems Message-ID: <Pine.BSF.4.33.0106191014230.27265-300000@mach.unseen.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi
Im running:
FreeBSD 4.0-RELEASE #4: Tue May 22 20:11:05 BST 2001
kevin@quota.unseen.org:/usr/src/sys/compile/QUOTA
on a:
CPU: Pentium III/Pentium III Xeon (746.76-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x681 Stepping = 1
with a:
bktr0: <BrookTree 848A> mem 0xf4301000-0xf4301fff irq 9 at device 15.0 on pci0
bktr0: Detected a DPL34193?-\M-G8 at 0x84
bktr0: Pinnacle/Miro TV, Temic NTSC tuner, dpl3518a dolby.
full dmesg attached.
It is an early Hauppauge WinTV/FM Radio card. It has an FM aerial, a TV
Aerial, a comp video and an external audio source pluged into it.
I am having problems tunning frequencies on it both TV and Radio, however
ill stick to trying to solve the simpler radio issue here.
I have taken Tim's tuneradio program. It compiles relativly cleanly:
9 root@quota:/usr/local/src/tuneradio/ > cc -o tr tr.c
tr.c: In function `main':
tr.c:86: warning: passing arg 2 of `signal' from incompatible pointer type
tr.c:86: warning: comparison between pointer and integer
tr.c:90: warning: passing arg 2 of `signal' from incompatible pointer type
tr.c:90: warning: comparison between pointer and integer
I added some debuging to it (attached) and here is the output, and some
comentry of what I hear:
10 root@quota:/usr/local/src/tuneradio/ > ./tr
DEBUG: Opening dsp device
# lots of static at normal volume
DEBUG: Set internal audio
# silence
DEBUG: Get mode
# silence
DEBUG: Set mode - mono/afc
# silence
DEBUG: Set frequency
# 1/2 a second of the line in then silence
^CShutting down...
DEBUG: Set internal audio
# lots of static at normal volume
DEBUG: Set unmute audio
# lots of static at normal volume
DEBUG: close device
# silence
I set the default station to 95.8 (int frequency = 9580;) a very local
station that could be recieved even if the aerial wasnt plugged in.
So im very confused! Any help, suggestions, ideas appretiated!
Thanks
Kevin
--
Kevin Walton Fax: +44 (0)870 1640411
UnSeen.org
[-- Attachment #2 --]
/*
*
* TUNERADIO
*
* Opens the the tuner device (ie. /dev/tuner) sets the frequency,
* stereo/mono and AFC modes. It then sits in a while loop to
* keep the device open.
*
* I needed this program to run on remote computers that stream
* MP3 streams out to the net of radio stations. This program
* assumes the Brooktree 848 card and interface for *BSD.
*
* Copyright (C) 2000 Timothy Pozar pozar@lns.com
*
* $Id: tuneradio.c,v 1.2 2000/02/22 19:20:02 pozar Exp pozar $
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <machine/ioctl_bt848.h>
#define TRUE 1
#define FALSE 0
#define BUF_SIZE 4096
#define DEBUG 1
char device[BUF_SIZE] = "/dev/tuner";
int mono = FALSE;
int afc = FALSE;
int frequency = 9580; /* 8850 = 88.5Mhz */
int devfh;
int setaudio;
static void cleanup (void);
static void cntlc_handler (void);
int main(argc,argv)
int argc;
char *argv[];
{
int gotmask, setmask, gotfreq, setfreq, i, c;
/* scan command line arguments, and look for files to work on. */
for (i = 1; i < argc; i++) {
switch (argv[i][1]){ /* be case indepenent... */
case 'A': /* Run with AFC... */
case 'a':
afc = TRUE;
break;
case 'D': /* dsp file name... */
case 'd':
i++;
strncpy(device,argv[i],BUF_SIZE);
break;
case 'F': /* Frequency in 10 KHz... */
case 'f':
i++;
frequency = atoi(argv[i]);
if((frequency < 8800) || (frequency > 10800)){
printf("Frequency %i is out of range of 8800 to 10800\n",frequency);
exit(1);
}
break;
case 'H': /* Help... */
case 'h':
banner();
exit(0);
case 'M': /* Run in mono... */
case 'm':
mono = TRUE;
break;
default:
printf("I don't know the meaning of the command line argument: \"%s\".\n",argv[i]);
banner();
exit(1);
}
}
if (atexit (cleanup) == -1)
perror ("atexit");
if (signal (SIGINT, cntlc_handler) == -1) {
perror ("Signal INT...");
exit (1);
}
if (signal (SIGHUP, cntlc_handler) == -1) {
perror ("Signal HUP...");
exit (1);
}
if(DEBUG) { printf("DEBUG: Opening dsp device\n"); c = getchar();}
if((devfh = open(device, O_RDONLY)) == -1){
perror("opening dsp device");
exit(1);
}
if(DEBUG) { printf("DEBUG: Set internal audio\n"); c = getchar();}
setaudio = AUDIO_INTERN;
if(ioctl(devfh, BT848_SAUDIO, &setaudio) == -1){
perror("set internal audio ");
exit(1);
}
if(DEBUG) { printf("DEBUG: Get mode\n"); c = getchar();}
if(ioctl(devfh, RADIO_GETMODE, &gotmask) == -1){
perror("get mode");
exit(1);
}
setmask = gotmask;
if(mono)
setmask |= RADIO_MONO;
else
setmask &= ~RADIO_MONO;
if(afc)
setmask |= RADIO_AFC;
else
setmask &= ~RADIO_AFC;
if(DEBUG) { printf("DEBUG: Set mode - mono/afc\n"); c = getchar();}
if(ioctl(devfh, RADIO_SETMODE, &setmask) == -1){
perror("set mode - mono/afc");
exit(1);
}
if(DEBUG) { printf("DEBUG: Set frequency\n"); c = getchar();}
if(ioctl(devfh, RADIO_SETFREQ, &frequency) == -1){
perror("set frequency");
exit(1);
}
while(1){
ioctl(devfh, RADIO_SETFREQ, &frequency);
/* sleep(1); */
}
exit(0);
}
banner()
{
printf("tuneradio: Set \"%s\" frequency, AFC and stereo/mono mode,\n",device);
printf(" and then keep the tuner open.\n");
printf(" -a Sets tuner to run with AFC. Default is off.\n");
printf(" -d device Sets device name for the tuner. Default is \"%s\".\n",device);
printf(" -f frequency Sets tuner frequency (10Khz ie 88.1Mhz = 8810).\n");
printf(" Default is \"%i\".\n",frequency);
printf(" -m Sets tuner to run in mono. Default is stereo.\n");
return;
}
/*
* cntlc_handler()
*
* runs when a user does a CNTL-C...
*
*/
void
cntlc_handler ()
{
exit (0);
}
/*
* cleanup()
*
* runs on exit...
*
*/
void
cleanup ()
{
int c;
printf ("Shutting down...\n");
if(DEBUG) { printf("DEBUG: Set internal audio\n"); c = getchar();}
setaudio = AUDIO_EXTERN;
if(ioctl(devfh, BT848_SAUDIO, &setaudio) == -1){
perror("set internal audio ");
}
if(DEBUG) { printf("DEBUG: Set unmute audio\n"); c = getchar();}
setaudio = AUDIO_UNMUTE;
if(ioctl(devfh, BT848_SAUDIO, &setaudio) == -1){
perror("set unmute audio ");
}
close (devfh);
}
[-- Attachment #3 --]
Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
FreeBSD 4.0-RELEASE #4: Tue May 22 20:11:05 BST 2001
kevin@quota.unseen.org:/usr/src/sys/compile/QUOTA
Timecounter "i8254" frequency 1193182 Hz
CPU: Pentium III/Pentium III Xeon (746.76-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x681 Stepping = 1
Features=0x387f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,PN,MMX,FXSR,XMM>
real memory = 402653184 (393216K bytes)
avail memory = 387268608 (378192K bytes)
Preloaded elf kernel "kernel" at 0xc0308000.
Pentium Pro MTRR support enabled
md0: Malloc disk
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <3Dfx Voodoo 3 graphics accelerator> at 0.0 irq 10
isab0: <Intel 82371AB PCI to ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 ATA33 controller> port 0x1040-0x104f at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x1000-0x101f irq 9 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ugen0: OmniVision OV511 Camera, rev 1.00/1.00, addr 2
chip1: <Intel 82371AB Power management controller> port 0x7000-0x700f at device 7.3 on pci0
fxp0: <Intel EtherExpress Pro 10/100B Ethernet> port 0x1020-0x103f mem 0xf4000000-0xf40fffff,0xf4300000-0xf4300fff irq 5 at device 14.0 on pci0
fxp0: Ethernet address 00:90:27:1a:70:7b
bktr0: <BrookTree 848A> mem 0xf4301000-0xf4301fff irq 9 at device 15.0 on pci0
bktr0: Detected a DPL34193?-\M-G8 at 0x84
bktr0: Pinnacle/Miro TV, Temic NTSC tuner, dpl3518a dolby.
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <keyboard controller (i8042)> at port 0x60-0x6f on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1: configured irq 3 not in bitmap of probed irqs 0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/7 bytes threshold
ppi0: <Parallel I/O> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppc1: <Parallel port> at port 0x278-0x27f irq 11 on isa0
ppc1: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
ppi1: <Parallel I/O> on ppbus1
lpt1: <Printer> on ppbus1
lpt1: Interrupt-driven port
pcm0: <Yamaha OPL-SAx> at port 0x240-0x24f,0xe80-0xe87,0x388-0x38b,0x300-0x301,0x100-0x101 irq 10 drq 0,1 on isa0
unknown0: <OPL3-SA2 Sound Board> at port 0x201 on isa0
ad0: 12360MB <Maxtor 91296D6> [25113/16/63] at ata0-master using UDMA33
ad1: 32634MB <IBM-DPTA-373420> [66305/16/63] at ata0-slave using UDMA33
acd0: CDROM <TOSHIBA CD-ROM XM-6102B> at ata1-master using PIO3
Mounting root from ufs:/dev/ad0s1a
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.33.0106191014230.27265-300000>
