From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 13 12:34:53 2004 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 DD6B516A4CE; Tue, 13 Jan 2004 12:34:53 -0800 (PST) Received: from lakemtao08.cox.net (lakemtao08.cox.net [68.1.17.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AF6643D31; Tue, 13 Jan 2004 12:34:52 -0800 (PST) (envelope-from kitsune@gmx.co.uk) Received: from vixen42 ([68.109.49.234]) by lakemtao08.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with SMTP id <20040113203450.MGBM2412.lakemtao08.cox.net@vixen42>; Tue, 13 Jan 2004 15:34:50 -0500 From: kitsune To: Stefan Walter Message-Id: <20040113143328.546d6f3c@vixen42.> In-Reply-To: <20040113195344.GA1999@kyuzo.dunkelkammer.void> References: <20040113152037.GA850@kyuzo.dunkelkammer.void> <20040113112054.0bc3aee4@vixen42.> <20040113195344.GA1999@kyuzo.dunkelkammer.void> X-Mailer: Sylpheed version 0.9.8claws (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: current@freebsd.org cc: multimedia@freebsd.org Subject: Re: VIA KT400A and AGP/DRI? 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: , Date: Tue, 13 Jan 2004 20:34:54 -0000 X-Original-Date: Tue, 13 Jan 2004 14:33:28 -0600 X-List-Received-Date: Tue, 13 Jan 2004 20:34:54 -0000 On Tue, 13 Jan 2004 20:53:44 +0100 Stefan Walter wrote: > kitsune, 13.01.04, 18:20h CET: > > > Well after looking at it, I really can't thing of any reason DRI would not > > work based on dmesg... it finds the agp and the drm, so as long as X is > > setup right, it should work. What I would be suspect of is X config. Not > > sure why, but if I set the agp speed higher than 2x, it would freeze, after > > I used opengl for a bit. I would try messing with the options for that card > > in the X config and see if any of those are suspect. > > I doubt it's the X configuration; see [1] - I don't see anything special > in it, and the BIOS settings aren't aggressive at all, either. > > Pav Lucistnik said in another mail that he's having the same problem, > and that it used to work somewhere before 5.1-CURRENT. I can't comment > on the latter, of course, as I got this board yesterday only. > > Stefan > > [1]: http://www.gegenunendlich.de/stuff/kyuzo/XF86Config_kyuzo Hmm, after looking at the X config... yeah that def looks like it could def be probs with the agp device... From owner-freebsd-multimedia@FreeBSD.ORG Sun Jan 25 09:34:58 2004 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 CB32116A4CE for ; Sun, 25 Jan 2004 09:34:58 -0800 (PST) Received: from server2.teleport.ch (server2.teleport.ch [157.161.16.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3A9D43D31 for ; Sun, 25 Jan 2004 09:34:55 -0800 (PST) (envelope-from espen@teleport.ch) Received: from pimp.intern-lan (cable-rhf1-061.teleport.ch [157.161.32.61]) by server2.teleport.ch (8.12.9p2/8.12.9) with SMTP id i0PHYp5j084529 for ; Sun, 25 Jan 2004 18:34:52 +0100 (CET) (envelope-from espen@teleport.ch) Date: Sun, 25 Jan 2004 18:37:14 +0100 From: Espen Jervidalo To: freebsd-multimedia@freebsd.org Message-Id: <20040125183714.4de80843.espen@teleport.ch> In-Reply-To: <20040125000805.GE27786@o503.hadiko.de> References: <20040125000805.GE27786@o503.hadiko.de> Organization: X-Mailer: Sylpheed version 0.9.8a-gtk2-20040109 (GTK+ 2.2.4; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Please test: mplayer 1.0pre3 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, 25 Jan 2004 17:34:58 -0000 hi, the port doen't compile correctly on my 5.2 box. it stops after applying some patches with: ===> Extracting for mplayer-gtk-esound-0.99.3 >> Checksum OK for MPlayer-1.0pre3.tar.bz2. ===> Patching for mplayer-gtk-esound-0.99.3 ===> Applying FreeBSD patches for mplayer-gtk-esound-0.99.3 1 out of 1 hunks failed--saving rejects to cfg-common.h.rej >> Patch patch-cfg-common.h failed to apply cleanly. >> Patch(es) patch-ad patch-ae applied cleanly. *** Error code 1 might it be some problems with patching mplayer to use the bsdbt848 instead of v4l? i saw through some of the patches and it looked like it would concern something in that direction. if you need some more information, just let me know. some dmesg output attached on the bottom. Espen > Hi all, > > if you can find some time in the next days, please test this update to > the mplayer port: > > http://www.stud.uni-karlsruhe.de/~uedc/mplayer/0993.tar.bz2 > > There have been many changes from 0.92 to 1.0pre, so any information > about if it's good, bad, lacking features, patches.... are highly > appreciated before it is put into the ports tree. FreeBSD 5.2-RELEASE #0: Sat Jan 17 18:08:57 CET 2004 bktr0: mem 0xdddfe000-0xdddfefff irq 12 at device 7.0 on pci0 bktr0: Hauppauge Model 38074 B421 bktr0: Hauppauge WinCast/TV, Philips FR1216 PAL FM tuner, remote control. CPU: AMD Duron(tm) Processor (1003.66-MHz 686-class CPU) From owner-freebsd-multimedia@FreeBSD.ORG Mon Jan 26 16:16:51 2004 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 B9E3116A4CE; Mon, 26 Jan 2004 16:16:51 -0800 (PST) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2291D43D60; Mon, 26 Jan 2004 16:15:21 -0800 (PST) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id 0376A9728; Tue, 27 Jan 2004 01:06:20 +0100 (CET) Date: Tue, 27 Jan 2004 01:06:18 +0100 From: Simon Barner To: Kris Kennaway Message-ID: <20040127000618.GE65527@zi025.glhnet.mhn.de> References: <20040125000805.GE27786@o503.hadiko.de> <20040126032518.GE47635@zi025.glhnet.mhn.de> <20040126075053.GB3236@o503.hadiko.de> <20040126131522.GG47635@zi025.glhnet.mhn.de> <20040126232226.GA48078@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E7i4zwmWs5DOuDSH" Content-Disposition: inline In-Reply-To: <20040126232226.GA48078@xor.obsecurity.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de cc: ports@freebsd.org cc: "Thomas E. Zander" cc: multimedia@freebsd.org Subject: Re: Please test: mplayer 1.0pre3 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: Tue, 27 Jan 2004 00:16:51 -0000 --E7i4zwmWs5DOuDSH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Kris Kennaway wrote: > With the new version, I cannot seem to pause videos with the 'space' > key when running gmplayer. This was a bit 'picky' under the previous > port version: I would often have to press the key a few times to get > it to actually stay paused, but the new one doesn't want to stay > paused no matter how many times I do it. > My port is built with: >=20 > WITH_OPTIMIZED_CFLAGS=3D1 > WITHOUT_RUNTIME_CPUDETECTION=3D1 > WITH_GTK2=3D1 I used the same cpu option (+ tons of already installed and auto-detected gadgets), but I used the gtk1 gui, since I'm still on -stable, where the gtk2 gui does currently not compile. I just wanted to write that pausing videos works for me, but that's only true for the cli version of mplayer: Also with the gtk1 gui, neither 'space' nor 'p' work. Simon --E7i4zwmWs5DOuDSH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQFAFat6Ckn+/eutqCoRAhpAAJ9B6yw1c6Dr9X6trmkBGDcmGE4JfQCg38M/ S5zby7Sr4l8+bMdttYomc2A= =E9TK -----END PGP SIGNATURE----- --E7i4zwmWs5DOuDSH-- From owner-freebsd-multimedia@FreeBSD.ORG Mon Jan 26 16:18:37 2004 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 7274116A4D0 for ; Mon, 26 Jan 2004 16:18:37 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FE8F43D9F for ; Mon, 26 Jan 2004 16:17:53 -0800 (PST) (envelope-from adamk@voicenet.com) Received: from thorn.ashke.com (pcp04363492pcs.glstrt01.nj.comcast.net[68.44.153.152]) by comcast.net (rwcrmhc11) with SMTP id <20040127001702013008ka41e>; Tue, 27 Jan 2004 00:17:02 +0000 Date: Mon, 26 Jan 2004 19:16:49 -0500 (EST) From: Adam K Kirchhoff X-X-Sender: adamk@thorn.ashke.com To: freebsd-multimedia@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: 4 Speaker output. 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: Tue, 27 Jan 2004 00:18:37 -0000 I'm curious if anyoe has any pointers on how to modify the ds1 driver to allow for 4 speaker output? Adam From owner-freebsd-multimedia@FreeBSD.ORG Mon Jan 26 23:34:41 2004 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 81F5816A4CE for ; Mon, 26 Jan 2004 23:34:41 -0800 (PST) Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id B841443D1D for ; Mon, 26 Jan 2004 23:34:39 -0800 (PST) (envelope-from riggs@o503.hadiko.de) Received: from o503.hadiko.de (hadio503.hadiko.uni-karlsruhe.de [172.20.45.138]) by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.36 #1) id 1AlNk3-0006ra-00; Tue, 27 Jan 2004 08:34:35 +0100 Received: from o503.hadiko.de (RIXT@localhost [127.0.0.1]) by o503.hadiko.de (8.12.10/8.12.10) with ESMTP id i0R7YY8v010483; Tue, 27 Jan 2004 08:34:35 +0100 (CET) (envelope-from riggs@o503.hadiko.de) Received: (from riggs@localhost) by o503.hadiko.de (8.12.10/8.12.10/Submit) id i0R7YXlZ010482; Tue, 27 Jan 2004 08:34:33 +0100 (CET) (envelope-from riggs) Date: Tue, 27 Jan 2004 08:34:33 +0100 From: "Thomas E. Zander" To: Espen Jervidalo Message-ID: <20040127073433.GA10363@o503.hadiko.de> References: <20040125000805.GE27786@o503.hadiko.de> <20040125183714.4de80843.espen@teleport.ch> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <20040125183714.4de80843.espen@teleport.ch> Organization: RiggiServ - Ihr Partner =?iso-8859-15?Q?f?= =?iso-8859-15?Q?=FCr?= alles Delikate X-PGP-KeyID: 0xC85996CD X-PGP-URI: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xC85996CD X-PGP-Fingerprint: 4F59 75B4 4CE3 3B00 BC61 5400 8DD4 8929 C859 96CD X-Mailer: Riggisoft Ausguck Eggsbress (Build 1075188740) X-Operating-System: Riggiland BSD 5.2-CURRENT (To serve and protect.) cc: multimedia@freebsd.org Subject: Re: Please test: mplayer 1.0pre3 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: Tue, 27 Jan 2004 07:34:41 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 25. Jan 2004, at 18:37 +0100, Espen Jervidalo wrote according to [Re: Please test: mplayer 1.0pre3]: > hi,=20 >=20 > the port doen't compile correctly on my 5.2 box. it stops after applying = some patches with: >=20 > =3D=3D=3D> Extracting for mplayer-gtk-esound-0.99.3 > >> Checksum OK for MPlayer-1.0pre3.tar.bz2. > =3D=3D=3D> Patching for mplayer-gtk-esound-0.99.3 > =3D=3D=3D> Applying FreeBSD patches for mplayer-gtk-esound-0.99.3 > 1 out of 1 hunks failed--saving rejects to cfg-common.h.rej > >> Patch patch-cfg-common.h failed to apply cleanly. There is no patch-cfg-common.h anymore. You might have forgotten to delete the files dir before extracting the test port. Regards, Riggs --=20 - "[...] I talked to the computer at great length and -- explained my view of the Universe to it" said Marvin. --- And what happened?" pressed Ford. ---- "It committed suicide." said Marvin. --0F1p//8PRICkK4MW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFAFhSJjdSJKchZls0RAkymAJ4gLQJnkugxjY6+8fb5VQakRg45vwCfW5lt v6NiYykXOZ3vN36Edv11BTU= =pbSf -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-freebsd-multimedia@FreeBSD.ORG Mon Jan 26 23:59:07 2004 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 041D516A4CE; Mon, 26 Jan 2004 23:59:07 -0800 (PST) Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8186443D64; Mon, 26 Jan 2004 23:58:47 -0800 (PST) (envelope-from riggs@o503.hadiko.de) Received: from o503.hadiko.de (hadio503.hadiko.uni-karlsruhe.de [172.20.45.138]) by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.36 #1) id 1AlO7S-0001l4-00; Tue, 27 Jan 2004 08:58:46 +0100 Received: from o503.hadiko.de (RIXT@localhost [127.0.0.1]) by o503.hadiko.de (8.12.10/8.12.10) with ESMTP id i0R7wj8v010658; Tue, 27 Jan 2004 08:58:46 +0100 (CET) (envelope-from riggs@o503.hadiko.de) Received: (from riggs@localhost) by o503.hadiko.de (8.12.10/8.12.10/Submit) id i0R7wjUl010657; Tue, 27 Jan 2004 08:58:45 +0100 (CET) (envelope-from riggs) Date: Tue, 27 Jan 2004 08:58:45 +0100 From: "Thomas E. Zander" To: multimedia@freebsd.org Message-ID: <20040127075845.GB10363@o503.hadiko.de> References: <20040125000805.GE27786@o503.hadiko.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <20040125000805.GE27786@o503.hadiko.de> Organization: RiggiServ - Ihr Partner =?iso-8859-15?Q?f?= =?iso-8859-15?Q?=FCr?= alles Delikate X-PGP-KeyID: 0xC85996CD X-PGP-URI: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xC85996CD X-PGP-Fingerprint: 4F59 75B4 4CE3 3B00 BC61 5400 8DD4 8929 C859 96CD X-Mailer: Riggisoft Ausguck Eggsbress (Build 1075188912) X-Operating-System: Riggiland BSD 5.2-CURRENT (To serve and protect.) cc: ports@freebsd.org Subject: Thank you all! [was: Please test: mplayer 1.0pre3] 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: Tue, 27 Jan 2004 07:59:07 -0000 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Good morning, well, as the subject already said, I thank you all for feedback. At the moment I've got the impression that an update to 1.0pre3 causes more regression in usability and comfort than keeping 0.92 for a while. Especially o The new libavcodec hasn't been merged in yet, so we'd need further huge aggressive patching to enable playing some critical files (thanks Simon). o The gtk2 patch only works on -current and it's future in further releases is not certain. Also there are some regressions with the gui in general, e.g. the "pause-key". prevent me from feeling good about an update of the ports tree in this case. So I'll do the following: We wait at least for 1.0pre4 before updating the official ports tree with the new version, further I keep on collecting patches and ideas for the new version and keep updating this port on my homepage, so that whoever wants to use 1.0pre instead of 0.92 can do this by just downloading it until it finds its way into the ports tree. I think that's the best solution at the moment. Objections? Regards, Riggs --=20 - "[...] I talked to the computer at great length and -- explained my view of the Universe to it" said Marvin. --- And what happened?" pressed Ford. ---- "It committed suicide." said Marvin. --qlTNgmc+xy1dBmNv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFAFho1jdSJKchZls0RAscMAJwN1LS2CvFL45EazaFlLPZxzWz+/ACeMhjd FpkycW4s7GsSyoDwbH37hm8= =V1NF -----END PGP SIGNATURE----- --qlTNgmc+xy1dBmNv-- From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 00:07:54 2004 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 11F0016A4CE; Tue, 27 Jan 2004 00:07:54 -0800 (PST) Received: from ftp.ccrle.nec.de (ftp.netlab.nec.de [195.37.70.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E8C443D62; Tue, 27 Jan 2004 00:07:27 -0800 (PST) (envelope-from lars.eggert@netlab.nec.de) Received: from netlab.nec.de (tokyo.netlab.nec.de [195.37.70.2]) by ftp.ccrle.nec.de (Postfix) with ESMTP id 13058F5A9; Tue, 27 Jan 2004 09:12:05 +0100 (CET) Message-ID: <40161C38.5050101@netlab.nec.de> Date: Tue, 27 Jan 2004 09:07:20 +0100 From: Lars Eggert Organization: NEC Network Laboratories User-Agent: Mozilla Thunderbird 0.5a (Macintosh/20040126) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Thomas E. Zander" References: <20040125000805.GE27786@o503.hadiko.de> <20040127075845.GB10363@o503.hadiko.de> In-Reply-To: <20040127075845.GB10363@o503.hadiko.de> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms030507050600090809020705" cc: ports@freebsd.org cc: multimedia@freebsd.org Subject: Re: Thank you all! [was: Please test: mplayer 1.0pre3] 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: Tue, 27 Jan 2004 08:07:54 -0000 This is a cryptographically signed message in MIME format. --------------ms030507050600090809020705 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thomas E. Zander wrote: > > At the moment I've got the impression that an update to 1.0pre3 causes > more regression in usability and comfort than keeping 0.92 for a while. > Especially > o The new libavcodec hasn't been merged in yet, so we'd need further > huge aggressive patching to enable playing some critical files > (thanks Simon). > o The gtk2 patch only works on -current and it's future in further > releases is not certain. Also there are some regressions with the > gui in general, e.g. the "pause-key". > prevent me from feeling good about an update of the ports tree in this > case. Don't forget the TV functionality... Lars -- Lars Eggert NEC Network Laboratories --------------ms030507050600090809020705 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJ/zCC Az8wggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQI EwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENv bnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAi BgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVy c29uYWwtZnJlZW1haWxAdGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5 NTlaMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBM dGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzAN BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9Vvy Gna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7dyfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOC dz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCB kTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwudGhh d3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3JsMAsGA1UdDwQEAwIBBjApBgNV HREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgwDQYJKoZIhvcNAQEFBQAD gYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A9BxQIJNwPP2t4WFi w9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYITq726jTlEBpb NU1341YheILcIRk13iSx0x1G/11fZU8wggNaMIICw6ADAgECAgMLU6IwDQYJKoZIhvcNAQEE BQAwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0 ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTAz MTIxNTEyMzEyOFoXDTA0MTIxNDEyMzEyOFowgYQxDzANBgNVBAQTBkVnZ2VydDENMAsGA1UE KhMETGFyczEUMBIGA1UEAxMLTGFycyBFZ2dlcnQxKDAmBgkqhkiG9w0BCQEWGWxhcnMuZWdn ZXJ0QG5ldGxhYi5uZWMuZGUxIjAgBgkqhkiG9w0BCQEWE2xhcnMuZWdnZXJ0QGdteC5uZXQw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWps58Zq8Buu2DKDl9crbvzSo6zWsZ TkQLr5zOTqUMs/eU7Mcohv64O4IxWWYGLfYsjDRxUlmdHdJUbyTtUh2lH452DUDJByXidlLm RDgohG0AVwztedqy1+hE3VnCdpMhUGks+6ntrr3dKSxMgLM0AM1kPWsH9lWX6IOPdxOC30gM PiQ65zH9PR70befQLgFPKcAv0wP8210l05n8ekwYAcq2cm3/j+nuDu0HEh5pgsnY7cVELeNJ ODvr4IiE1t3c2w4+0Nc/WJrqGCMl+gZ8c+7FtzjoyDeEsCjNFDeA2ymNd+10O6kjwvPHlzPr 3rW73RDRPAjMJ49HXlueiuoNAgMBAAGjdzB1MCoGBStlAQQBBCEwHwIBADAaMBgCAQQEE0wy dU15ZmZCTlViTkpKY2RaMnMwOQYDVR0RBDIwMIEZbGFycy5lZ2dlcnRAbmV0bGFiLm5lYy5k ZYETbGFycy5lZ2dlcnRAZ214Lm5ldDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBAUAA4GB AHgrv3SQFD4AS4lY4oKcI3iTHcclEHbYfg3UUb8zzCUsl+OJoz0nmebGmOL+tvNj5GvCrWnN H4LvVLh8ZBhFXms7eKJ1YiHgbKwTRK23P8Y5NDit5ico0ZjpFWeenUWj3ajEbN6n4K8dNp+C 0b2apnSrlFVWY6BucZFIYqQ1Lf91MIIDWjCCAsOgAwIBAgIDC1OiMA0GCSqGSIb3DQEBBAUA MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQu MSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTAeFw0wMzEy MTUxMjMxMjhaFw0wNDEyMTQxMjMxMjhaMIGEMQ8wDQYDVQQEEwZFZ2dlcnQxDTALBgNVBCoT BExhcnMxFDASBgNVBAMTC0xhcnMgRWdnZXJ0MSgwJgYJKoZIhvcNAQkBFhlsYXJzLmVnZ2Vy dEBuZXRsYWIubmVjLmRlMSIwIAYJKoZIhvcNAQkBFhNsYXJzLmVnZ2VydEBnbXgubmV0MIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1qbOfGavAbrtgyg5fXK2780qOs1rGU5E C6+czk6lDLP3lOzHKIb+uDuCMVlmBi32LIw0cVJZnR3SVG8k7VIdpR+Odg1AyQcl4nZS5kQ4 KIRtAFcM7XnastfoRN1ZwnaTIVBpLPup7a693SksTICzNADNZD1rB/ZVl+iDj3cTgt9IDD4k Oucx/T0e9G3n0C4BTynAL9MD/NtdJdOZ/HpMGAHKtnJt/4/p7g7tBxIeaYLJ2O3FRC3jSTg7 6+CIhNbd3NsOPtDXP1ia6hgjJfoGfHPuxbc46Mg3hLAozRQ3gNspjXftdDupI8Lzx5cz6961 u90Q0TwIzCePR15bnorqDQIDAQABo3cwdTAqBgUrZQEEAQQhMB8CAQAwGjAYAgEEBBNMMnVN eWZmQk5VYk5KSmNkWjJzMDkGA1UdEQQyMDCBGWxhcnMuZWdnZXJ0QG5ldGxhYi5uZWMuZGWB E2xhcnMuZWdnZXJ0QGdteC5uZXQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQQFAAOBgQB4 K790kBQ+AEuJWOKCnCN4kx3HJRB22H4N1FG/M8wlLJfjiaM9J5nmxpji/rbzY+Rrwq1pzR+C 71S4fGQYRV5rO3iidWIh4GysE0Sttz/GOTQ4reYnKNGY6RVnnp1Fo92oxGzep+CvHTafgtG9 mqZ0q5RVVmOgbnGRSGKkNS3/dTGCAzswggM3AgEBMGkwYjELMAkGA1UEBhMCWkExJTAjBgNV BAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJz b25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAgMLU6IwCQYFKw4DAhoFAKCCAacwGAYJKoZIhvcN AQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDQwMTI3MDgwNzIwWjAjBgkqhkiG 9w0BCQQxFgQUuGOGTtPH5VpO4npQYR87DfgPOjkwUgYJKoZIhvcNAQkPMUUwQzAKBggqhkiG 9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcN AwICASgweAYJKwYBBAGCNxAEMWswaTBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3Rl IENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt YWlsIElzc3VpbmcgQ0ECAwtTojB6BgsqhkiG9w0BCRACCzFroGkwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0 ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAgMLU6IwDQYJKoZIhvcNAQEBBQAEggEA nRBUuhEYmDJHY1OKLBtPcWcDUSXXekOwrezMOY+reCWkUp8M5TLteautaa/Gwv9Ja3b9zTBO nw6Injv4O237MqWBKlhM+bkSyfwQHOpZTLqAOhlU8YA8Jyf7ZKYWHmfDLbi+j3oLKtSr8BZ/ TDLKYSgFfHyx6q1QxUeK3BvVFaKVNAvwrSE6yfAeVmW7QkDWb8WaQobS1ejfzGAYyWs7muPK PhPNGg65nPr5HxHLTAbTNJvYtG44JdNiw/QbICwX2UoxigYXYOQzLh/CKdY7vZ+ST+50LBtm bSkGifitrCALRtxjzEGU3/A8+qULvmwvNfjXGkHYmbcg2RMbq17OigAAAAAAAA== --------------ms030507050600090809020705-- From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 00:55:40 2004 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 4B45416A4CE; Tue, 27 Jan 2004 00:55:40 -0800 (PST) Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A47043D3F; Tue, 27 Jan 2004 00:55:38 -0800 (PST) (envelope-from riggs@o503.hadiko.de) Received: from o503.hadiko.de (hadio503.hadiko.uni-karlsruhe.de [172.20.45.138]) by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.36 #1) id 1AlP0Q-0006TN-00; Tue, 27 Jan 2004 09:55:34 +0100 Received: from o503.hadiko.de (RIXT@localhost [127.0.0.1]) by o503.hadiko.de (8.12.10/8.12.10) with ESMTP id i0R8tX8v011009; Tue, 27 Jan 2004 09:55:34 +0100 (CET) (envelope-from riggs@o503.hadiko.de) Received: (from riggs@localhost) by o503.hadiko.de (8.12.10/8.12.10/Submit) id i0R8tWJR011008; Tue, 27 Jan 2004 09:55:32 +0100 (CET) (envelope-from riggs) Date: Tue, 27 Jan 2004 09:55:32 +0100 From: "Thomas E. Zander" To: Lars Eggert Message-ID: <20040127085532.GA10896@o503.hadiko.de> References: <20040125000805.GE27786@o503.hadiko.de> <20040127075845.GB10363@o503.hadiko.de> <40161C38.5050101@netlab.nec.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <40161C38.5050101@netlab.nec.de> Organization: RiggiServ - Ihr Partner =?iso-8859-15?Q?f?= =?iso-8859-15?Q?=FCr?= alles Delikate X-PGP-KeyID: 0xC85996CD X-PGP-URI: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xC85996CD X-PGP-Fingerprint: 4F59 75B4 4CE3 3B00 BC61 5400 8DD4 8929 C859 96CD X-Mailer: Riggisoft Ausguck Eggsbress (Build 1075193390) X-Operating-System: Riggiland BSD 5.2-CURRENT (To serve and protect.) cc: ports@freebsd.org cc: multimedia@freebsd.org Subject: Re: Thank you all! [was: Please test: mplayer 1.0pre3] 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: Tue, 27 Jan 2004 08:55:40 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 27. Jan 2004, at 9:07 +0100, Lars Eggert wrote according to [Re: Thank you all! [was: Please test: mplayer 1.0pre3]]: > Don't forget the TV functionality... Although there is not a difference from 0.92->1.0pre, I also hope that we get working tv functionality back on the way to 1.0. Thanks, Riggs --=20 - "[...] I talked to the computer at great length and -- explained my view of the Universe to it" said Marvin. --- And what happened?" pressed Ford. ---- "It committed suicide." said Marvin. --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFAFieEjdSJKchZls0RAkw9AJ4nbDRh2BkfkgAVYvfBZElsfbPyQgCfW2SC jCeoo6un/cpNZVw/nBrdQbw= =pnMF -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 03:56:13 2004 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 BCB4F16A4CE for ; Tue, 27 Jan 2004 03:56:13 -0800 (PST) Received: from web40506.mail.yahoo.com (web40506.mail.yahoo.com [66.218.78.123]) by mx1.FreeBSD.org (Postfix) with SMTP id 88BF243D64 for ; Tue, 27 Jan 2004 03:56:12 -0800 (PST) (envelope-from nicknickolaev@yahoo.com) Message-ID: <20040127115611.71854.qmail@web40506.mail.yahoo.com> Received: from [212.91.166.210] by web40506.mail.yahoo.com via HTTP; Tue, 27 Jan 2004 03:56:11 PST Date: Tue, 27 Jan 2004 03:56:11 -0800 (PST) From: Nikolay Nikolaev To: multimedia@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re[2]: Thank you all! [was: Please test: mplayer 1.0pre3] 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: Tue, 27 Jan 2004 11:56:13 -0000 Hello Thomas, TEZ> according to [Re: Thank you all! [was: Please test: mplayer 1.0pre3]]: >> Don't forget the TV functionality... TEZ> Although there is not a difference from 0.92->1.0pre, I also hope that TEZ> we get working tv functionality back on the way to 1.0. The problem is described here, http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2003-December/019496.html the patch does not work in that form but is simple. TV input does not work since this patch : http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/libmpdemux/tvi_bsdbt848.c.diff?r1=1.6&r2=1.7 The comment says that commiter did not test it. Obviously there is some problem with NTSC's 29.97 fps . The METEORSFPS gets u_short as an argument, not float. Maybe the whole fps logic in tvi_bsdbt848.c should be rewritten. Unfortunately I use PAL system and can not test on NTSC. Maybe a look at the v4l stuff can give a clue to the solution ?? -- Best regards, Nickolay mailto:nicknickolaev@yahoo.com __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 05:25:08 2004 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 B7C9B16A4CE for ; Tue, 27 Jan 2004 05:25:08 -0800 (PST) Received: from mail008.syd.optusnet.com.au (mail008.syd.optusnet.com.au [211.29.132.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBE7A43D55 for ; Tue, 27 Jan 2004 05:24:36 -0800 (PST) (envelope-from akm@theinternet.com.au) Received: from theinternet.com.au (c211-30-103-113.carlnfd1.nsw.optusnet.com.au [211.30.103.113]) i0RDOCd21727; Wed, 28 Jan 2004 00:24:13 +1100 Received: from theinternet.com.au (akm@localhost [127.0.0.1]) by theinternet.com.au (8.12.9/8.12.9) with ESMTP id i0RDOCVB083110; Wed, 28 Jan 2004 00:24:12 +1100 (EST) (envelope-from akm@theinternet.com.au) Received: (from akm@localhost) by theinternet.com.au (8.12.9/8.12.9/Submit) id i0RDOBmf083109; Wed, 28 Jan 2004 00:24:11 +1100 (EST) Date: Wed, 28 Jan 2004 00:24:11 +1100 From: Andrew Kenneth Milton To: Nikolay Nikolaev Message-ID: <20040127132411.GD358@zeus.theinternet.com.au> References: <20040127115611.71854.qmail@web40506.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040127115611.71854.qmail@web40506.mail.yahoo.com> User-Agent: Mutt/1.4.1i cc: multimedia@freebsd.org Subject: Re: Thank you all! [was: Please test: mplayer 1.0pre3] 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: Tue, 27 Jan 2004 13:25:08 -0000 +-------[ Nikolay Nikolaev ]---------------------- | | The comment says that commiter did not test it. | Obviously there is | some problem with NTSC's 29.97 fps . The METEORSFPS | gets u_short as an | argument, not float. Maybe the whole fps logic in | tvi_bsdbt848.c should | be rewritten. Unfortunately I use PAL system and can | not test on NTSC. | Maybe a look at the v4l stuff can give a clue to the | solution ?? It needs to be changed to take a u_short. This has been broken even for PAL since at least 0.91, but, I think the change in the version of gcc is exposing it. The V4L stuff won't help you all that much, except to show you how much stuff is missing from the bsdbt848 driver d8) -- Totally Holistic Enterprises Internet| | Andrew Milton The Internet (Aust) Pty Ltd | M:+61 416 022 411 | ACN: 082 081 472 ABN: 83 082 081 472 |akm@theinternet.com.au| Carpe Daemon From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 14:38:17 2004 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 A4CF516A4CF for ; Tue, 27 Jan 2004 14:38:17 -0800 (PST) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEA8443D4C for ; Tue, 27 Jan 2004 14:37:56 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <200401272236430140052g0fe>; Tue, 27 Jan 2004 22:36:43 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA94982; Tue, 27 Jan 2004 14:36:42 -0800 (PST) Date: Tue, 27 Jan 2004 14:36:41 -0800 (PST) From: Julian Elischer To: John Wehle In-Reply-To: <200401260744.i0Q7it320556@jwlab.FEITH.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 Hauppauge PVR-250 / 350 Driver Patch (Jan 25, 2004) 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: Tue, 27 Jan 2004 22:38:17 -0000 On Mon, 26 Jan 2004, John Wehle wrote: > [ This is the Jan 25, 2004 snapshot of my source tree. Included are > changes to support the PVR-250 version 2 cards in addition to more > conservative handling of the cxm interrupt registers. Also included > are an incomplete set of changes to support FreeBSD 5.2 and to > support the FM radio on the PVR-350. ] [...] Thanks for doing all this.. So, how much data is available on the chips used on this card? is there enough info (for example) to support the decoder and enable the s-video out? julian From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 27 23:18:45 2004 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 DCBDA16A4CE for ; Tue, 27 Jan 2004 23:18:45 -0800 (PST) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3A3843D5A for ; Tue, 27 Jan 2004 23:18:44 -0800 (PST) (envelope-from john@feith.com) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.12.10+Sun/8.12.9) with ESMTP id i0S7I6AL018942; Wed, 28 Jan 2004 02:18:06 -0500 (EST) Received: (from john@localhost) by jwlab.FEITH.COM (8.11.7+Sun/8.11.7) id i0S7I6X23322; Wed, 28 Jan 2004 02:18:06 -0500 (EST) Date: Wed, 28 Jan 2004 02:18:06 -0500 (EST) From: John Wehle Message-Id: <200401280718.i0S7I6X23322@jwlab.FEITH.COM> To: julian@elischer.org Content-Type: text X-Scanned-By: MIMEDefang 2.39 X-Archived: cashew.FEITH.COM cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 Hauppauge PVR-250 / 350 Driver Patch (Jan 25, 2004) 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: Wed, 28 Jan 2004 07:18:46 -0000 > So, how much data is available on the chips used on this card? For the MPEG encoder / decoder ... hardly anything. I've been using the information compiled by The IvyTV Project (ivtv.sourceforge.net). Information on the rest of the chips (i.e. audio decoder, video decoder, etc.) seems to be readily available. > is there enough info (for example) to support the decoder and enable > the s-video out? There seems to be. My primary interest is in supporting the encoder. Currently there are other ways of getting s-video out using mplayer and the appropriate video card running X11. I might take a look at the decoder down the road (though my card is a PVR-250 which doesn't have s-video out) if I'm bored. :-) -- John ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | ------------------------------------------------------------------------- From owner-freebsd-multimedia@FreeBSD.ORG Wed Jan 28 06:08:25 2004 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 DE9B916A4CE for ; Wed, 28 Jan 2004 06:08:25 -0800 (PST) Received: from mailoff.mtu.edu (mailoff.mtu.edu [141.219.70.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50ED343D2F for ; Wed, 28 Jan 2004 06:08:24 -0800 (PST) (envelope-from froese@mtu.edu) Received: from node21. (node21.mtu.edu [141.219.68.121]) by mailoff.mtu.edu (8.11.7p1+Sun/8.11.4) with ESMTP id i0SE8MS12657 for ; Wed, 28 Jan 2004 09:08:22 -0500 (EST) Received: from node25 (node25.mtu.edu [141.219.68.125]) by node21. (8.11.6/8.11.6) with ESMTP id i0SE8MR01820 for ; Wed, 28 Jan 2004 09:08:22 -0500 Received: from campus4.mtu.edu ([141.219.70.7]) by node25 (MailMonitor for SMTP v1.2.2 ) ; Wed, 28 Jan 2004 09:08:22 -0500 (EST) Received: from node40. (node40.mtu.edu [141.219.69.40]) by mail.mtu.edu (8.11.7p1+Sun/8.11.6) with ESMTP id i0SE8Mx23858 for ; Wed, 28 Jan 2004 09:08:22 -0500 (EST) Received: from mackenzie.ffr.mtu.edu (mackenzie.ffr.mtu.edu [141.219.149.155]) i0SE8Lb2006829 for ; Wed, 28 Jan 2004 09:08:22 -0500 From: Robert Froese To: multimedia@freebsd.org Date: Wed, 28 Jan 2004 09:08:03 -0500 User-Agent: KMail/1.5.4 Organization: Michigan Tech MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401280908.03998.froese@mtu.edu> Subject: libvorbis.so.3 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: froese@mtu.edu List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 14:08:26 -0000 Dear list, I've recently cvsup'ed my ports tree, and portupgraded everything. Now notifications in KDE don't work. I notice when I quit X this warning is printed: /usr/libexec/ld-elf.so.1: Shared object "libvorbisfile.so.3" not found If I search my system, I do find a file called "libvorbisfile.so.4". I've tried deinstalling and reinstalling the libvorbis port, and even the kdemultimedia port. No luck; I get the same error. Googling doesn't reveal anything obvious. There were a couple of dependency problems when I did a "pkgdb -F" before running portupgrade, but I don't recall any relating to libvorbis. Any advice would be warmly appreciated! ...Robert From owner-freebsd-multimedia@FreeBSD.ORG Wed Jan 28 20:46:02 2004 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 6506A16A4CE for ; Wed, 28 Jan 2004 20:46:02 -0800 (PST) Received: from mail-gw-0.Millions.Ca (h68-145-236-254.sbm.shawcable.net [68.145.236.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79CF843D2F for ; Wed, 28 Jan 2004 20:45:58 -0800 (PST) (envelope-from stacy@Millions.Ca) Received: from cedar.millions.ca (Cedar.Millions.Ca [192.168.64.8]) i0T4jmo8059237; Wed, 28 Jan 2004 21:45:48 -0700 (MST) (envelope-from stacy@Millions.Ca) Received: from millions.ca (Bonsai.Millions.Ca [192.168.64.4]) by cedar.millions.ca (8.12.6/8.12.6) with ESMTP id i0T4jk6O026804; Wed, 28 Jan 2004 21:45:47 -0700 (MST) (envelope-from stacy@millions.ca) Message-ID: <40188FFA.6070207@millions.ca> Date: Wed, 28 Jan 2004 21:45:46 -0700 From: Stacy Millions Organization: Millions Consulting Limited User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040123 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Wehle References: <200401260737.i0Q7bAL20532@jwlab.FEITH.COM> In-Reply-To: <200401260737.i0Q7bAL20532@jwlab.FEITH.COM> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-multimedia@freebsd.org Subject: Re: Hauppauge PVR-[23]50 driver 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: Thu, 29 Jan 2004 04:46:02 -0000 John Wehle wrote: > > This seems similar to the panics that happened when the cxm > driver didn't recognize the tuner or the audio decoder which > caused the attach to fail. Something is up with the cxm module > loading / unloading on your machine. When did you last cvsup > your OS? Exactly what commands (in what order) are you using > to load / unload the cxm modules? Last cvsup was early Nov, shortly after 4.9 was released... guess it is time for a refresh. To load modules kldload cxm_iic kldload cxm to unload kldunload cxm kldunload cxm_iic >>Jan 22 22:00:29 /kernel: cxm0: encoder dma not enough buffer space free > > > mplayer on your machine was unable to keep up with the live > video stream causing the cxm buffers to back up and eventually > overflow. Thanks for the explanation. I have cvsuped stable and rebuilt with your latest drivers (Jan 25), I will let you know if this behaves better (so far so good). -stacy From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 06:57:26 2004 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 30EEB16A4CE for ; Fri, 30 Jan 2004 06:57:26 -0800 (PST) Received: from mailoff.mtu.edu (mailoff.mtu.edu [141.219.70.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id E46B143D53 for ; Fri, 30 Jan 2004 06:57:23 -0800 (PST) (envelope-from froese@mtu.edu) Received: from node21. (node21.mtu.edu [141.219.68.121]) by mailoff.mtu.edu (8.11.7p1+Sun/8.11.4) with ESMTP id i0UEvMS13438; Fri, 30 Jan 2004 09:57:22 -0500 (EST) Received: from node25 (node25.mtu.edu [141.219.68.125]) by node21. (8.11.6/8.11.6) with ESMTP id i0UEvMR15560; Fri, 30 Jan 2004 09:57:22 -0500 Received: from campus4.mtu.edu ([141.219.70.7]) by node25 (MailMonitor for SMTP v1.2.2 ) ; Fri, 30 Jan 2004 09:57:21 -0500 (EST) Received: from node21. (node21.mtu.edu [141.219.68.121]) by mail.mtu.edu (8.11.7p1+Sun/8.11.6) with ESMTP id i0UEvLx28524; Fri, 30 Jan 2004 09:57:21 -0500 (EST) Received: from mackenzie.ffr.mtu.edu (mackenzie.ffr.mtu.edu [141.219.149.155]) i0UEvL5P015554; Fri, 30 Jan 2004 09:57:21 -0500 From: Robert Froese Organization: Michigan Tech To: Ulrich Spoerlein Date: Fri, 30 Jan 2004 09:57:03 -0500 User-Agent: KMail/1.5.4 References: <200401280908.03998.froese@mtu.edu> <20040130103416.GA774@galgenberg.net> In-Reply-To: <20040130103416.GA774@galgenberg.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401300957.03544.froese@mtu.edu> cc: multimedia@freebsd.org Subject: Re: libvorbis.so.3 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: froese@mtu.edu List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 14:57:26 -0000 On Friday 30 January 2004 05:34 am, Ulrich Spoerlein wrote: > To fix your problem, do: portupgrade -ruf libvorbis Nope. After an hour of compiling, it did finish without errors. I restarted X and KDE and I still have no knotifications and the same error message when I exit KDE. ...Robert From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 09:01:06 2004 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 4422016A4CE for ; Fri, 30 Jan 2004 09:01:06 -0800 (PST) Received: from tm.kishalmi.net (cm60-225.liwest.at [212.33.60.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB9ED43D78 for ; Fri, 30 Jan 2004 09:00:44 -0800 (PST) (envelope-from lmg@tm.kishalmi.net) Received: from tm.kishalmi.net (localhost [127.0.0.1]) by tm.kishalmi.net (8.12.10/8.12.10) with ESMTP id i0UHaJfG001906; Fri, 30 Jan 2004 18:36:23 +0100 (CET) (envelope-from lmg@tm.kishalmi.net) Received: (from lmg@localhost) by tm.kishalmi.net (8.12.10/8.12.10/Submit) id i0UHaErd001905; Fri, 30 Jan 2004 18:36:14 +0100 (CET) (envelope-from lmg) Date: Fri, 30 Jan 2004 18:36:14 +0100 (CET) From: "M.G.Kishalmi" Message-Id: <200401301736.i0UHaErd001905@tm.kishalmi.net> To: froese@mtu.edu cc: multimedia@freebsd.org Subject: Re: libvorbis.so.3 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: Fri, 30 Jan 2004 17:01:06 -0000 > /usr/libexec/ld-elf.so.1: Shared object "libvorbisfile.so.3" not found > > If I search my system, I do find a file called "libvorbisfile.so.4". I've > tried deinstalling and reinstalling the libvorbis port, and even the > kdemultimedia port. No luck; I get the same error. Googling doesn't reveal > anything obvious. There were a couple of dependency problems when I did a > "pkgdb -F" before running portupgrade, but I don't recall any relating to > libvorbis. hey robert, i remember a similar issue.. as you can see the libvorbis-port does not create the .so.3 link for you: lmg@tm /home/lmg> cat /usr/ports/audio/libvorbis/pkg-plist | -e 'vorbisfile.*so' lib/libvorbisfile.so lib/libvorbisfile.so.4 a quick'n'dirty fix is to link it yourself: ROOT@tm /usr/local/lib# ln -s libvorbisfile.so.4 libvorbisfile.so.3 lmg@tm /home/lmg> ll /usr/local/lib/ | grep -e 'vorbisfile.*so' libvorbisfile.so@ -> libvorbisfile.so.4 libvorbisfile.so.3@ -> libvorbisfile.so.4 libvorbisfile.so.4* hope this helps! :) peace, lmg -- You too can wear a nose mitten. From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 12:51:14 2004 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 F2BF716A4CE for ; Fri, 30 Jan 2004 12:51:13 -0800 (PST) Received: from mail-gw-0.Millions.Ca (h68-145-236-254.sbm.shawcable.net [68.145.236.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id A05BC43D2D for ; Fri, 30 Jan 2004 12:50:49 -0800 (PST) (envelope-from stacy@Millions.Ca) Received: from cedar.millions.ca (Cedar.Millions.Ca [192.168.64.8]) i0UKomo8063316; Fri, 30 Jan 2004 13:50:48 -0700 (MST) (envelope-from stacy@Millions.Ca) Received: from Millions.Ca (localhost [127.0.0.1]) by cedar.millions.ca (8.12.6/8.12.6) with SMTP id i0UKol6O035281; Fri, 30 Jan 2004 13:50:48 -0700 (MST) (envelope-from stacy@Millions.Ca) Message-Id: <200401302050.i0UKol6O035281@cedar.millions.ca> Date: Fri, 30 Jan 2004 20:50:47 -0000 To: From: "Stacy Millions" X-Mailer: TWIG 2.7.3 In-Reply-To: <200401300957.03544.froese@mtu.edu> cc: multimedia@freebsd.org Subject: Re: libvorbis.so.3 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: stacy@Millions.Ca List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 20:51:14 -0000 Robert Froese said: > On Friday 30 January 2004 05:34 am, Ulrich Spoerlein wrote: > > To fix your problem, do: portupgrade -ruf libvorbis > > Nope. After an hour of compiling, it did finish without errors. I restarted X > and KDE and I still have no knotifications and the same error message when I > exit KDE. Have you tried libchk? (ports/sysutils) -stacy From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 21:21:55 2004 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 B2EF316A4CE for ; Fri, 30 Jan 2004 21:21:55 -0800 (PST) Received: from mail-gw-0.Millions.Ca (h68-145-236-254.sbm.shawcable.net [68.145.236.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E5D143D1F for ; Fri, 30 Jan 2004 21:21:54 -0800 (PST) (envelope-from stacy@Millions.Ca) Received: from cedar.millions.ca (Cedar.Millions.Ca [192.168.64.8]) i0V5Lqo8064172; Fri, 30 Jan 2004 22:21:52 -0700 (MST) (envelope-from stacy@Millions.Ca) Received: from millions.ca (Bonsai.Millions.Ca [192.168.64.4]) by cedar.millions.ca (8.12.6/8.12.6) with ESMTP id i0V5Lf6O036669; Fri, 30 Jan 2004 22:21:51 -0700 (MST) (envelope-from stacy@millions.ca) Message-ID: <401B3B65.50807@millions.ca> Date: Fri, 30 Jan 2004 22:21:41 -0700 From: Stacy Millions Organization: Millions Consulting Limited User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040123 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lars Eggert , freebsd-multimedia@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: freevo port 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: Sat, 31 Jan 2004 05:21:55 -0000 I took a shot at the freevo port to see if I could get it to work my pvr350. This is on STABLE. I had two issues building the port: 1) I had to install xmltv by hand, x11-toolkits/p5-Tk-TableMatrix doesn't build any more. It is optional for xmltv, but a dependancy for the port version. 2) sysutils/stat should be a dependancy, freevo won't run without it. The TV/VCR features don't work with new PVR[23]50 driver. The problem is some unsupported ioctl's that mplayer/mencoder -tv use. I'm not sure that you would want to use mencoder any way since the pvr[23]50 gives you an mpeg2 stream native... the web interface does not work either. This is an abridged version of what I get on the browser: web.Server Traceback (most recent call last): exceptions.AttributeError: 'module' object has no attribute 'statvfs' I don't know how many of freevo's features are actually supposed to work, the web interface is documented (in the config file) as being experimental. So far, freevo will play existing media files and play from the dvd-rom. I can browse the TV listings and schedule recordings and I hope with a bit of creative hacking to actually get it to record from my pvr350. -stacy From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 22:33:02 2004 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 24C6B16A4CE for ; Fri, 30 Jan 2004 22:33:02 -0800 (PST) Received: from dfmm.org (walter.dfmm.org [209.151.233.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id E15A243D1F for ; Fri, 30 Jan 2004 22:33:00 -0800 (PST) (envelope-from rclancey-freebsd-multimedia@dfmm.org) Received: (qmail 37168 invoked from network); 31 Jan 2004 06:33:00 -0000 Received: from unknown (HELO ?10.1.1.32?) (209.151.251.21) by 0 with AES256-SHA encrypted SMTP; 31 Jan 2004 06:33:00 -0000 From: Ryan Clancey To: John Wehle In-Reply-To: <200401260744.i0Q7it320556@jwlab.FEITH.COM> References: <200401260744.i0Q7it320556@jwlab.FEITH.COM> Content-Type: text/plain Message-Id: <1075531057.666.43.camel@fattire> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 30 Jan 2004 22:37:37 -0800 Content-Transfer-Encoding: 7bit cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 Hauppauge PVR-250 / 350 Driver Patch (Jan 25, 2004) 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: Sat, 31 Jan 2004 06:33:02 -0000 oh man, i am so happy! this worked perfectly the first time with no issues! you rock. now if only i could figure out how to change the channel... i was hoping that something like: mplayer -tv driver=bsdbt848:channel=28:device=/dev/bktr0 /dev/bktr0 would do the trick, but no such luck. still showed channel 4. i also had no luck with the ioctl's, but i can blame that on not really understanding how such things work. me feeble attempt with perl's ioctl complained about "Inappropriate ioctl for device" when i tried: #!/usr/bin/perl require "sys/ioctl.ph"; require "machine/ioctl_bt848.ph"; open(DEV, "/dev/bktr0"); ioctl(DEV, TVTUNER_SETCHNL, $ARGV[0]) or warn $!; close(DEV); have any tips? do i have the right idea and maybe just need to rebuild the perl header files? once again, thankyouthankyouthankyou for all the work you put into this. -ryan On Sun, 2004-01-25 at 23:44, John Wehle wrote: > A subset of the bt848 and meteor ioctls are supported. > The more interesting ones being: > > TVTUNER_SETCHNL - Set the channel (default to 4). > > BT848_SCAPAREA - Set the capture area / format (defaults to DVD). > > VCD: 352 x 240 or 352 x 288 > SVCD: 480 x 480 or 480 x 576 > DVD: 720 x 480 or 720 x 576 > > METEORCAPTUR - Start / stop the capture. > > Capture is also started if a read > occurs when the data buffer is empty. > > To capture a MPEG program stream from the current channel > simply cat /dev/bktr0 > filename.mpeg. Though to ensure > a clean capture you probably want to do something like: > > 1) Read data until the TV show has ended. > > 2) Use METEORCAPTUR to end the capture. > > 3) Use poll to determine if there is any data > remaining in the device. Read the data as > long as poll says there's data in the buffer. > > otherwise the end of the mpeg program stream will probably be > corrupt. > > Enjoy, > > John Wehle > ------------------------------------------------------------------------- > | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | > | John Wehle | Fax: 1-215-540-5495 | | > ------------------------------------------------------------------------- > From owner-freebsd-multimedia@FreeBSD.ORG Fri Jan 30 22:52:14 2004 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 3F72816A4E4 for ; Fri, 30 Jan 2004 22:52:14 -0800 (PST) Received: from mail022.syd.optusnet.com.au (mail022.syd.optusnet.com.au [211.29.132.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9204E43D3F for ; Fri, 30 Jan 2004 22:52:11 -0800 (PST) (envelope-from akm@theinternet.com.au) Received: from theinternet.com.au (c211-30-103-113.carlnfd1.nsw.optusnet.com.au [211.30.103.113]) i0V6pkR22861; Sat, 31 Jan 2004 17:51:47 +1100 Received: from theinternet.com.au (akm@localhost [127.0.0.1]) by theinternet.com.au (8.12.9/8.12.9) with ESMTP id i0V6pkVB038626; Sat, 31 Jan 2004 17:51:46 +1100 (EST) (envelope-from akm@theinternet.com.au) Received: (from akm@localhost) by theinternet.com.au (8.12.9/8.12.9/Submit) id i0V6pjAe038625; Sat, 31 Jan 2004 17:51:45 +1100 (EST) Date: Sat, 31 Jan 2004 17:51:45 +1100 From: Andrew Kenneth Milton To: Ryan Clancey Message-ID: <20040131065145.GD97628@zeus.theinternet.com.au> References: <200401260744.i0Q7it320556@jwlab.FEITH.COM> <1075531057.666.43.camel@fattire> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1075531057.666.43.camel@fattire> User-Agent: Mutt/1.4.1i cc: John Wehle cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 Hauppauge PVR-250 / 350 Driver Patch (Jan 25, 2004) 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: Sat, 31 Jan 2004 06:52:14 -0000 +-------[ Ryan Clancey ]---------------------- | oh man, i am so happy! this worked perfectly the first time with no | issues! you rock. | | now if only i could figure out how to change the channel... | i was hoping that something like: | | mplayer -tv driver=bsdbt848:channel=28:device=/dev/bktr0 /dev/bktr0 you probably just need to use the chanlist setting to specify your country.. e.g. mplayer -tv driver=bsdbt848:chanlist=us-bcast:channel=28:device=/dev/bktr0 /dev/bktr0 | would do the trick, but no such luck. still showed channel 4. i also | had no luck with the ioctl's, but i can blame that on not really | understanding how such things work. me feeble attempt with perl's ioctl | complained about "Inappropriate ioctl for device" when i tried: | | #!/usr/bin/perl | | require "sys/ioctl.ph"; | require "machine/ioctl_bt848.ph"; | open(DEV, "/dev/bktr0"); | ioctl(DEV, TVTUNER_SETCHNL, $ARGV[0]) or warn $!; | close(DEV); You could try opening /dev/tuner0 (that might be a -current only thing I can't remember). -- Totally Holistic Enterprises Internet| | Andrew Milton The Internet (Aust) Pty Ltd | M:+61 416 022 411 | ACN: 082 081 472 ABN: 83 082 081 472 |akm@theinternet.com.au| Carpe Daemon From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 05:46:36 2004 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 9957416A4CF for ; Sat, 31 Jan 2004 05:46:36 -0800 (PST) Received: from mail.valuehost.co.uk (mail.valuehost.co.uk [62.25.99.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 1650643D1F for ; Sat, 31 Jan 2004 05:46:34 -0800 (PST) (envelope-from bjorn@eikeland.info) Received: (qmail 58434 invoked by uid 89); 31 Jan 2004 13:46:24 +0000 Received: from unknown (HELO beer.eikeland.info) (bjorn@eikeland.info@80.202.106.8) by mail.valuehost.co.uk with SMTP; 31 Jan 2004 13:46:24 +0000 Date: Sat, 31 Jan 2004 14:46:37 +0100 To: freebsd-multimedia@freebsd.org From: Bjorn Eikeland Content-Type: text/plain; format=flowed; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera7.23/FreeBSD M2 build 518 Subject: two soundcards - one works 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: Sat, 31 Jan 2004 13:46:36 -0000 I'm fairly new to FreeBSD, and I'm trying to set it up to replace windows, only bits left is sound, video and tv-out. I've got two soundcards, one onboard AC'97 (on a asus A7V8X w/KT400) and a pci soundblaster 128 card. I've been using the pci card sending sound to the living room, (music & movies) and the onboard for everything else. At first sound didnt work at all, but reading the handbook got one card working, and I've looked through the mailing list archives and google - couldnt fint anything on how to get the other working. (I havent tried the options PNPBIOS yet, as I want to keep the generic kernel till I'm done setting evrything up, and besides dmesg show the pci device so its a driver issue isnt it?) Below you can find various outputs form dmesg, kldstat and /dev. If anyone needs more details to help please ask. thanks for you time, Bjorn # kldload snd_driver.ko # kldstat Id Refs Address Size Name 1 32 0xc0400000 5dff74 kernel 2 1 0xc09e0000 51a18 acpi.ko 3 1 0xc4af3000 19000 linux.ko 4 1 0xc659e000 2000 snd_driver.ko 5 1 0xc65a0000 4000 snd_ad1816.ko 6 27 0xc65a4000 19000 snd_pcm.ko 7 1 0xc65c4000 4000 snd_als4000.ko 8 1 0xc65c8000 5000 snd_cmi.ko 9 1 0xc65dd000 5000 snd_cs4281.ko 10 2 0xc65e2000 7000 snd_csa.ko 11 1 0xc65e9000 b000 snd_ds1.ko 12 1 0xc65f4000 6000 snd_emu10k1.ko 13 1 0xc65fa000 6000 snd_es137x.ko 14 2 0xc6600000 5000 snd_ess.ko 15 4 0xc6615000 4000 snd_sbc.ko 16 1 0xc6619000 4000 snd_fm801.ko 17 2 0xc661d000 a000 snd_mss.ko 18 1 0xc662b000 5000 snd_ich.ko 19 1 0xc6630000 7000 snd_maestro.ko 20 1 0xc6637000 8000 snd_maestro3.ko 21 1 0xc663f000 11000 snd_neomagic.ko 22 1 0xc6650000 4000 snd_sb8.ko 23 1 0xc6654000 4000 snd_sb16.ko 24 1 0xc6668000 5000 snd_solo.ko 25 1 0xc666d000 5000 snd_t4dwave.ko 26 1 0xc6672000 4000 snd_via82c686.ko 27 1 0xc6676000 5000 snd_vibes.ko 28 1 0xc6bed000 b000 ntfs.ko # kldunload snd_driver # kldstat Id Refs Address Size Name 1 10 0xc0400000 5dff74 kernel 2 1 0xc09e0000 51a18 acpi.ko 3 1 0xc4af3000 19000 linux.ko 6 1 0xc65a4000 19000 snd_pcm.ko 13 1 0xc65fa000 6000 snd_es137x.ko 28 1 0xc6bed000 b000 ntfs.ko #cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: at io 0xb000 irq 18 (1p/1r/0v channels duplex default) # dmesg |grep pcm pcm0: port 0xb000-0xb03f at device 15.0 on pci0 pcm0: # dmesg | grep audio pci0: at device 15.0 (no driver attached) pci0: at device 17.5 (no driver attached) # ls /dev/ds* /dev/dsp0.0 /dev/dsp0.1 /dev/dspW0.0 /dev/dspW0.1 /dev/dspr0.0 # ls /dev/mix* /dev/mixer0 From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 06:29:20 2004 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 33F5F16A4CE for ; Sat, 31 Jan 2004 06:29:20 -0800 (PST) Received: from mail.valuehost.co.uk (mail.valuehost.co.uk [62.25.99.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 1036243D1F for ; Sat, 31 Jan 2004 06:29:18 -0800 (PST) (envelope-from bjorn@eikeland.info) Received: (qmail 85723 invoked by uid 89); 31 Jan 2004 14:29:08 +0000 Received: from unknown (HELO beer.eikeland.info) (bjorn@eikeland.info@80.202.106.8) by mail.valuehost.co.uk with SMTP; 31 Jan 2004 14:29:08 +0000 To: cpghost@cordula.ws, "freebsd-multimedia@freebsd.org" References: <20040131140833.69B9540823@fw.farid-hajji.net> Message-ID: From: Bjorn Eikeland Content-Type: text/plain; format=flowed; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Sat, 31 Jan 2004 15:29:22 +0100 In-Reply-To: <20040131140833.69B9540823@fw.farid-hajji.net> User-Agent: Opera7.23/FreeBSD M2 build 518 Subject: Re: Transferring the root filesystem to a ramdisk? 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: Sat, 31 Jan 2004 14:29:20 -0000 I'm probably in over my head here, but; chroot should change the root filesystem for you. (look in the manpages for more details) As for powering down the hdd I did find a page for this, but havent had time to play with it yet: http://www.cran.org.uk/bruce/software.php best of luck! > Hello, > > in an attempt to save power on FreeBSD servers, I'm > trying to replace the hdd with a ramdisk. The idea is to: > > 1. boot from the hdd (or netboot from an NFS server) > 2. configure a ram disk (md(4)) > 3. copy everything that's needed to ram disk > 4. transfer kernel root to ramdisk (*) > 5. turn off the hdd (**) > > (*) is the hairy question. > (**) How can that be done? > > I won't need paging, because there'll be enough ram for > everything (ramdisk, kernel and userland). > > Now the questions are: > > * How to "attach" the root filesystem to the ram disk? > > Can this be done only through pxe/netboot before the > kernel starts, or is there some kind of system call > that can transfer root on a running system? > > * How to power off (and on) the hdd (both for ATA and SCSI)? > > * Will the power consumption decrease (no hdd) or will > it increase (more ram)? Anybody measured this before > with regular diskless machines? > > Thanks, > -cpghost. > From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 08:47:47 2004 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 0E53616A4CE for ; Sat, 31 Jan 2004 08:47:47 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F42543D41 for ; Sat, 31 Jan 2004 08:47:43 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004013116474201500ovkr2e>; Sat, 31 Jan 2004 16:47:43 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id IAA43727; Sat, 31 Jan 2004 08:47:40 -0800 (PST) Date: Sat, 31 Jan 2004 08:47:38 -0800 (PST) From: Julian Elischer To: Bjorn Eikeland In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "freebsd-multimedia@freebsd.org" cc: cpghost@cordula.ws Subject: Re: Transferring the root filesystem to a ramdisk? 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: Sat, 31 Jan 2004 16:47:47 -0000 On Sat, 31 Jan 2004, Bjorn Eikeland wrote: > I'm probably in over my head here, but; > chroot should change the root filesystem for you. > (look in the manpages for more details) > > As for powering down the hdd I did find a page for this, > but havent had time to play with it yet: > http://www.cran.org.uk/bruce/software.php there is a port "ataidle" that sets teh IDE drive's internal idle timeout timer so it will spin down if you dont use it.. as for scsi, you can sent it a spin-down command with camcontrol but I forget the actual command.. (it should be in the scsi .h files) julian > > best of luck! > > > Hello, > > > > in an attempt to save power on FreeBSD servers, I'm > > trying to replace the hdd with a ramdisk. The idea is to: > > > > 1. boot from the hdd (or netboot from an NFS server) > > 2. configure a ram disk (md(4)) > > 3. copy everything that's needed to ram disk > > 4. transfer kernel root to ramdisk (*) > > 5. turn off the hdd (**) > > > > (*) is the hairy question. > > (**) How can that be done? > > > > I won't need paging, because there'll be enough ram for > > everything (ramdisk, kernel and userland). > > > > Now the questions are: > > > > * How to "attach" the root filesystem to the ram disk? > > > > Can this be done only through pxe/netboot before the > > kernel starts, or is there some kind of system call > > that can transfer root on a running system? > > > > * How to power off (and on) the hdd (both for ATA and SCSI)? > > > > * Will the power consumption decrease (no hdd) or will > > it increase (more ram)? Anybody measured this before > > with regular diskless machines? > > > > Thanks, > > -cpghost. > > > > > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to "freebsd-multimedia-unsubscribe@freebsd.org" > From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 10:54:43 2004 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 5B9EF16A4CE; Sat, 31 Jan 2004 10:54:43 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ED3D43D39; Sat, 31 Jan 2004 10:54:41 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id F120040824; Sat, 31 Jan 2004 19:54:02 +0100 (CET) From: Cordula's Web To: bjorn@eikeland.info In-reply-to: (message from Bjorn Eikeland on Sat, 31 Jan 2004 15:29:22 +0100) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: <20040131140833.69B9540823@fw.farid-hajji.net> Message-Id: <20040131185402.F120040824@fw.farid-hajji.net> Date: Sat, 31 Jan 2004 19:54:02 +0100 (CET) cc: freebsd-multimedia@freebsd.org cc: freebsd-questions@freebsd.org Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 18:54:43 -0000 > > in an attempt to save power on FreeBSD servers, I'm > > trying to replace the hdd with a ramdisk. The idea is to: > > > > 1. boot from the hdd (or netboot from an NFS server) > > 2. configure a ram disk (md(4)) > > 3. copy everything that's needed to ram disk > > 4. transfer kernel root to ramdisk (*) > > 5. turn off the hdd (**) > > > > (*) is the hairy question. > > (**) How can that be done? > > I'm probably in over my head here, but; > chroot should change the root filesystem for you. > (look in the manpages for more details) Nope, chroot(2) affects only the calling process, not the whole system. > As for powering down the hdd I did find a page for this, > but havent had time to play with it yet: > http://www.cran.org.uk/bruce/software.php ATAidle is great. Just tried it successfully on a 5.2-RELEASE with two drives. powering down the inactive drive (not the one with swap and root-fs) is possible this way. Thanks, -cpghost. -- Cordula's Web. http://www.cordula.ws/ From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 11:01:15 2004 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 95BC216A4CE for ; Sat, 31 Jan 2004 11:01:15 -0800 (PST) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B19F243D45 for ; Sat, 31 Jan 2004 11:01:11 -0800 (PST) (envelope-from john@feith.com) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.12.10+Sun/8.12.9) with ESMTP id i0VJ16AL021564; Sat, 31 Jan 2004 14:01:06 -0500 (EST) Received: (from john@localhost) by jwlab.FEITH.COM (8.11.7+Sun/8.11.7) id i0VJ15028053; Sat, 31 Jan 2004 14:01:05 -0500 (EST) Date: Sat, 31 Jan 2004 14:01:05 -0500 (EST) From: John Wehle Message-Id: <200401311901.i0VJ15028053@jwlab.FEITH.COM> To: multimedia@freebsd.org Content-Type: text X-Scanned-By: MIMEDefang 2.39 X-Archived: cashew.FEITH.COM cc: emoe@cox.net Subject: FreeBSD 4.9 / 5.2 Hauppauge PVR-250 / 350 Driver Patch (Jan 31, 2004) 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: Sat, 31 Jan 2004 19:01:15 -0000 [ This is the Jan 31, 2004 snapshot of my source tree. Included are changes to support FreeBSD 5.2 in addition to a fix for the crash which happens when unloading the module on some systems. The FreeBSD 5.2 support was made possible by Erik Moe who did the initial port and supplied access to his machine so I could integrate the changes. ] To use the Hauppauge PVR-250 / 350 on FreeBSD 4.9 / 5.2: 1) Use patch to apply Patch.iicbb so cxm can use the i2c bus and avoid a crash when unloading. 2) Unshar the enclosed archive into /sys. 3) Place a current version of hcwpvrp2.sys from the Hauppauge drivers into /sys/dev/cxm. Extract the the firmware by: # cd /sys/dev/cxm # cc -o cxm_extract_fw cxm_extract_fw.c # ./cxm_extract_fw hcwpvrp2.sys 4) Rebuilt your kernel with: device iicbus device iicbb as part of the configuration. 5) Install the new kernel and reboot. 6) Make and install the cxm driver by: # cd /sys/modules/cxm # make # cp cxm/cxm.ko cxm_iic/cxm_iic.ko /modules # kldload cxm_iic # kldload cxm At which point your console should say something like: cxm0: mem 0xd8000000-0xdbffffff irq 12 at device 10 .0 on pci0 cxm_iic0: on cxm0 iicbb0: on cxm_iic0 cxm0: Philips FI1236 MK2 tuner cxm0: SAA7115 rev 1 video decoder cxm0: MSP3435G-B6 audio decoder cxm0: IR Remote cxm0: encoder firmware version 0x2040011 cxm0: decoder firmware version 0x2020023 7) On FreeBSD 4.9 make the device nodes by: # cd /dev # ./MAKEDEV bktr0 On FreeBSD 5.2 the device node is /dev/cxm0 and magically appears when the cxm modules is loaded. A subset of the bt848 and meteor ioctls are supported. The more interesting ones being: TVTUNER_SETCHNL - Set the channel (default to 4). BT848_SCAPAREA - Set the capture area / format (defaults to DVD). VCD: 352 x 240 or 352 x 288 SVCD: 480 x 480 or 480 x 576 DVD: 720 x 480 or 720 x 576 METEORCAPTUR - Start / stop the capture. Capture is also started if a read occurs when the data buffer is empty. To capture a MPEG program stream from the current channel simply cat /dev/bktr0 > filename.mpeg. Though to ensure a clean capture you probably want to do something like: 1) Read data until the TV show has ended. 2) Use METEORCAPTUR to end the capture. 3) Use poll to determine if there is any data remaining in the device. Read the data as long as poll says there's data in the buffer. otherwise the end of the mpeg program stream will probably be corrupt. Enjoy, John Wehle ------------------8<------------------------8<------------------------ # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # dev/cxm # dev/cxm/Patch.iicbb # dev/cxm/cxm.c # dev/cxm/cxm.h # dev/cxm/cxm_audio.c # dev/cxm/cxm_eeprom.c # dev/cxm/cxm_i2c.c # dev/cxm/cxm_ir.c # dev/cxm/cxm_tuner.c # dev/cxm/cxm_video.c # dev/cxm/cxm_extract_fw.c # modules/cxm # modules/cxm/Makefile # modules/cxm/cxm # modules/cxm/cxm/Makefile # modules/cxm/cxm_iic # modules/cxm/cxm_iic/Makefile # echo c - dev/cxm mkdir -p dev/cxm > /dev/null 2>&1 echo x - dev/cxm/Patch.iicbb sed 's/^X//' >dev/cxm/Patch.iicbb << 'END-of-dev/cxm/Patch.iicbb' X*** dev/iicbus/iicbb.c.ORIGINAL Sat Apr 20 12:38:43 2002 X--- dev/iicbus/iicbb.c Thu Jan 29 01:46:55 2004 X*************** struct iicbb_softc { X*** 71,76 **** X--- 71,77 ---- X static int iicbb_probe(device_t); X static int iicbb_attach(device_t); X static int iicbb_detach(device_t); X+ static void iicbb_child_detached(device_t, device_t); X static int iicbb_print_child(device_t, device_t); X X static int iicbb_callback(device_t, int, caddr_t); X*************** static device_method_t iicbb_methods[] = X*** 87,92 **** X--- 88,94 ---- X DEVMETHOD(device_detach, iicbb_detach), X X /* bus interface */ X+ DEVMETHOD(bus_child_detached, iicbb_child_detached), X DEVMETHOD(bus_print_child, iicbb_print_child), X X /* iicbus interface */ X*************** static int iicbb_attach(device_t dev) X*** 135,149 **** X static int iicbb_detach(device_t dev) X { X struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); X X! if (sc->iicbus) { X! bus_generic_detach(dev); X! device_delete_child(dev, sc->iicbus); X! } X X return (0); X } X X static int X iicbb_print_child(device_t bus, device_t dev) X { X--- 137,170 ---- X static int iicbb_detach(device_t dev) X { X struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); X+ device_t child; X X! /* X! * Detach the children before recursively deleting X! * in case a child has a pointer to a grandchild X! * which is used by the child's detach routine. X! * X! * Remember the child before detaching so we can X! * delete it (bus_generic_detach indirectly zeroes X! * sc->child_dev). X! */ X! child = sc->iicbus; X! bus_generic_detach(dev); X! if (child) X! device_delete_child(dev, child); X X return (0); X } X X+ static void X+ iicbb_child_detached( device_t dev, device_t child ) X+ { X+ struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); X+ X+ if (child == sc->iicbus) X+ sc->iicbus = NULL; X+ } X+ X static int X iicbb_print_child(device_t bus, device_t dev) X { X*************** static int iicbb_read(device_t dev, char X*** 345,349 **** X--- 366,371 ---- X } X X DRIVER_MODULE(iicbb, bti2c, iicbb_driver, iicbb_devclass, 0, 0); X+ DRIVER_MODULE(iicbb, cxm_iic, iicbb_driver, iicbb_devclass, 0, 0); X DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0); X DRIVER_MODULE(iicbb, viapm, iicbb_driver, iicbb_devclass, 0, 0); END-of-dev/cxm/Patch.iicbb echo x - dev/cxm/cxm.c sed 's/^X//' >dev/cxm/cxm.c << 'END-of-dev/cxm/cxm.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Conexant MPEG-2 Codec driver. Supports the CX23415 / CX23416 X * chips that are on the Hauppauge PVR-250 and PVR-350 video X * capture cards. Currently only the encoder is supported. X * X * This driver was written using the invaluable information X * compiled by The IvyTV Project (ivtv.sourceforge.net). X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X#include X X#if __FreeBSD_version < 500000 X# include X# include X#else X# include X# include X#endif X X#include X X X/* X * Various supported device vendors/types and their names. X */ Xstatic struct cxm_dev cxm_devs[] = { X { CXM_VENDORID_CONEXANT, CXM_DEVICEID_CONEXANT_iTVC15, X "Conexant iTVC15 MPEG Coder" }, X { CXM_VENDORID_CONEXANT, CXM_DEVICEID_CONEXANT_iTVC16, X "Conexant iTVC16 MPEG Coder" }, X { 0, 0, NULL } X}; X X Xstatic int cxm_probe( device_t dev ); Xstatic int cxm_attach( device_t dev ); Xstatic int cxm_detach( device_t dev ); Xstatic int cxm_shutdown( device_t dev ); Xstatic void cxm_intr( void *arg ); X Xstatic void cxm_child_detached( device_t dev, device_t child ); Xstatic int cxm_read_ivar( device_t bus, device_t dev, X int index, uintptr_t* val); Xstatic int cxm_write_ivar( device_t bus, device_t dev, X int index, uintptr_t val); X X Xstatic device_method_t cxm_methods[] = { X /* Device interface */ X DEVMETHOD(device_probe, cxm_probe), X DEVMETHOD(device_attach, cxm_attach), X DEVMETHOD(device_detach, cxm_detach), X DEVMETHOD(device_shutdown, cxm_shutdown), X X /* bus interface */ X DEVMETHOD(bus_child_detached, cxm_child_detached), X DEVMETHOD(bus_print_child, bus_generic_print_child), X DEVMETHOD(bus_driver_added, bus_generic_driver_added), X DEVMETHOD(bus_read_ivar, cxm_read_ivar), X DEVMETHOD(bus_write_ivar, cxm_write_ivar), X X { 0, 0 } X}; X Xstatic driver_t cxm_driver = { X "cxm", X cxm_methods, X sizeof(struct cxm_softc), X}; X Xstatic devclass_t cxm_devclass; X Xstatic d_open_t cxm_open; Xstatic d_close_t cxm_close; Xstatic d_read_t cxm_read; Xstatic d_ioctl_t cxm_ioctl; Xstatic d_poll_t cxm_poll; X X#if __FreeBSD_version < 500000 X# define CDEV_MAJOR 92 X#else X# define CDEV_MAJOR MAJOR_AUTO X#endif X Xstatic struct cdevsw cxm_cdevsw = { X#if __FreeBSD_version < 500000 X .d_bmaj = -1, X#endif X .d_maj = CDEV_MAJOR, X .d_name = "cxm", X .d_open = cxm_open, X .d_close = cxm_close, X .d_read = cxm_read, X .d_ioctl = cxm_ioctl, X .d_poll = cxm_poll X}; X XMODULE_DEPEND(cxm, cxm_iic, 1, 1, 1); XDRIVER_MODULE(cxm, pci, cxm_driver, cxm_devclass, 0, 0); X X X/* X * Various profiles. X */ Xstatic struct cxm_codec_profile vcd_ntsc_profile = { X "MPEG-1 VideoCD NTSC video and MPEG audio", X CXM_FW_STREAM_TYPE_VCD, X 30, X 352, 240, 480, X 12, X 0, X { 1, 1150000, 0 }, X { 0, 15, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 44.1 Khz, MPEG-1 Layer II, 224 kb/s */ X 0xb8 X}; X Xstatic struct cxm_codec_profile vcd_pal_profile = { X "MPEG-1 VideoCD PAL video and MPEG audio", X CXM_FW_STREAM_TYPE_VCD, X 25, X 352, 288, 576, X 8, X 0, X { 1, 1150000, 0 }, X { 0, 12, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 44.1 Khz, MPEG-1 Layer II, 224 kb/s */ X 0xb8 X}; X Xstatic struct cxm_codec_profile svcd_ntsc_profile = { X "MPEG-2 SuperVCD NTSC video and MPEG audio", X CXM_FW_STREAM_TYPE_MPEG2_PROGRAM, X 30, X 480, 480, 480, X 2, X 0, X /* 2.5 Mb/s peak limit to keep bbdmux followed by mplex -f 4 happy */ X { 0, 1150000, 2500000 }, X { 0, 15, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 44.1 Khz, MPEG-1 Layer II, 224 kb/s */ X 0xb8 X}; X Xstatic struct cxm_codec_profile svcd_pal_profile = { X "MPEG-2 SuperVCD PAL video and MPEG audio", X CXM_FW_STREAM_TYPE_MPEG2_PROGRAM, X 25, X 480, 576, 576, X 2, X 0, X /* 2.5 Mb/s peak limit to keep bbdmux followed by mplex -f 4 happy */ X { 0, 1150000, 2500000 }, X { 0, 12, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 44.1 Khz, MPEG-1 Layer II, 224 kb/s */ X 0xb8 X}; X Xstatic struct cxm_codec_profile dvd_ntsc_profile = { X "MPEG-2 DVD NTSC video and MPEG audio", X CXM_FW_STREAM_TYPE_DVD, X 30, X 720, 480, 480, X 2, X 0, X /* 9.52 Mb/s peak limit to keep bbdmux followed by mplex -f 8 happy */ X { 0, 9000000, 9520000 }, X { 0, 15, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ X 0xe9 X}; X Xstatic struct cxm_codec_profile dvd_pal_profile = { X "MPEG-2 DVD PAL video and MPEG audio", X CXM_FW_STREAM_TYPE_DVD, X 25, X 720, 576, 576, X 2, X 0, X /* 9.52 Mb/s peak limit to keep bbdmux followed by mplex -f 8 happy */ X { 0, 9000000, 9520000 }, X { 0, 12, 3}, X /* X * Spatial filter = Manual, Temporal filter = Manual X * Median filter = Horizontal / Vertical X * Spatial filter value = 1, Temporal filter value = 4 X */ X { 0, 3, 1, 4 }, X /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ X 0xe9 X}; X Xstatic const struct cxm_codec_profile X*codec_profiles[] = { X &vcd_ntsc_profile, X &vcd_pal_profile, X &svcd_ntsc_profile, X &svcd_pal_profile, X &dvd_ntsc_profile, X &dvd_pal_profile X}; X X Xstatic unsigned int Xcxm_queue_firmware_command( struct cxm_softc *sc, X enum cxm_mailbox_name mbx_name, u_int32_t cmd, X u_int32_t *parameters, unsigned int nparameters ) X{ X unsigned int i; X unsigned int mailbox; X u_int32_t completed_command; X u_int32_t flags; X intrmask_t s; X X if (nparameters > CXM_MBX_MAX_PARAMETERS) { X printf("%s: too many parameters for mailbox\n", sc->name); X return -1; X } X X mailbox = 0; X X switch (mbx_name) { X case cxm_dec_mailbox: X mailbox = sc->dec_mbx X + CXM_MBX_FW_CMD_MAILBOX *sizeof(struct cxm_mailbox); X break; X X case cxm_enc_mailbox: X mailbox = sc->enc_mbx X + CXM_MBX_FW_CMD_MAILBOX *sizeof(struct cxm_mailbox); X break; X X default: X return -1; X } X X s = spltty(); X for (i = 0; i < CXM_MBX_FW_CMD_MAILBOXES; i++) { X flags = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, flags)); X if (! (flags & CXM_MBX_FLAG_IN_USE) ) X break; X X /* X * Mail boxes containing certain completed commands X * for which the results are never needed can be reused. X */ X X if ((flags & (CXM_MBX_FLAG_DRV_DONE | CXM_MBX_FLAG_FW_DONE)) X == (CXM_MBX_FLAG_DRV_DONE | CXM_MBX_FLAG_FW_DONE)) { X completed_command X = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, command)); X X /* X * DMA results are always check by reading the X * DMA status register ... never by checking X * the mailbox after the command has completed. X */ X X if (completed_command == CXM_FW_CMD_SCHED_DMA_TO_HOST) X break; X } X X mailbox += sizeof(struct cxm_mailbox); X } X X if (i >= CXM_MBX_FW_CMD_MAILBOXES) { X splx(s); X return -1; X } X X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, flags), X CXM_MBX_FLAG_IN_USE); X splx(s); X X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, command), cmd); X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, timeout), X CXM_FW_STD_TIMEOUT); X X for (i = 0; i < nparameters; i++) X CSR_WRITE_4(sc, X mailbox X + offsetof(struct cxm_mailbox, parameters) X + i * sizeof(u_int32_t), X *(parameters + i)); X X for ( ; i < CXM_MBX_MAX_PARAMETERS; i++) X CSR_WRITE_4(sc, X mailbox X + offsetof(struct cxm_mailbox, parameters) X + i * sizeof(u_int32_t), 0); X X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, flags), X CXM_MBX_FLAG_IN_USE | CXM_MBX_FLAG_DRV_DONE); X X return mailbox; X} X X Xstatic int Xcxm_firmware_command( struct cxm_softc *sc, X enum cxm_mailbox_name mbx_name, u_int32_t cmd, X u_int32_t *parameters, unsigned int nparameters ) X{ X const char *wmesg; X unsigned int *bmp; X unsigned int i; X unsigned int mailbox; X u_int32_t flags; X u_int32_t result; X X bmp = NULL; X wmesg = ""; X X switch (mbx_name) { X case cxm_dec_mailbox: X bmp = &sc->dec_mbx; X wmesg = "cxmdfw"; X break; X X case cxm_enc_mailbox: X bmp = &sc->enc_mbx; X wmesg = "cxmefw"; X break; X X default: X return -1; X } X X mailbox = cxm_queue_firmware_command(sc, mbx_name, cmd, X parameters, nparameters); X if (mailbox == -1) { X printf("%s: no free mailboxes\n", sc->name); X return -1; X } X X /* Give the firmware a chance to start processing the request */ X (void)tsleep(bmp, PWAIT, wmesg, hz / 100); X X for (i = 0; i < 100; i++) { X flags = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, flags)); X if ( (flags & CXM_MBX_FLAG_FW_DONE) ) X break; X X /* Wait for 10ms */ X (void)tsleep(bmp, PWAIT, wmesg, hz / 100); X } X X if (i >= 100) { X printf("%s: timeout\n", sc->name); X return -1; X } X X result = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, result)); X X for (i = 0; i < nparameters; i++) X *(parameters + i) X = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, parameters) X + i * sizeof(u_int32_t)); X X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, flags), 0); X X return result == 0 ? 0 : -1; X} X X Xstatic int Xcxm_firmware_command_nosleep( struct cxm_softc *sc, X enum cxm_mailbox_name mbx_name, u_int32_t cmd, X u_int32_t *parameters, unsigned int nparameters ) X{ X unsigned int i; X unsigned int mailbox; X u_int32_t flags; X u_int32_t result; X X for (i = 0; i < 100; i++) { X mailbox = cxm_queue_firmware_command(sc, mbx_name, cmd, X parameters, nparameters); X if (mailbox != -1) X break; X X /* Wait for 10ms */ X DELAY(10000); X } X X if (i >= 100) { X printf("%s: no free mailboxes\n", sc->name); X return -1; X } X X /* Give the firmware a chance to start processing the request */ X DELAY(10000); X X for (i = 0; i < 100; i++) { X flags = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, flags)); X if ( (flags & CXM_MBX_FLAG_FW_DONE) ) X break; X X /* Wait for 10ms */ X DELAY(10000); X } X X if (i >= 100) { X printf("%s: timeout\n", sc->name); X return -1; X } X X result = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, result)); X X for (i = 0; i < nparameters; i++) X *(parameters + i) X = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, parameters) X + i * sizeof(u_int32_t)); X X CSR_WRITE_4(sc, mailbox + offsetof(struct cxm_mailbox, flags), 0); X X return result == 0 ? 0 : -1; X} X X Xstatic int Xcxm_stop_firmware( struct cxm_softc *sc ) X{ X X if (cxm_firmware_command_nosleep(sc, cxm_enc_mailbox, X CXM_FW_CMD_ENC_HALT_FW, NULL, 0) < 0) X return -1; X X if (sc->type == cxm_iTVC15_type X && cxm_firmware_command_nosleep(sc, cxm_dec_mailbox, X CXM_FW_CMD_DEC_HALT_FW, X NULL, 0) < 0) X return -1; X X /* Wait for 10ms */ X DELAY(10000); X X return 0; X} X X Xstatic void Xcxm_set_irq_mask( struct cxm_softc *sc, u_int32_t mask ) X{ X intrmask_t s; X X s = spltty(); X X CSR_WRITE_4(sc, CXM_REG_IRQ_MASK, mask); X X /* X * PCI writes may be buffered so force the X * write to complete by reading the last X * location written. X */ X X (void)CSR_READ_4(sc, CXM_REG_IRQ_MASK); X X sc->irq_mask = mask; X X splx(s); X} X X Xstatic void Xcxm_set_irq_status( struct cxm_softc *sc, u_int32_t status ) X{ X X CSR_WRITE_4(sc, CXM_REG_IRQ_STATUS, status); X X /* X * PCI writes may be buffered so force the X * write to complete by reading the last X * location written. X */ X X (void)CSR_READ_4(sc, CXM_REG_IRQ_STATUS); X} X X Xstatic int Xcxm_stop_hardware( struct cxm_softc *sc ) X{ X X if (sc->cxm_iic) { X if (cxm_saa7115_mute(sc) < 0) X return -1; X if (cxm_msp_mute(sc) < 0) X return -1; X } X X /* Halt the firmware */ X if (sc->enc_mbx != -1) { X if (cxm_stop_firmware(sc) < 0) X return -1; X } X X /* Mask all interrupts */ X cxm_set_irq_mask(sc, 0xffffffff); X X /* Stop VDM */ X CSR_WRITE_4(sc, CXM_REG_VDM, CXM_CMD_VDM_STOP); X X /* Stop AO */ X CSR_WRITE_4(sc, CXM_REG_AO, CXM_CMD_AO_STOP); X X /* Ping (?) APU */ X CSR_WRITE_4(sc, CXM_REG_APU, CXM_CMD_APU_PING); X X /* Stop VPU */ X CSR_WRITE_4(sc, CXM_REG_VPU, sc->type == cxm_iTVC15_type X ? CXM_CMD_VPU_STOP15 X : CXM_CMD_VPU_STOP16); X X /* Reset Hw Blocks */ X CSR_WRITE_4(sc, CXM_REG_HW_BLOCKS, CXM_CMD_HW_BLOCKS_RST); X X /* Stop SPU */ X CSR_WRITE_4(sc, CXM_REG_SPU, CXM_CMD_SPU_STOP); X X /* Wait for 10ms */ X DELAY(10000); X X return 0; X} X X Xstatic int Xcxm_download_firmware( struct cxm_softc *sc ) X{ X unsigned int i; X const u_int32_t *fw; X X /* Download the encoder firmware */ X fw = (const u_int32_t *)cxm_enc_fw; X for (i = 0; i < CXM_FW_SIZE; i += sizeof(*fw)) X CSR_WRITE_4(sc, CXM_MEM_ENC + i, *fw++); X X /* Download the decoder firmware */ X if (sc->type == cxm_iTVC15_type) { X fw = (const u_int32_t *)cxm_dec_fw; X for (i = 0; i < CXM_FW_SIZE; i += sizeof(*fw)) X CSR_WRITE_4(sc, CXM_MEM_DEC + i, *fw++); X } X X return 0; X} X X Xstatic int Xcxm_init_hardware( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int mailbox; X u_int32_t parameter; X X if (cxm_stop_hardware(sc) < 0) X return -1; X X /* Initialize encoder SDRAM pre-charge */ X CSR_WRITE_4(sc, CXM_REG_ENC_SDRAM_PRECHARGE, X CXM_CMD_SDRAM_PRECHARGE_INIT); X X /* Initialize encoder SDRAM refresh to 1us */ X CSR_WRITE_4(sc, CXM_REG_ENC_SDRAM_REFRESH, X CXM_CMD_SDRAM_REFRESH_INIT); X X /* Initialize decoder SDRAM pre-charge */ X CSR_WRITE_4(sc, CXM_REG_DEC_SDRAM_PRECHARGE, X CXM_CMD_SDRAM_PRECHARGE_INIT); X X /* Initialize decoder SDRAM refresh to 1us */ X CSR_WRITE_4(sc, CXM_REG_DEC_SDRAM_REFRESH, X CXM_CMD_SDRAM_REFRESH_INIT); X X /* Wait for 600ms */ X DELAY(600000); X X if (cxm_download_firmware(sc) < 0) X return -1; X X /* Enable SPU */ X CSR_WRITE_4(sc, CXM_REG_SPU, X CSR_READ_4(sc, CXM_REG_SPU) & CXM_MASK_SPU_ENABLE); X X /* Wait for 1 second */ X DELAY(1000000); X X /* Enable VPU */ X CSR_WRITE_4(sc, CXM_REG_VPU, X CSR_READ_4(sc, CXM_REG_VPU) X & (sc->type == cxm_iTVC15_type X ? CXM_MASK_VPU_ENABLE15 X : CXM_MASK_VPU_ENABLE16)); X X /* Wait for 1 second */ X DELAY(1000000); X X /* Locate encoder mailbox */ X mailbox = CXM_MEM_ENC; X for (i = 0; i < CXM_MEM_ENC_SIZE; i += 0x100) X if (CSR_READ_4(sc, mailbox + i) == 0x12345678 X && CSR_READ_4(sc, mailbox + i + 4) == 0x34567812 X && CSR_READ_4(sc, mailbox + i + 8) == 0x56781234 X && CSR_READ_4(sc, mailbox + i + 12) == 0x78123456) X break; X X if (i >= CXM_MEM_ENC_SIZE) X return -1; X X sc->enc_mbx = mailbox + i + 16; X X /* Locate decoder mailbox */ X if (sc->type == cxm_iTVC15_type) { X mailbox = CXM_MEM_DEC; X for (i = 0; i < CXM_MEM_DEC_SIZE; i += 0x100) X if (CSR_READ_4(sc, mailbox + i) == 0x12345678 X && CSR_READ_4(sc, mailbox + i + 4) == 0x34567812 X && CSR_READ_4(sc, mailbox + i + 8) == 0x56781234 X && CSR_READ_4(sc, mailbox + i + 12) == 0x78123456) X break; X X if (i >= CXM_MEM_DEC_SIZE) X return -1; X X sc->dec_mbx = mailbox + i + 16; X } X X /* Get encoder firmware version */ X parameter = 0; X if (cxm_firmware_command_nosleep(sc, cxm_enc_mailbox, X CXM_FW_CMD_ENC_GET_FW_VER, X ¶meter, 1) < 0) X return -1; X X printf("%s: encoder firmware version %#x\n", X sc->name, (unsigned int)parameter); X X /* Get decoder firmware version */ X if (sc->type == cxm_iTVC15_type) { X parameter = 0; X if (cxm_firmware_command_nosleep(sc, cxm_dec_mailbox, X CXM_FW_CMD_DEC_GET_FW_VER, X ¶meter, 1) < 0) X return -1; X X printf("%s: decoder firmware version %#x\n", X sc->name, (unsigned int)parameter); X } X X return 0; X} X X Xstatic int Xcxm_configure_encoder( struct cxm_softc *sc ) X{ X int fps; X unsigned int i; X u_int32_t parameters[12]; X const struct cxm_codec_profile *cpp; X X fps = cxm_saa7115_detected_fps(sc); X X if (fps < 0) X return -1; X X if (sc->profile->fps != fps) { X X /* X * Pick a profile with the correct fps using the chosen X * width to decide between the VCD, SVCD, or DVD profiles. X */ X X for (i = 0; i < NUM_ELEMENTS(codec_profiles); i++) X if (codec_profiles[i]->fps == fps X && codec_profiles[i]->width == sc->profile->width) X break; X X if (i >= NUM_ELEMENTS(codec_profiles)) X return -1; X X sc->profile = codec_profiles[i]; X } X X cpp = sc->profile; X X if (cxm_saa7115_configure_scaler(sc, X cpp->width, cpp->source_height) < 0) X return -1; X X /* assign dma block len */ X parameters[0] = 1; /* Transfer block size = 1 */ X parameters[1] = 1; /* Units = 1 (frames) */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_DMA_BLOCKLEN, X parameters, 2) != 0) X return -1; X X X /* assign program index info */ X parameters[0] = 0; /* Picture mask = 0 (don't generate index) */ X parameters[1] = 0; /* Num_req = 0 */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_PGM_INDEX_INFO, X parameters, 2) != 0) X return -1; X X /* assign stream type */ X parameters[0] = cpp->stream_type; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_STREAM_TYPE, X parameters, 1) != 0) X return -1; X X /* assign output port */ X parameters[0] = 0; /* 0 (Memory) */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_OUTPUT_PORT, X parameters, 1) != 0) X return -1; X X /* assign framerate */ X parameters[0] = cpp->fps == 30 ? 0 : 1; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_FRAME_RATE, X parameters, 1) != 0) X return -1; X X /* assign frame size */ X parameters[0] = cpp->height; X parameters[1] = cpp->width; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_FRAME_SIZE, X parameters, 2) != 0) X return -1; X X /* assign aspect ratio */ X parameters[0] = cpp->aspect; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_ASPECT_RATIO, X parameters, 1) != 0) X return -1; X X /* assign bitrates */ X parameters[0] = cpp->bitrate.mode; X parameters[1] = cpp->bitrate.average; X parameters[2] = cpp->bitrate.peak / 400; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_BITRATES, X parameters, 3) != 0) X return -1; X X /* assign gop closure */ X parameters[0] = cpp->gop.closure; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_GOP_CLOSURE, X parameters, 1) != 0) X return -1; X X /* assign gop properties */ X parameters[0] = cpp->gop.frames; X parameters[1] = cpp->gop.bframes; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_GOP_PROPERTIES, X parameters, 2) != 0) X return -1; X X /* assign 3 2 pulldown */ X parameters[0] = cpp->pulldown; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_3_2_PULLDOWN, X parameters, 1) != 0) X return -1; X X /* assign dnr filter mode */ X parameters[0] = cpp->dnr.mode; X parameters[1] = cpp->dnr.type; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_DNR_FILTER_MODE, X parameters, 2) != 0) X return -1; X X /* assign dnr filter props */ X parameters[0] = cpp->dnr.spatial; X parameters[1] = cpp->dnr.temporal; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_DNR_FILTER_PROPERTIES, X parameters, 2) != 0) X return -1; X X /* assign audio properties */ X parameters[0] = cpp->audio; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_AUDIO_PROPERTIES, X parameters, 1) != 0) X return -1; X X /* assign coring levels */ X parameters[0] = 0; /* luma_h */ X parameters[1] = 255; /* luma_l */ X parameters[2] = 0; /* chroma_h */ X parameters[3] = 255; /* chroma_l */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_CORING_LEVELS, X parameters, 4) != 0) X return -1; X X /* assign spatial filter type */ X parameters[0] = 3; /* Luminance filter = 3 (2D H/V Separable) */ X parameters[1] = 1; /* Chrominance filter = 1 (1D Horizontal) */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_SPATIAL_FILTER_TYPE, X parameters, 2) != 0) X return -1; X X /* assign frame drop rate */ X parameters[0] = 0; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_FRAME_DROP_RATE, X parameters, 1) != 0) X return -1; X X /* assign placeholder */ X parameters[0] = 0; /* type = 0 (Extension / UserData) */ X parameters[1] = 0; /* period */ X parameters[2] = 0; /* size_t */ X parameters[3] = 0; /* arg0 */ X parameters[4] = 0; /* arg1 */ X parameters[5] = 0; /* arg2 */ X parameters[6] = 0; /* arg3 */ X parameters[7] = 0; /* arg4 */ X parameters[8] = 0; /* arg5 */ X parameters[9] = 0; /* arg6 */ X parameters[10] = 0; /* arg7 */ X parameters[11] = 0; /* arg8 */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_PLACEHOLDER, X parameters, 12) != 0) X return -1; X X /* assign number of lines in fields 1 and 2 */ X parameters[0] = cpp->source_height / 2; X parameters[1] = cpp->source_height / 2; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ASSIGN_NUM_VSYNC_LINES, X parameters, 2) != 0) X return -1; X X return 0; X} X X Xstatic int Xcxm_start_encoder( struct cxm_softc *sc ) X{ X u_int32_t parameters[4]; X u_int32_t subtype; X u_int32_t type; X X if (sc->encoding) X return 0; X X if (cxm_configure_encoder(sc) < 0) X return -1; X X /* Clear pending encoder interrupts (which are currently masked) */ X cxm_set_irq_status(sc, CXM_IRQ_ENC); X X /* Enable event notification */ X parameters[0] = 0; /* Event = 0 (refresh encoder input) */ X parameters[1] = 1; /* Notification = 1 (enable) */ X parameters[2] = 0x10000000; /* Interrupt bit */ X parameters[3] = -1; /* Mailbox = -1 (no mailbox) */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ENC_EVENT_NOTIFICATION, X parameters, 4) != 0) X return -1; X X if (cxm_saa7115_mute(sc) < 0) X return -1; X if (cxm_msp_mute(sc) < 0) X return -1; X X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_INITIALIZE_VIDEO_INPUT, X NULL, 0) < 0) X return -1; X X if (cxm_saa7115_unmute(sc) < 0) X return -1; X if (cxm_msp_unmute(sc) < 0) X return -1; X X /* Wait for 100ms */ X (void)tsleep(&sc->encoding, PWAIT, "cxmce", hz / 10); X X type = sc->mpeg ? CXM_FW_CAPTURE_STREAM_TYPE_MPEG X : CXM_FW_CAPTURE_STREAM_TYPE_RAW; X subtype = (sc->mpeg ? CXM_FW_CAPTURE_STREAM_PCM_AUDIO : 0) X | (sc->source == cxm_fm_source X ? 0 : CXM_FW_CAPTURE_STREAM_YUV); X X /* Start the encoder */ X parameters[0] = type; X parameters[1] = subtype; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_BEGIN_CAPTURE, parameters, 2) != 0) X return -1; X X sc->enc_pool.offset = 0; X sc->enc_pool.read = 0; X sc->enc_pool.write = 0; X X sc->encoding_eos = 0; X X sc->encoding = 1; X X /* Enable interrupts */ X cxm_set_irq_mask(sc, sc->irq_mask & ~CXM_IRQ_ENC); X X return 0; X} X X Xstatic int Xcxm_stop_encoder( struct cxm_softc *sc ) X{ X u_int32_t parameters[4]; X u_int32_t subtype; X u_int32_t type; X intrmask_t s; X X if (! sc->encoding ) X return 0; X X type = sc->mpeg ? CXM_FW_CAPTURE_STREAM_TYPE_MPEG X : CXM_FW_CAPTURE_STREAM_TYPE_RAW; X subtype = (sc->mpeg ? CXM_FW_CAPTURE_STREAM_PCM_AUDIO : 0) X | (sc->source == cxm_fm_source X ? 0 : CXM_FW_CAPTURE_STREAM_YUV); X X /* Stop the encoder */ X parameters[0] = sc->mpeg ? 0 : 1; /* When = 0 (end of GOP) */ X parameters[1] = type; X parameters[2] = subtype; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_END_CAPTURE, parameters, 3) != 0) X return -1; X X /* Wait for up to 1 second */ X s = spltty(); X if (! sc->encoding_eos ) X (void)tsleep(&sc->encoding_eos, PWAIT, "cxmeos", hz); X splx(s); X X if (sc->mpeg && ! sc->encoding_eos ) X printf("%s: missing encoder EOS\n", sc->name); X X /* Disable event notification */ X parameters[0] = 0; /* Event = 0 (refresh encoder input) */ X parameters[1] = 0; /* Notification = 0 (disable) */ X parameters[2] = 0x10000000; /* Interrupt bit */ X parameters[3] = -1; /* Mailbox = -1 (no mailbox) */ X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_ENC_EVENT_NOTIFICATION, X parameters, 4) != 0) X return -1; X X /* Disable interrupts */ X cxm_set_irq_mask(sc, sc->irq_mask | CXM_IRQ_ENC); X X sc->encoding = 0; X X return 0; X} X X Xstatic int Xcxm_pause_encoder( struct cxm_softc *sc ) X{ X u_int32_t parameter; X X /* Pause the encoder */ X parameter = 0; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_PAUSE_ENCODER, ¶meter, 1) != 0) X return -1; X X return 0; X} X X Xstatic int Xcxm_unpause_encoder( struct cxm_softc *sc ) X{ X u_int32_t parameter; X X /* Unpause the encoder */ X parameter = 1; X if (cxm_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_PAUSE_ENCODER, ¶meter, 1) != 0) X return -1; X X return 0; X} X X Xstatic unsigned int Xcxm_encoder_fixup_byte_order( struct cxm_softc *sc, X unsigned int current, size_t offset) X{ X unsigned int strips; X unsigned int i; X unsigned int j; X unsigned int k; X unsigned int macroblocks_per_line; X unsigned int scratch; X unsigned int words_per_line; X u_int32_t *ptr; X u_int32_t *src; X size_t nbytes; X X switch (sc->enc_pool.bufs[current].byte_order) { X case cxm_device_mpeg_byte_order: X X /* X * Convert each 32 bit word to the proper byte ordering. X */ X X for (nbytes = 0, X ptr = (u_int32_t *)sc->enc_pool.bufs[current].vaddr; X nbytes != sc->enc_pool.bufs[current].size; X nbytes += sizeof(*ptr), ptr++) X *ptr = bswap32(*ptr); X X break; X X case cxm_device_yuv12_byte_order: X X /* X * Convert each macro block to planar using X * a scratch buffer (the buffer prior to the X * current buffer is always free since it marks X * the end of the ring buffer). X */ X X scratch = (current + (CXM_SG_BUFFERS - 1)) % CXM_SG_BUFFERS; X X if (offset) { X current = scratch; X break; X } X X src = (u_int32_t *)sc->enc_pool.bufs[current].vaddr; X words_per_line = sc->profile->width / sizeof(*ptr); X macroblocks_per_line X = sc->profile->width / CXM_MACROBLOCK_WIDTH; X strips = sc->enc_pool.bufs[current].size X / (macroblocks_per_line * CXM_MACROBLOCK_SIZE); X X for (i = 0; i < strips; i++) { X ptr = (u_int32_t *)sc->enc_pool.bufs[scratch].vaddr X + i * macroblocks_per_line * CXM_MACROBLOCK_SIZE X / sizeof(*ptr); X for (j = 0; j < macroblocks_per_line; j++) { X for (k = 0; k < CXM_MACROBLOCK_HEIGHT; k++) { X#if CXM_MACROBLOCK_WIDTH != 16 X# error CXM_MACROBLOCK_WIDTH != 16 X#endif X *(ptr + k * words_per_line) X = *src++; X *(ptr + k * words_per_line + 1) X = *src++; X *(ptr + k * words_per_line + 2) X = *src++; X *(ptr + k * words_per_line + 3) X = *src++; X } X ptr += CXM_MACROBLOCK_WIDTH / sizeof(*ptr); X } X } X X sc->enc_pool.bufs[scratch].size X = sc->enc_pool.bufs[current].size; X X current = scratch; X break; X X default: X break; X } X X sc->enc_pool.bufs[current].byte_order = cxm_host_byte_order; X X return current; X} X X Xstatic void Xcxm_encoder_dma_discard( struct cxm_softc *sc ) X{ X u_int32_t parameters[3]; X X /* Discard the DMA request */ X parameters[0] = 0; X parameters[1] = 0; X parameters[2] = 0; X if (cxm_queue_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_SCHED_DMA_TO_HOST, X parameters, 3) == -1) { X printf("%s: failed to discard encoder dma request\n", X sc->name); X return; X } X X sc->encoding_dma = -1; X} X X Xstatic void Xcxm_encoder_dma_done( struct cxm_softc *sc ) X{ X int buffers_pending; X u_int32_t status; X intrmask_t s; X X if (! sc->encoding_dma) { X printf("%s: encoder dma not already in progress\n", X sc->name); X return; X } X X buffers_pending = sc->encoding_dma; X sc->encoding_dma = 0; X X if (buffers_pending < 0) X return; X X status = CSR_READ_4(sc, CXM_REG_DMA_STATUS) & 0x0000000f; X X if ((status X & (CXM_DMA_ERROR_LIST | CXM_DMA_ERROR_WRITE | CXM_DMA_SUCCESS)) X != CXM_DMA_SUCCESS) { X printf("%s: encoder dma status %#x\n", X sc->name, (unsigned int)status); X return; X } X X /* Update the books (spl is used since mutex is not available) */ X s = spltty(); X sc->enc_pool.write = (sc->enc_pool.write + buffers_pending) X % CXM_SG_BUFFERS; X splx(s); X X /* signal anyone requesting notification */ X if (sc->enc_proc) X psignal (sc->enc_proc, sc->enc_signal); X X /* wakeup anyone waiting for data */ X wakeup(&sc->enc_pool.read); X X /* wakeup anyone polling for data */ X selwakeup(&sc->enc_sel); X} X X Xstatic void Xcxm_encoder_dma_request( struct cxm_softc *sc ) X{ X enum cxm_byte_order byte_order; X int buffers_free; X int buffers_pending; X unsigned int current; X unsigned int i; X unsigned int mailbox; X unsigned int macroblocks_per_line; X unsigned int nrequests; X unsigned int strips; X u_int32_t parameters[CXM_MBX_MAX_PARAMETERS]; X u_int32_t type; X size_t max_sg_segment; X struct { X size_t offset; X size_t size; X } requests[2]; X intrmask_t s; X X if (sc->encoding_dma) { X printf("%s: encoder dma already in progress\n", X sc->name); X cxm_encoder_dma_discard(sc); X return; X } X X mailbox = sc->enc_mbx X + CXM_MBX_FW_DMA_MAILBOX * sizeof(struct cxm_mailbox); X X for (i = 0; i < CXM_MBX_MAX_PARAMETERS; i++) X parameters[i] X = CSR_READ_4(sc, X mailbox X + offsetof(struct cxm_mailbox, parameters) X + i * sizeof(u_int32_t)); X X byte_order = cxm_device_mpeg_byte_order; X max_sg_segment = CXM_SG_SEGMENT; X nrequests = 0; X type = parameters[0]; X X switch (type) { X case 0: /* MPEG */ X requests[nrequests].offset = parameters[1]; X requests[nrequests++].size = parameters[2]; X break; X X case 1: /* YUV */ X byte_order = cxm_device_yuv12_byte_order; X X /* X * Simplify macroblock unpacking by ensuring X * that strips don't span buffers. X */ X X#if CXM_MACROBLOCK_SIZE % 256 X# error CXM_MACROBLOCK_SIZE not a multiple of 256 X#endif X X macroblocks_per_line = sc->profile->width X / CXM_MACROBLOCK_WIDTH; X strips = CXM_SG_SEGMENT X / (macroblocks_per_line * CXM_MACROBLOCK_SIZE); X max_sg_segment = strips X * macroblocks_per_line * CXM_MACROBLOCK_SIZE; X X requests[nrequests].offset = parameters[1]; /* Y */ X requests[nrequests++].size = parameters[2]; X requests[nrequests].offset = parameters[3]; /* UV */ X requests[nrequests++].size = parameters[4]; X break; X X case 2: /* PCM (audio) */ X case 3: /* VBI */ X default: X printf("%s: encoder dma type %#x unsupported\n", X sc->name, (unsigned int)type); X cxm_encoder_dma_discard(sc); X return; X } X X /* X * Determine the number of buffers free at this * instant * X * taking into consideration that the ring buffer wraps. X */ X s = spltty(); X buffers_free = sc->enc_pool.read - sc->enc_pool.write; X if (buffers_free <= 0) X buffers_free += CXM_SG_BUFFERS; X splx(s); X X /* X * Build the scatter / gather list taking in X * consideration that the ring buffer wraps, X * at least one free buffer must always be X * present to mark the end of the ring buffer, X * and each transfer must be a multiple of 256. X */ X X buffers_pending = 0; X current = sc->enc_pool.write; X X for (i = 0; i < nrequests; i++) { X if (! requests[i].size ) { X printf("%s: encoder dma size is zero\n", sc->name); X cxm_encoder_dma_discard(sc); X return; X } X X while (requests[i].size) { X sc->enc_pool.bufs[current].size X = requests[i].size > max_sg_segment X ? max_sg_segment : requests[i].size; X sc->enc_pool.bufs[current].byte_order = byte_order; X X sc->enc_sg.vaddr[buffers_pending].src X = requests[i].offset; X sc->enc_sg.vaddr[buffers_pending].dst X = sc->enc_pool.bufs[current].baddr; X sc->enc_sg.vaddr[buffers_pending].size X = (sc->enc_pool.bufs[current].size + 0x000000ff) X & 0xffffff00; X X requests[i].offset += sc->enc_pool.bufs[current].size; X requests[i].size -= sc->enc_pool.bufs[current].size; X buffers_pending++; X current = (current + 1) % CXM_SG_BUFFERS; X X if (buffers_pending >= buffers_free) { X printf( X "%s: encoder dma not enough buffer space free\n", X sc->name); X cxm_encoder_dma_discard(sc); X return; X } X } X } X X /* Mark the last transfer in the list */ X sc->enc_sg.vaddr[buffers_pending - 1].size |= 0x80000000; X X /* Schedule the DMA */ X parameters[0] = sc->enc_sg.baddr; X parameters[1] = buffers_pending * sizeof(sc->enc_sg.vaddr[0]); X parameters[2] = type; X if (cxm_queue_firmware_command(sc, cxm_enc_mailbox, X CXM_FW_CMD_SCHED_DMA_TO_HOST, X parameters, 3) == -1) { X printf("%s: failed to schedule encoder dma request\n", X sc->name); X return; X } X X /* X * Record the number of pending buffers for the X * benefit of cxm_encoder_dma_done. Doing this X * after queuing the command doesn't introduce X * a race condition since we're already in the X * interrupt handler. X */ X X sc->encoding_dma = buffers_pending; X} X X Xstatic int Xcxm_encoder_wait_for_lock( struct cxm_softc *sc ) X{ X int muted; X int locked; X int result; X X locked = 1; X X /* X * Wait for the tuner to lock. X */ X if (sc->source == cxm_fm_source || sc->source == cxm_tuner_source) { X result = cxm_tuner_wait_for_lock(sc); X if (result <= 0) X return result; X } X X /* X * Wait for the video decoder to lock. X */ X if (sc->source != cxm_fm_source) { X result = cxm_saa7115_wait_for_lock(sc); X if (result < 0) X return result; X else if (result == 0) X locked = 0; X } X X /* X * Wait for the audio decoder to lock. X */ X if (sc->source == cxm_tuner_source) { X muted = cxm_msp_is_muted(sc); X X if (cxm_msp_autodetect_standard(sc) < 0) X return -1; X X result = cxm_msp_wait_for_lock(sc); X if (result < 0) X return result; X else if (result == 0) X locked = 0; X X if (muted == 0 && cxm_msp_unmute(sc) < 0) X return -1; X } X X return locked; X} X X Xstatic void Xcxm_mapmem(void *arg, bus_dma_segment_t *segs, int nseg, int error) X{ X bus_addr_t *busaddrp; X X /* X * Only the first bus space address is needed X * since it's known that the memory is physically X * contiguous due to bus_dmamem_alloc. X */ X X busaddrp = (bus_addr_t *)arg; X *busaddrp = segs->ds_addr; X} X X X/* X * the boot time probe routine. X */ Xstatic int Xcxm_probe( device_t dev ) X{ X struct cxm_dev *t; X X t = cxm_devs; X X while(t->name != NULL) { X if ((pci_get_vendor(dev) == t->vid) && X (pci_get_device(dev) == t->did)) { X device_set_desc(dev, t->name); X return 0; X } X t++; X } X X return ENXIO; X} X X X/* X * the attach routine. X */ Xstatic int Xcxm_attach( device_t dev ) X{ X int error; X int rid; X int unit; X unsigned int i; X u_int32_t command; X struct cxm_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X unit = device_get_unit(dev); X X sc->type = cxm_iTVC15_type; X switch(pci_get_device(dev)) { X case CXM_DEVICEID_CONEXANT_iTVC16: X sc->type = cxm_iTVC16_type; X break; X X default: X break; X } X X /* build the device name */ X snprintf(sc->name, sizeof(sc->name), "cxm%d",unit); X X /* X * Enable bus mastering and memory mapped I/O. X */ X pci_enable_busmaster(dev); X pci_enable_io(dev, SYS_RES_MEMORY); X command = pci_read_config(dev, PCIR_COMMAND, 4); X X if (! (command & PCIM_CMD_MEMEN) ) { X device_printf(dev, "failed to enable memory mappings\n"); X error = ENXIO; X goto fail; X } X X /* X * Map control/status registers. X */ X rid = CXM_RID; X sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, X 0, ~0, 1, RF_ACTIVE); X X if (! sc->mem_res ) { X device_printf(dev, "could not map memory\n"); X error = ENXIO; X goto fail; X } X X sc->btag = rman_get_bustag(sc->mem_res); X sc->bhandle = rman_get_bushandle(sc->mem_res); X X /* X * Attach the I2C bus. X */ X sc->cxm_iic = device_add_child(dev, "cxm_iic", unit); X X if (! sc->cxm_iic ) { X device_printf(dev, "could not add cxm_iic\n"); X error = ENXIO; X goto fail; X } X X error = device_probe_and_attach(sc->cxm_iic); X X if (error) { X device_printf(dev, "could not attach cxm_iic\n"); X goto fail; X } X X /* X * Initialize the tuner. X */ X if (cxm_tuner_init(sc) < 0) { X device_printf(dev, "could not initialize tuner\n"); X error = ENXIO; X goto fail; X } X X /* X * Initialize the SAA7115. X */ X if (cxm_saa7115_init(sc) < 0) { X device_printf(dev, "could not initialize video decoder\n"); X error = ENXIO; X goto fail; X } X X /* X * Initialize the MSP3400. X */ X if (cxm_msp_init(sc) < 0) { X device_printf(dev, "could not initialize audio decoder\n"); X error = ENXIO; X goto fail; X } X X /* X * Initialize the IR Remote. X */ X if (cxm_ir_init(sc) < 0) { X device_printf(dev, "could not initialize IR remote\n"); X error = ENXIO; X goto fail; X } X X sc->dec_mbx = -1; X sc->enc_mbx = -1; X X /* X * Disable the Conexant device. X * X * This is done * after * attaching the I2C bus so X * cxm_stop_hardware can mute the video and audio X * decoders. X */ X cxm_stop_hardware(sc); X X /* X * Allocate our interrupt. X */ X rid = 0; X sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, X 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); X X if (sc->irq_res == NULL) { X device_printf(dev, "could not map interrupt\n"); X error = ENXIO; X goto fail; X } X X error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_TTY, X cxm_intr, sc, &sc->ih_cookie); X if (error) { X device_printf(dev, "could not setup irq\n"); X goto fail; X X } X X /* X * Allocate a DMA tag for the parent bus. X */ X error = bus_dma_tag_create(NULL, 1, 0, X BUS_SPACE_MAXADDR_32BIT, X BUS_SPACE_MAXADDR, NULL, NULL, X BUS_SPACE_MAXSIZE_32BIT, 1, X BUS_SPACE_MAXSIZE_32BIT, 0, X#if __FreeBSD_version >= 501102 X busdma_lock_mutex, &Giant, X#endif X &sc->parent_dmat); X if (error) { X device_printf(dev, "could not create parent bus DMA tag\n"); X goto fail; X } X X /* X * Allocate a DMA tag for the encoder buffers. X */ X error = bus_dma_tag_create(sc->parent_dmat, 256, 0, X BUS_SPACE_MAXADDR_32BIT, X BUS_SPACE_MAXADDR, NULL, NULL, X CXM_SG_SEGMENT, 1, X BUS_SPACE_MAXSIZE_32BIT, 0, X#if __FreeBSD_version >= 501102 X busdma_lock_mutex, &Giant, X#endif X &sc->enc_pool.dmat); X if (error) { X device_printf(dev, X "could not create encoder buffer DMA tag\n"); X goto fail; X } X X for (i = 0; i < CXM_SG_BUFFERS; i++) { X X /* X * Allocate the encoder buffer. X */ X error = bus_dmamem_alloc(sc->enc_pool.dmat, X (void **)&sc->enc_pool.bufs[i].vaddr, X BUS_DMA_NOWAIT, X &sc->enc_pool.bufs[i].dmamap); X if (error) { X device_printf(dev, X "could not allocate encoder buffer\n"); X goto fail; X } X X /* X * Map the encoder buffer. X */ X error = bus_dmamap_load(sc->enc_pool.dmat, X sc->enc_pool.bufs[i].dmamap, X sc->enc_pool.bufs[i].vaddr, X CXM_SG_SEGMENT, X cxm_mapmem, X &sc->enc_pool.bufs[i].baddr, 0); X if (error) { X device_printf(dev, "could not map encoder buffer\n"); X goto fail; X } X } X X /* X * Allocate a DMA tag for the scatter / gather list. X */ X error = bus_dma_tag_create(sc->parent_dmat, 1, 0, X BUS_SPACE_MAXADDR_32BIT, X BUS_SPACE_MAXADDR, NULL, NULL, X CXM_SG_BUFFERS X * sizeof(struct cxm_sg_entry), 1, X BUS_SPACE_MAXSIZE_32BIT, 0, X#if __FreeBSD_version >= 501102 X busdma_lock_mutex, &Giant, X#endif X &sc->enc_sg.dmat); X if (error) { X device_printf(dev, X "could not create scatter / gather DMA tag\n"); X goto fail; X } X X /* X * Allocate the scatter / gather list. X */ X error = bus_dmamem_alloc(sc->enc_sg.dmat, (void **)&sc->enc_sg.vaddr, X BUS_DMA_NOWAIT, &sc->enc_sg.dmamap); X if (error) { X device_printf(dev, X "could not allocate scatter / gather list\n"); X goto fail; X } X X /* X * Map the scatter / gather list. X */ X error = bus_dmamap_load(sc->enc_sg.dmat, sc->enc_sg.dmamap, X sc->enc_sg.vaddr, X CXM_SG_BUFFERS * sizeof(struct cxm_sg_entry), X cxm_mapmem, &sc->enc_sg.baddr, 0); X if (error) { X device_printf(dev, "could not map scatter / gather list\n"); X goto fail; X } X X /* X * Initialize the hardware. X */ X if (cxm_init_hardware(sc) < 0) { X device_printf(dev, "could not initialize hardware\n"); X error = ENXIO; X goto fail; X } X X sc->profile = &dvd_ntsc_profile; X X sc->source = cxm_tuner_source; X X /* make the device entries */ X sc->cxm_dev = make_dev(&cxm_cdevsw, unit, X 0, 0, 0444, "cxm%d", unit); X X return 0; X Xfail: X if (sc->enc_sg.baddr) X bus_dmamap_unload(sc->enc_sg.dmat, sc->enc_sg.dmamap); X if (sc->enc_sg.vaddr) X bus_dmamem_free(sc->enc_sg.dmat, sc->enc_sg.vaddr, X sc->enc_sg.dmamap); X if (sc->enc_sg.dmat) X bus_dma_tag_destroy(sc->enc_sg.dmat); X X for (i = 0; i < CXM_SG_BUFFERS; i++) { X if (sc->enc_pool.bufs[i].baddr) X bus_dmamap_unload(sc->enc_pool.dmat, X sc->enc_pool.bufs[i].dmamap); X if (sc->enc_pool.bufs[i].vaddr) X bus_dmamem_free(sc->enc_pool.dmat, X sc->enc_pool.bufs[i].vaddr, X sc->enc_pool.bufs[i].dmamap); X } X X if (sc->enc_pool.dmat) X bus_dma_tag_destroy(sc->enc_pool.dmat); X X if (sc->parent_dmat) X bus_dma_tag_destroy(sc->parent_dmat); X X /* X * Detach the I2C bus. X * X * This is done * after * deallocating the scatter / gather X * list and buffers so the kernel has a better chance of X * gracefully handling a memory shortage. X * X * Detach the children before recursively deleting X * in case a child has a pointer to a grandchild X * which is used by the child's detach routine. X */ X bus_generic_detach(dev); X if (sc->cxm_iic) X device_delete_child(dev, sc->cxm_iic); X X if (sc->ih_cookie) X bus_teardown_intr(dev, sc->irq_res, sc->ih_cookie); X if (sc->irq_res) X bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); X if (sc->mem_res) X bus_release_resource(dev, SYS_RES_MEMORY, CXM_RID, sc->mem_res); X X return error; X} X X/* X * the detach routine. X */ Xstatic int Xcxm_detach( device_t dev ) X{ X unsigned int i; X struct cxm_softc *sc; X device_t child; X X /* Get the device data */ X sc = device_get_softc(dev); X X /* Disable the Conexant device. */ X cxm_stop_hardware(sc); X X /* Unregister the /dev/cxmN device. */ X destroy_dev(sc->cxm_dev); X X /* X * Deallocate scatter / gather list and buffers. X */ X bus_dmamap_unload(sc->enc_sg.dmat, sc->enc_sg.dmamap); X bus_dmamem_free(sc->enc_sg.dmat, sc->enc_sg.vaddr, sc->enc_sg.dmamap); X X bus_dma_tag_destroy(sc->enc_sg.dmat); X X for (i = 0; i < CXM_SG_BUFFERS; i++) { X bus_dmamap_unload(sc->enc_pool.dmat, X sc->enc_pool.bufs[i].dmamap); X bus_dmamem_free(sc->enc_pool.dmat, sc->enc_pool.bufs[i].vaddr, X sc->enc_pool.bufs[i].dmamap); X } X X bus_dma_tag_destroy(sc->enc_pool.dmat); X X bus_dma_tag_destroy(sc->parent_dmat); X X /* X * Detach the I2C bus. X * X * This is done * after * deallocating the scatter / gather X * list and buffers so the kernel has a better chance of X * gracefully handling a memory shortage. X * X * Detach the children before recursively deleting X * in case a child has a pointer to a grandchild X * which is used by the child's detach routine. X * X * Remember the child before detaching so we can X * delete it (bus_generic_detach indirectly zeroes X * sc->child_dev). X */ X child = sc->cxm_iic; X bus_generic_detach(dev); X if (child) X device_delete_child(dev, child); X X /* Deallocate resources. */ X bus_teardown_intr(dev, sc->irq_res, sc->ih_cookie); X bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); X bus_release_resource(dev, SYS_RES_MEMORY, CXM_RID, sc->mem_res); X X return 0; X} X X/* X * the shutdown routine. X */ Xstatic int Xcxm_shutdown( device_t dev ) X{ X struct cxm_softc *sc = device_get_softc(dev); X X /* Disable the Conexant device. */ X cxm_stop_hardware(sc); X X return 0; X} X X/* X * the interrupt routine. X */ Xstatic void Xcxm_intr( void *arg ) X{ X u_int32_t status; X struct cxm_softc *sc; X X /* Get the device data */ X sc = (struct cxm_softc *)arg; X X status = CSR_READ_4(sc, CXM_REG_IRQ_STATUS); X X status &= ~sc->irq_mask; X X if (! status ) X return; X X /* Process DMA done before handling a new DMA request or EOS */ X if (status & CXM_IRQ_ENC_DMA_DONE) X cxm_encoder_dma_done(sc); X X if (status & CXM_IRQ_ENC_DMA_REQUEST) X cxm_encoder_dma_request(sc); X X if (status & CXM_IRQ_ENC_EOS) { X sc->encoding_eos = 1; X wakeup(&sc->encoding_eos); X } X X cxm_set_irq_status(sc, status); X} X X X/* X * the child detached routine. X */ Xstatic void Xcxm_child_detached( device_t dev, device_t child ) X{ X struct cxm_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X X if (child == sc->cxm_iic) X sc->cxm_iic = NULL; X} X X Xstatic int Xcxm_read_ivar( device_t dev, device_t child, int index, uintptr_t* val) X{ X struct cxm_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X X switch (index) { X case CXM_IVAR_BHANDLE: X *val = sc->bhandle; X break; X X case CXM_IVAR_BTAG: X *val = sc->btag; X break; X X case CXM_IVAR_IICBUS: X *val = (uintptr_t)sc->iicbus; X break; X X default: X return ENOENT; X } X X return 0; X} X X Xstatic int Xcxm_write_ivar( device_t dev, device_t child, int index, uintptr_t val) X{ X struct cxm_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X X switch (index) { X case CXM_IVAR_BHANDLE: X return EINVAL; X X case CXM_IVAR_BTAG: X return EINVAL; X X case CXM_IVAR_IICBUS: X if (sc->iicbus) X return EINVAL; X sc->iicbus = (device_t)val; X break; X X default: X return ENOENT; X } X X return 0; X} X X X/*--------------------------------------------------------- X** X** Conexant iTVC15 / iTVC16 character device driver routines X** X**--------------------------------------------------------- X*/ X X#define UNIT(x) ((x) & 0x0f) X#define FUNCTION(x) (x >> 4) X X/* X * X */ Xint Xcxm_open( dev_t dev, int flags, int fmt, d_thread_t *td ) X{ X int unit; X struct cxm_softc *sc; X X unit = UNIT( minor(dev) ); X X /* Get the device data */ X sc = (struct cxm_softc*)devclass_get_softc(cxm_devclass, unit); X if (sc == NULL) { X /* the device is no longer valid/functioning */ X return ENXIO; X } X X if (sc->is_opened) X return EBUSY; X X sc->is_opened = 1; X sc->mpeg = 1; X X /* Record that the device is now busy */ X device_busy(devclass_get_device(cxm_devclass, unit)); X X return 0; X} X X X/* X * X */ Xint Xcxm_close( dev_t dev, int flags, int fmt, d_thread_t *td ) X{ X int unit; X struct cxm_softc *sc; X X unit = UNIT( minor(dev) ); X X /* Get the device data */ X sc = (struct cxm_softc*)devclass_get_softc(cxm_devclass, unit); X if (sc == NULL) { X /* the device is no longer valid/functioning */ X return ENXIO; X } X X if (cxm_stop_encoder(sc) < 0) X return ENXIO; X X sc->enc_pool.offset = 0; X sc->enc_pool.read = 0; X sc->enc_pool.write = 0; X X sc->enc_proc = NULL; X sc->enc_signal = 0; X X device_unbusy(devclass_get_device(cxm_devclass, unit)); X X sc->is_opened = 0; X X return 0; X} X X X/* X * X */ Xint Xcxm_read( dev_t dev, struct uio *uio, int flag ) X{ X int buffers_available; X int buffers_read; X int error; X int unit; X unsigned int current; X unsigned int i; X size_t nbytes; X size_t offset; X struct cxm_softc *sc; X intrmask_t s; X X unit = UNIT( minor(dev) ); X X /* Get the device data */ X sc = (struct cxm_softc*)devclass_get_softc(cxm_devclass, unit); X if (sc == NULL) { X /* the device is no longer valid/functioning */ X return ENXIO; X } X X /* Only trigger the encoder if the ring buffer is empty */ X if (! sc->encoding && sc->enc_pool.read == sc->enc_pool.write) { X if (cxm_start_encoder(sc) < 0) X return ENXIO; X if (flag & IO_NDELAY) X return EWOULDBLOCK; X } X X buffers_available = 0; X X s = spltty(); X while (sc->enc_pool.read == sc->enc_pool.write) { X error = tsleep(&sc->enc_pool.read, PZERO | PCATCH, "cmxrd", 0); X if (error) { X splx(s); X return error; X } X } X X /* X * Determine the number of buffers available at this * instant * X * taking in consideration that the ring buffer wraps. X */ X buffers_available = sc->enc_pool.write - sc->enc_pool.read; X if (buffers_available < 0) X buffers_available += CXM_SG_BUFFERS; X splx(s); X X offset = sc->enc_pool.offset; X X for (buffers_read = 0, i = sc->enc_pool.read; X buffers_read != buffers_available && uio->uio_resid; X buffers_read++, i = (i + 1) % CXM_SG_BUFFERS) { X X current = cxm_encoder_fixup_byte_order (sc, i, offset); X X nbytes = sc->enc_pool.bufs[current].size - offset; X X /* Don't transfer more than requested */ X if (nbytes > uio->uio_resid) X nbytes = uio->uio_resid; X X error = uiomove(sc->enc_pool.bufs[current].vaddr + offset, X nbytes, uio); X if (error) X return error; X X offset += nbytes; X X /* Handle a partial read of a buffer */ X if (! uio->uio_resid && offset != sc->enc_pool.bufs[i].size) X break; X X offset = 0; X } X X sc->enc_pool.offset = offset; X X /* Update the books (spl is used since mutex is not available) */ X s = spltty(); X sc->enc_pool.read = (sc->enc_pool.read + buffers_read) X % CXM_SG_BUFFERS; X splx(s); X X return 0; X} X X X/* X * X */ Xint Xcxm_ioctl( dev_t dev, unsigned long cmd, caddr_t arg, X int flag, d_thread_t *td ) X{ X int fps; X int result; X int status; X int unit; X unsigned int i; X unsigned int sig; X unsigned long freq; X struct cxm_softc *sc; X enum cxm_source source; X struct bktr_capture_area *cap; X struct bktr_remote *remote; X intrmask_t s; X X unit = UNIT( minor(dev) ); X X /* Get the device data */ X sc = (struct cxm_softc*)devclass_get_softc(cxm_devclass, unit); X if (sc == NULL) { X /* the device is no longer valid/functioning */ X return ENXIO; X } X X switch (cmd) { X case BT848_GAUDIO: X switch (cxm_msp_selected_source(sc)) { X case cxm_tuner_source: X *(int *) arg = AUDIO_TUNER; X break; X X case cxm_line_in_source_composite: X case cxm_line_in_source_svideo: X *(int *) arg = AUDIO_EXTERN; X break; X X case cxm_fm_source: X *(int *) arg = AUDIO_INTERN; X break; X X default: X return ENXIO; X } X X if (cxm_msp_is_muted(sc) == 1) X *(int *) arg |= AUDIO_MUTE; X break; X X case BT848_SAUDIO: X source = cxm_unknown_source; X X switch (*(int *) arg) { X case AUDIO_TUNER: X source = cxm_tuner_source; X break; X X case AUDIO_EXTERN: X source = cxm_line_in_source_composite; X break; X X case AUDIO_INTERN: X source = cxm_fm_source; X break; X X case AUDIO_MUTE: X if (cxm_msp_mute(sc) < 0) X return ENXIO; X return 0; X X case AUDIO_UNMUTE: X if (cxm_msp_unmute(sc) < 0) X return ENXIO; X return 0; X X default: X return EINVAL; X } X X if (sc->encoding) { X X /* X * Switching between audio + video and audio only X * subtypes isn't supported while encoding. X */ X X if (source != sc->source X && (source == cxm_fm_source X || sc->source == cxm_fm_source)) X return EBUSY; X } X X if (cxm_pause_encoder(sc) < 0) X return ENXIO; X X if (cxm_msp_select_source(sc, source) < 0) X return ENXIO; X X if (source == cxm_fm_source) X sc->source = source; X X result = cxm_encoder_wait_for_lock(sc); X if (result < 0) X return ENXIO; X else if (result == 0) X return EINVAL; X X if (cxm_unpause_encoder(sc) < 0) X return ENXIO; X break; X X case METEORCAPTUR: X switch (*(int *) arg) { X case METEOR_CAP_CONTINOUS: X if (cxm_start_encoder(sc) < 0) X return ENXIO; X break; X X case METEOR_CAP_STOP_CONT: X if (cxm_stop_encoder(sc) < 0) X return ENXIO; X break; X X default: X return EINVAL; X } X break; X X case BT848_GCAPAREA: X cap = (struct bktr_capture_area *)arg; X memset (cap, 0, sizeof (*cap)); X cap->x_offset = 0; X cap->y_offset = 0; X cap->x_size = sc->profile->width; X cap->y_size = sc->profile->height; X break; X X case BT848_SCAPAREA: X if (sc->encoding) X return EBUSY; X X cap = (struct bktr_capture_area *)arg; X if (cap->x_offset || cap->y_offset X || (cap->x_size % CXM_MACROBLOCK_WIDTH) X || (cap->y_size % CXM_MACROBLOCK_HEIGHT)) X return EINVAL; X X /* X * Setting the width and height has the side effect of X * chosing between the VCD, SVCD, and DVD profiles. X */ X X for (i = 0; i < NUM_ELEMENTS(codec_profiles); i++) X if (codec_profiles[i]->width == cap->x_size X && codec_profiles[i]->height == cap->y_size) X break; X X if (i >= NUM_ELEMENTS(codec_profiles)) X return EINVAL; X X sc->profile = codec_profiles[i]; X break; X X case BT848GFMT: X switch (cxm_saa7115_detected_format(sc)) { X case cxm_ntsc_60hz_source_format: X *(unsigned long *)arg = BT848_IFORM_F_NTSCM; X break; X X case cxm_pal_50hz_source_format: X *(unsigned long *)arg = BT848_IFORM_F_PALBDGHI; X break; X X case cxm_secam_50hz_source_format: X *(unsigned long *)arg = BT848_IFORM_F_SECAM; X break; X X case cxm_pal_60hz_source_format: X *(unsigned long *)arg = BT848_IFORM_F_PALM; X break; X X case cxm_bw_50hz_source_format: X case cxm_bw_60hz_source_format: X case cxm_ntsc_50hz_source_format: X *(unsigned long *)arg = BT848_IFORM_F_AUTO; X break; X X default: X return ENXIO; X } X break; X X case METEORGFMT: X switch (cxm_saa7115_detected_format(sc)) { X case cxm_ntsc_60hz_source_format: X *(unsigned long *)arg = METEOR_FMT_NTSC; X break; X X case cxm_pal_50hz_source_format: X *(unsigned long *)arg = METEOR_FMT_PAL; X break; X X case cxm_secam_50hz_source_format: X *(unsigned long *)arg = METEOR_FMT_SECAM; X break; X X case cxm_bw_50hz_source_format: X case cxm_bw_60hz_source_format: X case cxm_ntsc_50hz_source_format: X case cxm_pal_60hz_source_format: X *(unsigned long *)arg = METEOR_FMT_AUTOMODE; X break; X X default: X return ENXIO; X } X break; X X case METEORGFPS: X fps = cxm_saa7115_detected_fps(sc); X X if (fps < 0) X return ENXIO; X X *(unsigned short *)arg = fps; X break; X X case METEORGINPUT: X switch (sc->source) { X case cxm_tuner_source: X *(unsigned long *)arg = METEOR_INPUT_DEV1; X break; X X case cxm_line_in_source_composite: X *(unsigned long *)arg = METEOR_INPUT_DEV2; X break; X X case cxm_line_in_source_svideo: X *(unsigned long *)arg = METEOR_INPUT_DEV_SVIDEO; X break; X X default: X return ENXIO; X } X break; X X case METEORSINPUT: X source = cxm_unknown_source; X X switch (*(unsigned long *)arg & 0xf000) { X case METEOR_INPUT_DEV1: X source = cxm_tuner_source; X break; X X case METEOR_INPUT_DEV2: X source = cxm_line_in_source_composite; X break; X X case METEOR_INPUT_DEV_SVIDEO: X source = cxm_line_in_source_svideo; X break; X X default: X return EINVAL; X } X X if (sc->encoding) { X X /* X * Switching between audio + video and audio only X * subtypes isn't supported while encoding. X */ X X if (source != sc->source X && (source == cxm_fm_source X || sc->source == cxm_fm_source)) X return EBUSY; X } X X if (cxm_pause_encoder(sc) < 0) X return ENXIO; X X if (cxm_saa7115_select_source(sc, source) < 0) X return ENXIO; X if (cxm_msp_select_source(sc, source) < 0) X return ENXIO; X X sc->source = source; X X result = cxm_encoder_wait_for_lock(sc); X if (result < 0) X return ENXIO; X else if (result == 0) X return EINVAL; X X if (cxm_unpause_encoder(sc) < 0) X return ENXIO; X break; X X case METEORGSIGNAL: X *(unsigned int *)arg = sc->enc_signal; X break; X X case METEORSSIGNAL: X sig = *(unsigned int *)arg; X X if (! _SIG_VALID(sig) ) X return EINVAL; X X /* X * Historically, applications used METEOR_SIG_MODE_MASK X * to reset signal delivery. X */ X if (sig == METEOR_SIG_MODE_MASK) X sig = 0; X X s = spltty(); X#if __FreeBSD_version < 500000 X sc->enc_proc = sig ? td : NULL; X#else X sc->enc_proc = sig ? td->td_proc : NULL; X#endif X sc->enc_signal = sig; X splx (s); X break; X X case RADIO_GETFREQ: X /* Convert from kHz to MHz * 100 */ X freq = sc->tuner_freq / 10; X X *(unsigned int *)arg = freq; X break; X X case RADIO_SETFREQ: X if (sc->source == cxm_fm_source) X if (cxm_pause_encoder(sc) < 0) X return ENXIO; X X /* Convert from MHz * 100 to kHz */ X freq = *(unsigned int *)arg * 10; X X if (cxm_tuner_select_frequency(sc, cxm_tuner_fm_freq_type, X freq) < 0) X return ENXIO; X X /* X * Explicitly wait for the tuner lock so we X * can indicate if there's a station present. X */ X if (cxm_tuner_wait_for_lock(sc) < 0) X return EINVAL; X X result = cxm_encoder_wait_for_lock(sc); X if (result < 0) X return ENXIO; X else if (result == 0) X return EINVAL; X X if (sc->source == cxm_fm_source) X if (cxm_unpause_encoder(sc) < 0) X return ENXIO; X break; X X case TVTUNER_GETAFC: X *(int *)arg = sc->tuner_afc; X break; X X case TVTUNER_SETAFC: X sc->tuner_afc = (*(int *)arg != 0); X break; X X case TVTUNER_SETCHNL: X if (sc->source == cxm_tuner_source) X if (cxm_pause_encoder(sc) < 0) X return ENXIO; X X if (cxm_tuner_select_channel(sc, *(unsigned int *)arg) < 0) X return ENXIO; X X if (sc->tuner_afc) X if (cxm_tuner_apply_afc(sc) < 0) X return EINVAL; X X /* X * Explicitly wait for the tuner lock so we X * can indicate if there's a station present. X */ X if (cxm_tuner_wait_for_lock(sc) < 0) X return EINVAL; X X result = cxm_encoder_wait_for_lock(sc); X if (result < 0) X return ENXIO; X else if (result == 0) X return EINVAL; X X if (sc->source == cxm_tuner_source) X if (cxm_unpause_encoder(sc) < 0) X return ENXIO; X break; X X case TVTUNER_GETFREQ: X /* Convert from kHz to MHz * 16 */ X freq = (sc->tuner_freq * 16) / 1000; X X *(unsigned int *)arg = freq; X break; X X case TVTUNER_SETFREQ: X if (sc->source == cxm_tuner_source) X if (cxm_pause_encoder(sc) < 0) X return ENXIO; X X /* Convert from MHz * 16 to kHz */ X freq = (*(unsigned int *)arg * 1000) / 16; X X if (cxm_tuner_select_frequency(sc, cxm_tuner_tv_freq_type, X freq) < 0) X return ENXIO; X X /* X * Explicitly wait for the tuner lock so we X * can indicate if there's a station present. X */ X if (cxm_tuner_wait_for_lock(sc) < 0) X return EINVAL; X X result = cxm_encoder_wait_for_lock(sc); X if (result < 0) X return ENXIO; X else if (result == 0) X return EINVAL; X X if (sc->source == cxm_tuner_source) X if (cxm_unpause_encoder(sc) < 0) X return ENXIO; X break; X X case TVTUNER_GETSTATUS: X status = cxm_tuner_status(sc); X if (status < 0) X return ENXIO; X *(unsigned long *)arg = status & 0xff; X break; X X case REMOTE_GETKEY: X remote = (struct bktr_remote *)arg; X if (cxm_ir_key(sc, (char *)remote, sizeof(*remote)) < 0) X return ENXIO; X break; X X default: X return ENOTTY; X } X X return 0; X} X X Xint cxm_poll( dev_t dev, int events, d_thread_t *td) X{ X int revents; X int unit; X struct cxm_softc *sc; X intrmask_t s; X X unit = UNIT( minor(dev) ); X X /* Get the device data */ X sc = (struct cxm_softc*)devclass_get_softc(cxm_devclass, unit); X if (sc == NULL) { X /* the device is no longer valid/functioning */ X return POLLHUP; X } X X revents = 0; X X s = spltty(); X if (events & (POLLIN | POLLRDNORM)) { X if (sc->enc_pool.read == sc->enc_pool.write) X selrecord(td, &sc->enc_sel); X else X revents = events & (POLLIN | POLLRDNORM); X } X splx(s); X X return revents; X} END-of-dev/cxm/cxm.c echo x - dev/cxm/cxm.h sed 's/^X//' >dev/cxm/cxm.h << 'END-of-dev/cxm/cxm.h' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Header file for the Conexant MPEG-2 Codec driver. X */ X X#define bswap32(X) ntohl(X) X X#define NUM_ELEMENTS(array) (sizeof(array) / sizeof(*array)) X X/* X * For simplicity several large buffers allocate during X * driver attachment which normally occurs early on X * (when large areas of memory are available) are used X * to move data to / from the card. It's not unusual X * for the memory allocation to fail due to fragmentation X * if the driver is loaded after the system has been X * running for a while. One solution is to allocate X * several PAGE_SIZE buffers instead, however it doesn't X * seem worth the trouble. X */ Xenum cxm_byte_order { cxm_unknown_byte_order, X cxm_device_mpeg_byte_order, cxm_device_yuv12_byte_order, X cxm_host_byte_order }; X Xstruct cxm_buffer { X char *vaddr; X bus_addr_t baddr; X bus_dmamap_t dmamap; X size_t size; X enum cxm_byte_order byte_order; X}; X X#define CXM_SG_BUFFERS 50 X Xstruct cxm_buffer_pool { X bus_dma_tag_t dmat; X size_t offset; X volatile unsigned int read; X volatile unsigned int write; X struct cxm_buffer bufs[CXM_SG_BUFFERS]; X}; X Xstruct cxm_codec_profile { X const char *name; X u_int32_t stream_type; X u_int32_t fps; X u_int32_t width; X u_int32_t height; X u_int32_t source_height; X u_int32_t aspect; X u_int32_t pulldown; X struct { X u_int32_t mode; X u_int32_t average; X u_int32_t peak; X } bitrate; X struct { X u_int32_t closure; X u_int32_t frames; X u_int32_t bframes; X } gop; X struct { X u_int32_t mode; X u_int32_t type; X u_int32_t spatial; X u_int32_t temporal; X } dnr; X X /* X * Audio format encoding X * X * 7 6 5 4 3 2 1 0 X * X * 0 0 44.1 kHz X * 0 1 48 kHz X * 1 0 32 kHz X * X * 0 1 Layer 1 X * 1 0 Layer 2 X * 1 1 Layer 3 X * X * L1 / L2 X * 0 0 0 0 Free fmt X * 0 0 0 1 32k / 32k X * 0 0 1 0 64k / 48k X * 0 0 1 1 96k / 56k X * 0 1 0 0 128k / 64k X * 0 1 0 1 160k / 80k X * 0 1 1 0 192k / 96k X * 0 1 1 1 224k / 112k X * 1 0 0 0 256k / 128k X * 1 0 0 1 288k / 160k X * 1 0 1 0 320k / 192k X * 1 0 1 1 352k / 224k X * 1 1 0 0 384k / 256k X * 1 1 0 1 416k / 320k X * 1 1 1 0 448k / 384k X */ X X u_int32_t audio; X}; X X#define CXM_VENDORID_CONEXANT 0x4444 X#define CXM_DEVICEID_CONEXANT_iTVC15 0x0803 X#define CXM_DEVICEID_CONEXANT_iTVC16 0x0016 X X#define CXM_VENDORID_HAUPPAUGE 0x0070 X Xstruct cxm_dev { X u_int16_t vid; X u_int16_t did; X char *name; X}; X X#define CXM_MBX_FW_CMD_MAILBOX 0 X#define CXM_MBX_FW_CMD_MAILBOXES 6 X X#define CXM_MBX_FW_DMA_MAILBOX 9 X X#define CXM_MBX_MAX_PARAMETERS 16 X X/* Mailbox flags bit definitions */ X#define CXM_MBX_FLAG_DRV_DONE 0x00000002 X#define CXM_MBX_FLAG_FW_DONE 0x00000004 X#define CXM_MBX_FLAG_IN_USE 0x00000001 X Xstruct cxm_mailbox { X u_int32_t flags; X u_int32_t command; X u_int32_t result; X u_int32_t timeout; X u_int32_t parameters[CXM_MBX_MAX_PARAMETERS]; X} __attribute__ ((packed)); X Xenum cxm_mailbox_name { cxm_unknown_mailbox, X cxm_dec_mailbox, cxm_enc_mailbox }; X X/* X * Scatter / gather is supported with the restriction X * that the size of each piece must be a multiple of X * 256 and less than 64k. X */ X#define CXM_SG_SEGMENT (0xff00 & ~(PAGE_SIZE - 1)) X Xstruct cxm_sg_entry { X u_int32_t src; X u_int32_t dst; X u_int32_t size; X} __attribute__ ((packed)); X Xstruct cxm_sg_list { X bus_dma_tag_t dmat; X struct cxm_sg_entry *vaddr; X bus_addr_t baddr; X bus_dmamap_t dmamap; X X}; X Xenum cxm_source { cxm_unknown_source, cxm_fm_source, cxm_tuner_source, X cxm_line_in_source_composite, cxm_line_in_source_svideo }; X Xenum cxm_source_format { cxm_unknown_source_format, X cxm_bw_50hz_source_format, X cxm_bw_60hz_source_format, X cxm_ntsc_50hz_source_format, X cxm_ntsc_60hz_source_format, X cxm_pal_50hz_source_format, X cxm_pal_60hz_source_format, X cxm_secam_50hz_source_format }; X Xextern const struct cxm_tuner cxm_tuners[]; X Xenum cxm_type { cxm_unknown_type, cxm_iTVC15_type, cxm_iTVC16_type }; X X/* X * Conexant iTVC15 / iTVC16 info structure, one per card installed. X */ Xstruct cxm_softc { X enum cxm_type type; X char name[10]; /* Device name and unit number */ X X struct resource *mem_res; /* Resource descriptor for registers */ X bus_space_tag_t btag; /* Bus space access functions */ X bus_space_handle_t bhandle; /* Bus space access functions */ X X struct resource *irq_res; /* Resource descriptor for interrupt */ X void *ih_cookie; /* Newbus interrupt handler cookie */ X X u_int32_t irq_mask; X X bus_dma_tag_t parent_dmat; X X struct cxm_buffer_pool enc_pool; X struct cxm_sg_list enc_sg; X X struct selinfo enc_sel; X X struct proc *enc_proc; X int enc_signal; X X unsigned int dec_mbx; X unsigned int enc_mbx; X X device_t cxm_iic; X device_t iicbus; X X const struct cxm_tuner *tuner; X const struct cxm_tuner_channels *tuner_channels; X int tuner_afc; X unsigned long tuner_freq; X X char msp_name[10]; X X const struct cxm_codec_profile *profile; X X enum cxm_source source; X X dev_t cxm_dev; /* Device entry for /dev/cxmN */ X X int is_opened; X int mpeg; X X int encoding; X int encoding_dma; X volatile int encoding_eos; X}; X X/* X * Conexant iTVC15 / iTVC16 I2C info structure, one per card installed. X */ Xstruct cxm_iic_softc { X char name[10]; /* Device name and unit number */ X bus_space_tag_t btag; /* Bus space access functions */ X bus_space_handle_t bhandle; /* Bus space access functions */ X X device_t iicbb; X X}; X X/* X * List of IVARS available to the I2C device driver X */ X#define CXM_IVAR_BHANDLE 0 X#define CXM_IVAR_BTAG 1 X#define CXM_IVAR_IICBUS 2 X X/* X * Bus resource id X */ X#define CXM_RID PCIR_MAPS X X/* X * Access macros X */ X#define CSR_WRITE_4(sc, reg, val) \ X bus_space_write_4((sc)->btag, (sc)->bhandle, (reg), (val)) X#define CSR_WRITE_2(sc, reg, val) \ X bus_space_write_2((sc)->btag, (sc)->bhandle, (reg), val)) X#define CSR_WRITE_1(sc, reg, val) \ X bus_space_write_1((sc)->btag, (sc)->bhandle, (reg), val)) X#define CSR_READ_4(sc, reg) \ X bus_space_read_4((sc)->btag, (sc)->bhandle, (reg)) X#define CSR_READ_2(sc, reg) \ X bus_space_read_2((sc)->btag, (sc)->bhandle, (reg)) X#define CSR_READ_1(sc, reg) \ X bus_space_read_1((sc)->btag, (sc)->bhandle, (reg)) X X/* X * Decoder / encoder firmware X */ Xextern const char cxm_dec_fw[]; Xextern const char cxm_enc_fw[]; X X#define CXM_FW_SIZE (256 * 1024) X X/* X * Decoder / encoder memory offsets X */ X#define CXM_MEM_DEC 0x01000000 X#define CXM_MEM_ENC 0x00000000 X X#define CXM_MEM_DEC_SIZE 0x01000000 X#define CXM_MEM_ENC_SIZE 0x01000000 X X/* X * Register offsets X */ X#define CXM_REG_AO 0x2002d00 X#define CXM_REG_APU 0x200a064 X#define CXM_REG_DEC_SDRAM_PRECHARGE 0x20008fc X#define CXM_REG_DEC_SDRAM_REFRESH 0x20008f8 X#define CXM_REG_DMA_STATUS 0x2000004 X#define CXM_REG_ENC_SDRAM_PRECHARGE 0x20007fc X#define CXM_REG_ENC_SDRAM_REFRESH 0x20007f8 X#define CXM_REG_HW_BLOCKS 0x2009054 X#define CXM_REG_I2C_GETSCL 0x2007008 X#define CXM_REG_I2C_GETSDA 0x200700c X#define CXM_REG_I2C_SETSCL 0x2007000 X#define CXM_REG_I2C_SETSDA 0x2007004 X#define CXM_REG_IRQ_MASK 0x2000048 X#define CXM_REG_IRQ_STATUS 0x2000040 X#define CXM_REG_SPU 0x2009050 X#define CXM_REG_VDM 0x2002800 X#define CXM_REG_VPU 0x2009058 X X/* X * Register values X */ X#define CXM_CMD_AO_STOP 0x00000005 X#define CXM_CMD_APU_PING 0x00000000 X#define CXM_CMD_HW_BLOCKS_RST 0xffffffff X#define CXM_CMD_SDRAM_PRECHARGE_INIT 0x0000001a X#define CXM_CMD_SDRAM_REFRESH_INIT 0x80000640 X#define CXM_CMD_SPU_STOP 0x00000001 X#define CXM_CMD_VDM_STOP 0x00000000 X#define CXM_CMD_VPU_STOP15 0xfffffffe X#define CXM_CMD_VPU_STOP16 0xffffffee X X#define CXM_DMA_ERROR_LIST 0x00000008 X#define CXM_DMA_ERROR_READ 0x00000002 X#define CXM_DMA_ERROR_WRITE 0x00000004 X#define CXM_DMA_SUCCESS 0x00000001 X X#define CXM_IRQ_DEC_DMA_DONE (1 << 20) X#define CXM_IRQ_DEC_DMA_REQUEST (1 << 22) X#define CXM_IRQ_DEC_VSYNC (1 << 10) X#define CXM_IRQ_ENC_DMA_DONE (1 << 27) X#define CXM_IRQ_ENC_DMA_REQUEST (1 << 31) X#define CXM_IRQ_ENC_EOS (1 << 30) X#define CXM_IRQ_ENC_EVENT (1 << 28) X X#define CXM_IRQ_ENC (CXM_IRQ_ENC_DMA_REQUEST | CXM_IRQ_ENC_DMA_DONE \ X | CXM_IRQ_ENC_EOS | CXM_IRQ_ENC_EVENT) X X/* X * Register masks X */ X#define CXM_MASK_SPU_ENABLE 0xfffffffe X#define CXM_MASK_VPU_ENABLE15 0xfffffff6 X#define CXM_MASK_VPU_ENABLE16 0xfffffffb X X/* X * Firmware commands X */ X#define CXM_FW_CMD_ASSIGN_3_2_PULLDOWN 0x000000b1 X#define CXM_FW_CMD_ASSIGN_ASPECT_RATIO 0x00000099 X#define CXM_FW_CMD_ASSIGN_AUDIO_PROPERTIES 0x000000bd X#define CXM_FW_CMD_ASSIGN_BITRATES 0x00000095 X#define CXM_FW_CMD_ASSIGN_CORING_LEVELS 0x0000009f X#define CXM_FW_CMD_ASSIGN_DMA_BLOCKLEN 0x000000c9 X#define CXM_FW_CMD_ASSIGN_DNR_FILTER_MODE 0x0000009b X#define CXM_FW_CMD_ASSIGN_DNR_FILTER_PROPERTIES 0x0000009d X#define CXM_FW_CMD_ASSIGN_FRAME_DROP_RATE 0x000000d0 X#define CXM_FW_CMD_ASSIGN_FRAME_RATE 0x0000008f X#define CXM_FW_CMD_ASSIGN_FRAME_SIZE 0x00000091 X#define CXM_FW_CMD_ASSIGN_GOP_CLOSURE 0x000000c5 X#define CXM_FW_CMD_ASSIGN_GOP_PROPERTIES 0x00000097 X#define CXM_FW_CMD_ASSIGN_NUM_VSYNC_LINES 0x000000d6 X#define CXM_FW_CMD_ASSIGN_OUTPUT_PORT 0x000000bb X#define CXM_FW_CMD_ASSIGN_PGM_INDEX_INFO 0x000000c7 X#define CXM_FW_CMD_ASSIGN_PLACEHOLDER 0x000000d8 X#define CXM_FW_CMD_ASSIGN_SPATIAL_FILTER_TYPE 0x000000a1 X#define CXM_FW_CMD_ASSIGN_STREAM_TYPE 0x000000b9 X#define CXM_FW_CMD_ASSIGN_VBI_LINE 0x000000b7 X#define CXM_FW_CMD_ASSIGN_VBI_PROPERTIES 0x000000c8 X#define CXM_FW_CMD_BEGIN_CAPTURE 0x00000081 X#define CXM_FW_CMD_DEC_EVENT_NOTIFICATION 0x00000017 X#define CXM_FW_CMD_DEC_GET_FW_VER 0x00000011 X#define CXM_FW_CMD_DEC_HALT_FW 0x0000000e X#define CXM_FW_CMD_ENC_EVENT_NOTIFICATION 0x000000d5 X#define CXM_FW_CMD_ENC_GET_FW_VER 0x000000c4 X#define CXM_FW_CMD_ENC_HALT_FW 0x000000c3 X#define CXM_FW_CMD_END_CAPTURE 0x00000082 X#define CXM_FW_CMD_INITIALIZE_VIDEO_INPUT 0x000000cd X#define CXM_FW_CMD_PAUSE_ENCODER 0x000000d2 X#define CXM_FW_CMD_SCHED_DMA_TO_HOST 0x000000cc X X#define CXM_FW_STD_TIMEOUT 0x00010000 X X#define CXM_FW_CAPTURE_STREAM_TYPE_MPEG 0x00000000 X#define CXM_FW_CAPTURE_STREAM_TYPE_RAW 0x00000001 X#define CXM_FW_CAPTURE_STREAM_TYPE_RAW_PASSTHROUGH 0x00000002 X#define CXM_FW_CAPTURE_STREAM_TYPE_VBI 0x00000003 X X#define CXM_FW_CAPTURE_STREAM_YUV 0x00000001 X#define CXM_FW_CAPTURE_STREAM_PCM_AUDIO 0x00000002 X#define CXM_FW_CAPTURE_STREAM_VBI 0x00000004 X X#define CXM_FW_STREAM_TYPE_DVD 0x0000000a X#define CXM_FW_STREAM_TYPE_MPEG1 0x00000002 X#define CXM_FW_STREAM_TYPE_MPEG2_PROGRAM 0x00000000 X#define CXM_FW_STREAM_TYPE_VCD 0x0000000b X X#define CXM_MACROBLOCK_HEIGHT 16 X#define CXM_MACROBLOCK_WIDTH 16 X#define CXM_MACROBLOCK_SIZE (CXM_MACROBLOCK_HEIGHT * CXM_MACROBLOCK_WIDTH) X X/* X * I2C addresses X */ X#define CXM_I2C_EEPROM 0xa0 X#define CXM_I2C_IR 0x30 X#define CXM_I2C_MSP3400 0x80 X#define CXM_I2C_SAA7115 0x42 X#define CXM_I2C_TUNER 0xc2 X X/* The maximum wait time of the MSP X is 1 ms during normal operations. */ X#define CXM_I2C_TIMEOUT 1000 X X/* X * EEPROM X */ Xint cxm_eeprom_init( struct cxm_softc *sc ); Xint cxm_eeprom_tuner_type( struct cxm_softc *sc ); X X/* X * Infrared remote X */ Xint cxm_ir_init( struct cxm_softc *sc ); Xint cxm_ir_key( struct cxm_softc *sc, char *buf, int len ); X X/* X * Audio decoder X */ X#define CXM_MSP3400C_DEM 0x10 X#define CXM_MSP3400C_DFP 0x12 X Xstruct cxm_msp_setting { X unsigned char dev; X unsigned int addr; X char value[2]; X}; X Xstruct cxm_msp_command { X unsigned int nsettings; X struct cxm_msp_setting settings[4]; X}; X Xint cxm_msp_init( struct cxm_softc *sc ); Xint cxm_msp_mute( struct cxm_softc *sc ); Xint cxm_msp_unmute( struct cxm_softc *sc ); Xint cxm_msp_is_muted( struct cxm_softc *sc ); Xint cxm_msp_select_source( struct cxm_softc *sc, enum cxm_source source ); Xenum cxm_source cxm_msp_selected_source( struct cxm_softc *sc ); Xint cxm_msp_autodetect_standard( struct cxm_softc *sc ); Xint cxm_msp_is_locked( struct cxm_softc *sc ); Xint cxm_msp_wait_for_lock( struct cxm_softc *sc ); X X/* X * Tuner X */ X#define CXM_TUNER_PHILIPS_FI1236_MK2 0 X#define CXM_TUNER_PHILIPS_FM1236 1 X#define CXM_TUNER_PHILIPS_FI1216_MK2 2 X#define CXM_TUNER_PHILIPS_FM1216 3 X#define CXM_TUNER_PHILIPS_FI1246_MK2 4 X#define CXM_TUNER_PHILIPS_FM1246 5 X X#define CXM_TUNER_TYPES 6 X X#define CXM_TUNER_AFC_MASK 0x07 X X#define CXM_TUNER_AFC_FREQ_MINUS_125 0x00 X#define CXM_TUNER_AFC_FREQ_MINUS_62 0x01 X#define CXM_TUNER_AFC_FREQ_CENTERED 0x02 X#define CXM_TUNER_AFC_FREQ_PLUS_62 0x03 X#define CXM_TUNER_AFC_FREQ_PLUS_125 0x04 X X#define CXM_TUNER_PHASE_LOCKED 0x40 X Xstruct cxm_tuner_band_code { X unsigned long freq; X unsigned char codes[2]; X}; X Xstruct cxm_tuner_channel_assignment { X unsigned int channel; X unsigned long freq; X unsigned long step; X}; X Xstruct cxm_tuner_channels { X const char *name; X unsigned int min_channel; X unsigned int max_channel; X unsigned long if_freq; X struct cxm_tuner_channel_assignment assignments[17]; X}; X Xstruct cxm_tuner { X const char *name; X unsigned long min_freq; X unsigned long max_freq; X struct cxm_tuner_band_code band_codes[3]; X unsigned long fm_min_freq; X unsigned long fm_max_freq; X struct cxm_tuner_band_code fm_band_code; X struct { X const struct cxm_tuner_channels *air; X const struct cxm_tuner_channels *cable; X } channels; X}; X Xenum cxm_tuner_freq_type { cxm_tuner_unknown_freq_type, cxm_tuner_fm_freq_type, X cxm_tuner_tv_freq_type }; X Xint cxm_tuner_init( struct cxm_softc *sc ); Xint cxm_tuner_select_frequency( struct cxm_softc *sc, X enum cxm_tuner_freq_type type, X unsigned long freq ); Xint cxm_tuner_select_channel( struct cxm_softc *sc, unsigned int channel ); Xint cxm_tuner_apply_afc( struct cxm_softc *sc ); Xint cxm_tuner_is_locked( struct cxm_softc *sc ); Xint cxm_tuner_wait_for_lock( struct cxm_softc *sc ); Xint cxm_tuner_status( struct cxm_softc *sc ); X X/* X * Video decoder X */ Xstruct cxm_saa7115_setting { X unsigned char addr; X unsigned int nvalues; X char values[32]; X}; X Xstruct cxm_saa7115_command { X unsigned int nsettings; X struct cxm_saa7115_setting settings[20]; X}; X Xstruct cxm_saa7115_scaling { X unsigned int width; X unsigned int height; X const struct cxm_saa7115_command *scaling; X}; X Xint cxm_saa7115_init( struct cxm_softc *sc ); Xint cxm_saa7115_mute( struct cxm_softc *sc ); Xint cxm_saa7115_unmute( struct cxm_softc *sc ); Xint cxm_saa7115_select_source( struct cxm_softc *sc, enum cxm_source source ); Xint cxm_saa7115_configure_scaler( struct cxm_softc *sc, X unsigned int width, unsigned int height ); Xenum cxm_source_format cxm_saa7115_detected_format( struct cxm_softc *sc ); Xint cxm_saa7115_detected_fps( struct cxm_softc *sc ); Xint cxm_saa7115_is_locked( struct cxm_softc *sc ); Xint cxm_saa7115_wait_for_lock( struct cxm_softc *sc ); END-of-dev/cxm/cxm.h echo x - dev/cxm/cxm_audio.c sed 's/^X//' >dev/cxm/cxm_audio.c << 'END-of-dev/cxm/cxm_audio.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Audio decoder routines for the Conexant MPEG-2 Codec driver. X * X * Ideally these routines should be implemented as a separate X * driver which has a generic audio decoder interface so that X * it's not necessary for each multimedia driver to re-invent X * the wheel. X */ X X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X X#include X#include X X#include "iicbb_if.h" X X Xstatic const struct cxm_msp_command Xmsp343xG_init = { X 4, X { X /* Enable Automatic Sound Select */ X { CXM_MSP3400C_DEM, 0x0030, { 0x20, 0x03 } }, X /* SCART prescale = 0 dB */ X { CXM_MSP3400C_DFP, 0x000d, { 0x19, 0x00 } }, X /* FM / AM Prescale = 100 Khz and FM Matrix = Sound A Mono */ X { CXM_MSP3400C_DFP, 0x000e, { 0x24, 0x03 } }, X /* Enable Automatic Standard Select */ X { CXM_MSP3400C_DEM, 0x0020, { 0x00, 0x01 } }, X } X}; X Xstatic const struct cxm_msp_command Xmsp34xxx_mute = { X 2, X { X /* Loudspeaker volume = mute */ X { CXM_MSP3400C_DFP, 0x0000, { 0x00, 0x00 } }, X /* SC1_OUT_L/R volume = mute */ X { CXM_MSP3400C_DFP, 0x0007, { 0x00, 0x01 } } X } X}; X Xstatic const struct cxm_msp_command Xmsp34xxx_unmute = { X 2, X { X /* Loudspeaker volume = 0 db */ X { CXM_MSP3400C_DFP, 0x0000, { 0x73, 0x00 } }, X /* SC1_OUT_L/R volume = 0 db */ X { CXM_MSP3400C_DFP, 0x0007, { 0x73, 0x01 } } X } X}; X Xstatic const struct cxm_msp_command Xmsp34xxx_select_fm = { X 3, X { X /* Loudspeaker Source = SCART, Matrix = STEREO */ X { CXM_MSP3400C_DFP, 0x0008, { 0x02, 0x20 } }, X /* SCART1_L/R Source = SCART, Matrix = STEREO */ X { CXM_MSP3400C_DFP, 0x000a, { 0x02, 0x20 } }, X /* DSP In = SC2_IN_L/R, SC1_OUT_L/R Source = SCART1_L/R */ X { CXM_MSP3400C_DFP, 0x0013, { 0x0e, 0x00 } } X } X}; X Xstatic const struct cxm_msp_command Xmsp34xxx_select_line_in = { X 3, X { X /* Loudspeaker Source = SCART, Matrix = STEREO */ X { CXM_MSP3400C_DFP, 0x0008, { 0x02, 0x20 } }, X /* SCART1_L/R Source = SCART, Matrix = STEREO */ X { CXM_MSP3400C_DFP, 0x000a, { 0x02, 0x20 } }, X /* DSP In = SC1_IN_L/R, SC1_OUT_L/R Source = SCART1_L/R */ X { CXM_MSP3400C_DFP, 0x0013, { 0x0c, 0x00 } } X } X}; X Xstatic const struct cxm_msp_command Xmsp34xxx_select_tuner = { X 3, X { X /* Loudspeaker Source = demodulator (St or A), Matrix = St */ X { CXM_MSP3400C_DFP, 0x0008, { 0x03, 0x20 } }, X /* SCART1_L/R Source = demodulator (St or A), Matrix = St */ X { CXM_MSP3400C_DFP, 0x000a, { 0x03, 0x20 } }, X /* DSP In = mute, SC1_OUT_L/R Source = SCART1_L/R */ X { CXM_MSP3400C_DFP, 0x0013, { 0x0f, 0x20 } } X } X}; X X X/* Reset the MSP or DPL chip */ Xstatic int Xcxm_msp_dpl_reset( device_t iicbus, int i2c_addr ) X{ X unsigned char msg[3]; X int sent; X X /* put into reset mode */ X msg[0] = 0x00; X msg[1] = 0x80; X msg[2] = 0x00; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X iicbus_stop(iicbus); X X /* put back to operational mode */ X msg[0] = 0x00; X msg[1] = 0x00; X msg[2] = 0x00; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X iicbus_stop(iicbus); X X return 0; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X X/* Read from the MSP or DPL registers */ Xstatic int Xcxm_msp_dpl_read( device_t iicbus, int i2c_addr, X unsigned char dev, unsigned int addr, X char *buf, int len ) X{ X unsigned char msg[3]; X int received; X int sent; X X msg[0] = (unsigned char)(dev + 1); X msg[1] = (unsigned char)(addr >> 8); X msg[2] = (unsigned char)addr; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X if (iicbus_repeated_start(iicbus, i2c_addr + 1, CXM_I2C_TIMEOUT) != 0) X goto fail; X X if (iicbus_read(iicbus, buf, len, &received, IIC_LAST_READ, 0) != 0) X goto fail; X X iicbus_stop(iicbus); X X return received; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X X/* Write to the MSP or DPL registers */ Xstatic int Xcxm_msp_dpl_write( device_t iicbus, int i2c_addr, X unsigned char dev, unsigned int addr, X const char *buf, int len ) X{ X unsigned char msg[3]; X int sent; X X msg[0] = (unsigned char)dev; X msg[1] = (unsigned char)(addr >> 8); X msg[2] = (unsigned char)addr; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X if (iicbus_write(iicbus, buf, len, &sent, CXM_I2C_TIMEOUT) != 0) X goto fail; X X iicbus_stop(iicbus); X X return sent; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X Xint Xcxm_msp_init( struct cxm_softc *sc ) X{ X unsigned char rev1[2]; X unsigned char rev2[2]; X unsigned int i; X unsigned int nsettings; X const struct cxm_msp_setting *settings; X X if (cxm_msp_dpl_reset (sc->iicbus, CXM_I2C_MSP3400) < 0) X return -1; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x001e, rev1, sizeof(rev1)) != sizeof(rev1)) X return -1; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x001f, rev2, sizeof(rev2)) != sizeof(rev2)) X return -1; X X snprintf(sc->msp_name, sizeof(sc->msp_name), "%c4%02d%c-%c%d", X ((rev1[1] >> 4) & 0x0f) + '3', rev2[0], X (rev1[1] & 0x0f) + '@', rev1[0] + '@', rev2[1] & 0x1f); X X /* X * MSP 34x5G and MSP 44x8G are the only X * audio decoders currently supported. X */ X X if (strncmp(&sc->msp_name[0], "34", 2) == 0 X && strncmp(&sc->msp_name[3], "5G", 2) == 0) { X nsettings = msp343xG_init.nsettings; X settings = msp343xG_init.settings; X } X else if (strncmp(&sc->msp_name[0], "44", 2) == 0 X && strncmp(&sc->msp_name[3], "8G", 2) == 0) { X nsettings = msp343xG_init.nsettings; X settings = msp343xG_init.settings; X } X else { X printf("%s: unknown audio decoder MSP%s\n", X sc->name, sc->msp_name); X return -1; X } X X for (i = 0; i < nsettings; i++) X if (cxm_msp_dpl_write(sc->iicbus, CXM_I2C_MSP3400, X settings[i].dev, settings[i].addr, X settings[i].value, X sizeof(settings[i].value)) X != sizeof(settings[i].value)) X return -1; X X if (cxm_msp_select_source(sc, cxm_tuner_source) < 0) X return -1; X X printf("%s: MSP%s audio decoder\n", sc->name, sc->msp_name); X X return 0; X} X X Xint Xcxm_msp_mute( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_msp_setting *settings; X X nsettings = msp34xxx_mute.nsettings; X settings = msp34xxx_mute.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_msp_dpl_write(sc->iicbus, CXM_I2C_MSP3400, X settings[i].dev, settings[i].addr, X settings[i].value, X sizeof(settings[i].value)) X != sizeof(settings[i].value)) X return -1; X X return 0; X} X X Xint Xcxm_msp_unmute( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_msp_setting *settings; X X nsettings = msp34xxx_unmute.nsettings; X settings = msp34xxx_unmute.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_msp_dpl_write(sc->iicbus, CXM_I2C_MSP3400, X settings[i].dev, settings[i].addr, X settings[i].value, X sizeof(settings[i].value)) X != sizeof(settings[i].value)) X return -1; X X return 0; X} X X Xint Xcxm_msp_is_muted( struct cxm_softc *sc ) X{ X unsigned char volume[2]; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x0000, volume, sizeof(volume)) != sizeof(volume)) X return -1; X X return volume[0] == 0x00 || volume[0] == 0xff ? 1 : 0; X} X X Xint Xcxm_msp_select_source( struct cxm_softc *sc, enum cxm_source source ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_msp_setting *settings; X X switch (source) { X case cxm_fm_source: X nsettings = msp34xxx_select_fm.nsettings; X settings = msp34xxx_select_fm.settings; X break; X X case cxm_line_in_source_composite: X case cxm_line_in_source_svideo: X nsettings = msp34xxx_select_line_in.nsettings; X settings = msp34xxx_select_line_in.settings; X break; X X case cxm_tuner_source: X nsettings = msp34xxx_select_tuner.nsettings; X settings = msp34xxx_select_tuner.settings; X break; X X default: X return -1; X } X X for (i = 0; i < nsettings; i++) X if (cxm_msp_dpl_write(sc->iicbus, CXM_I2C_MSP3400, X settings[i].dev, settings[i].addr, X settings[i].value, X sizeof(settings[i].value)) X != sizeof(settings[i].value)) X return -1; X X return 0; X} X X Xenum cxm_source Xcxm_msp_selected_source( struct cxm_softc *sc ) X{ X unsigned char dsp[2]; X unsigned char source[2]; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x0008, source, sizeof(source)) != sizeof(source)) X return cxm_unknown_source; X X switch (source[0]) { X case 0: /* FM / AM mono signal */ X case 1: /* Stereo or A / B */ X case 3: /* Stereo or A */ X case 4: /* Stereo or B */ X return cxm_tuner_source; X X case 2: /* SCART */ X break; X X default: X return cxm_unknown_source; X } X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x0013, dsp, sizeof(dsp)) != sizeof(dsp)) X return cxm_unknown_source; X X if (dsp[1] & 0x20) X return cxm_unknown_source; X X switch (dsp[0] & 0x03) { X case 0: X return cxm_line_in_source_composite; X X case 2: X return cxm_fm_source; X X default: X return cxm_unknown_source; X } X} X X Xint Xcxm_msp_autodetect_standard( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_msp_setting *settings; X X switch (cxm_msp_selected_source(sc)) { X case cxm_tuner_source: X break; X X case cxm_fm_source: X case cxm_line_in_source_composite: X case cxm_line_in_source_svideo: X return 0; X X default: X return -1; X } X X /* X * Section 3.3.2.2 of the data sheet states: X * X * A general refresh of the STANDARD SELECT X * register is not allowed. X */ X X if (cxm_msp_dpl_reset (sc->iicbus, CXM_I2C_MSP3400) < 0) X return -1; X X nsettings = msp343xG_init.nsettings; X settings = msp343xG_init.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_msp_dpl_write(sc->iicbus, CXM_I2C_MSP3400, X settings[i].dev, settings[i].addr, X settings[i].value, X sizeof(settings[i].value)) X != sizeof(settings[i].value)) X return -1; X X if (cxm_msp_select_source(sc, cxm_tuner_source) < 0) X return -1; X X return 0; X} X X Xint Xcxm_msp_is_locked( struct cxm_softc *sc ) X{ X unsigned char source[2]; X unsigned char standard[2]; X unsigned char status[2]; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DFP, X 0x0008, source, sizeof(source)) != sizeof(source)) X return -1; X X switch (source[0]) { X case 0: /* FM / AM mono signal */ X case 1: /* Stereo or A / B */ X case 3: /* Stereo or A */ X case 4: /* Stereo or B */ X break; X X default: X return 1; X } X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DEM, X 0x007e, standard, sizeof(standard)) X != sizeof(standard)) X return -1; X X if (standard[0] >= 8 || (standard[0] == 0 && standard[1] == 0)) X return 0; X X if (cxm_msp_dpl_read(sc->iicbus, CXM_I2C_MSP3400, CXM_MSP3400C_DEM, X 0x0200, status, sizeof(status)) != sizeof(status)) X return -1; X X return (status[1] & 0x06) == 0x06 ? 0 : 1; X} X X Xint Xcxm_msp_wait_for_lock( struct cxm_softc *sc ) X{ X unsigned int i; X X /* X * Section 3.3.2.1 of the data sheet states: X * X * Within 0.5 s the detection and setup of the actual X * TV sound standard is performed. The detected result X * can be read out of the STANDARD RESULT register by X * the control processor. X */ X X for (i = 0; i < 10; i++) { X X /* X * The input may have just change (prior to X * cxm_msp_wait_for_lock) so start with the X * delay to give the audio decoder a chance X * to update it's status. X */ X X tsleep(&sc->iicbus, PZERO, "audio", hz / 20 ); X X switch (cxm_msp_is_locked(sc)) { X case 1: X return 1; X X case 0: X break; X X default: X return -1; X } X } X X printf("%s: audio decoder failed to lock\n", sc->name); X X return 0; X} END-of-dev/cxm/cxm_audio.c echo x - dev/cxm/cxm_eeprom.c sed 's/^X//' >dev/cxm/cxm_eeprom.c << 'END-of-dev/cxm/cxm_eeprom.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * EEPROM routines for the Conexant MPEG-2 Codec driver. X * X * Ideally these routines should be implemented as a separate X * driver which has a generic EEPROM interface so that it's X * not necessary for each multimedia driver to re-invent the X * wheel. X */ X X X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X X#include X#include X X#include "iicbb_if.h" X X Xstatic int Xcxm_eeprom_read( device_t iicbus, int i2c_addr, X char *buf, int len, unsigned int offset ) X{ X char msg[1]; X int received; X int sent; X X msg[0] = (unsigned char)offset; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X if (iicbus_repeated_start(iicbus, i2c_addr + 1, CXM_I2C_TIMEOUT) != 0) X goto fail; X X if (iicbus_read(iicbus, buf, len, &received, IIC_LAST_READ, 0) != 0) X goto fail; X X iicbus_stop(iicbus); X X return received; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X Xint Xcxm_eeprom_init( struct cxm_softc *sc ) X{ X unsigned char eeprom[1]; X X if (cxm_eeprom_read(sc->iicbus, CXM_I2C_EEPROM, X eeprom, sizeof(eeprom), 0) != sizeof(eeprom)) X return -1; X X return 0; X} X X Xint Xcxm_eeprom_tuner_type( struct cxm_softc *sc ) X{ X unsigned char eeprom[256]; X unsigned int i; X unsigned int len; X unsigned int subsystem_vendor_id; X unsigned int tuner_code; X int tuner_type; X X if (cxm_eeprom_read(sc->iicbus, CXM_I2C_EEPROM, X eeprom, sizeof(eeprom), 0) != sizeof(eeprom)) X return -1; X X subsystem_vendor_id = (unsigned int)eeprom[254] << 8 | eeprom[255]; X tuner_type = -1; X X switch (subsystem_vendor_id) { X case CXM_VENDORID_HAUPPAUGE: X X /* X * The Hauppauge eeprom format is tagged. X */ X X if (eeprom[0] != 0x84) { X printf("%s: unknown Hauppauge eeprom format %#x\n", X sc->name, (unsigned int)eeprom[0]); X break; X } X X tuner_code = -1; X X for (i = 0; i < sizeof(eeprom); i += len) { X len = 0; X if (eeprom[i] == 0x84) { X len = (unsigned int)eeprom[i + 2] << 8 X | eeprom[i + 1]; X i += 3; X } X else if ((eeprom[i] & 0xf0) == 0x70) { X if (eeprom[i] & 0x08) X break; X len = eeprom[i] & 0x07; X i++; X } X else { X printf( X "%s: unknown Hauppauge eeprom packet %#x\n", X sc->name, (unsigned int)eeprom[i]); X return -1; X } X X if (i >= sizeof(eeprom) X || (i + len) > sizeof(eeprom)) { X printf("%s: corrupt Hauppauge eeprom packet\n", X sc->name); X return -1; X } X X switch (eeprom[i]) { X case 0x00: X tuner_code = eeprom[i + 6]; X break; X X case 0x0a: X tuner_code = eeprom[i + 2]; X break; X X default: X break; X } X } X X switch (tuner_code) { X case 0x03: /* Philips FI1216 */ X case 0x08: /* Philips FI1216 MK2 */ X case 0x1d: /* Temic 4006FH5 */ X tuner_type = CXM_TUNER_PHILIPS_FI1216_MK2; X break; X X case 0x05: /* Philips FI1236 */ X case 0x0a: /* Philips FI1236 MK2 */ X case 0x1a: /* Temic 4036FY5 */ X tuner_type = CXM_TUNER_PHILIPS_FI1236_MK2; X break; X X case 0x06: /* Philips FI1246 */ X case 0x0b: /* Philips FI1246 MK2 */ X case 0x23: /* Temic 4066FY5 */ X tuner_type = CXM_TUNER_PHILIPS_FI1246_MK2; X break; X X case 0x10: /* Philips FR1216 MK2 */ X case 0x15: /* Philips FM1216 */ X case 0x2a: /* Temic 4009FR5 */ X tuner_type = CXM_TUNER_PHILIPS_FM1216; X break; X X case 0x12: /* Philips FR1236 MK2 */ X case 0x17: /* Philips FM1236 */ X case 0x21: /* Temic 4039FY5 */ X tuner_type = CXM_TUNER_PHILIPS_FM1236; X break; X X case 0x13: /* Philips FR1246 MK2 */ X case 0x18: /* Philips FM1246 */ X tuner_type = CXM_TUNER_PHILIPS_FM1246; X break; X X default: X printf("%s: unknown tuner code %#x\n", X sc->name, tuner_code); X break; X } X break; X X default: X printf("%s: unknown subsystem vendor id %#x\n", X sc->name, subsystem_vendor_id); X break; X } X X return tuner_type; X} END-of-dev/cxm/cxm_eeprom.c echo x - dev/cxm/cxm_i2c.c sed 's/^X//' >dev/cxm/cxm_i2c.c << 'END-of-dev/cxm/cxm_i2c.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * I2c routines for the Conexant MPEG-2 Codec driver. X */ X X#include X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#if __FreeBSD_version < 500000 X# include X# include X#else X# include X# include X#endif X X#include X X#include X#include X X#include "iicbb_if.h" X X Xstatic int cxm_iic_probe( device_t dev ); Xstatic int cxm_iic_attach( device_t dev ); Xstatic int cxm_iic_detach( device_t dev ); Xstatic void cxm_iic_child_detached( device_t dev, device_t child ); X Xstatic int cxm_iic_callback( device_t, int, caddr_t * ); Xstatic int cxm_iic_reset( device_t, u_char, u_char, u_char * ); Xstatic int cxm_iic_getscl( device_t ); Xstatic int cxm_iic_getsda( device_t ); Xstatic void cxm_iic_setscl( device_t, int ); Xstatic void cxm_iic_setsda( device_t, int ); Xstatic void cxm_iic_setlines( device_t, int, int ); X Xstatic device_method_t cxm_iic_methods[] = { X /* Device interface */ X DEVMETHOD(device_probe, cxm_iic_probe), X DEVMETHOD(device_attach, cxm_iic_attach), X DEVMETHOD(device_detach, cxm_iic_detach), X X /* bus interface */ X DEVMETHOD(bus_child_detached, cxm_iic_child_detached), X DEVMETHOD(bus_print_child, bus_generic_print_child), X DEVMETHOD(bus_driver_added, bus_generic_driver_added), X X /* iicbb interface */ X DEVMETHOD(iicbb_callback, cxm_iic_callback), X DEVMETHOD(iicbb_reset, cxm_iic_reset), X X#if __FreeBSD_version < 500000 X DEVMETHOD(iicbb_getdataline, cxm_iic_getsda), X DEVMETHOD(iicbb_setlines, cxm_iic_setlines), X#else X DEVMETHOD(iicbb_getscl, cxm_iic_getscl), X DEVMETHOD(iicbb_getsda, cxm_iic_getsda), X DEVMETHOD(iicbb_setscl, cxm_iic_setscl), X DEVMETHOD(iicbb_setsda, cxm_iic_setsda), X#endif X X { 0, 0 } X}; X Xstatic driver_t cxm_iic_driver = { X "cxm_iic", X cxm_iic_methods, X sizeof(struct cxm_iic_softc), X}; X Xstatic devclass_t cxm_iic_devclass; X XMODULE_VERSION(cxm_iic, 1); XDRIVER_MODULE(cxm_iic, cxm, cxm_iic_driver, cxm_iic_devclass, 0, 0); X X X/* X * the boot time probe routine. X * X * The cxm_iic device is only probed after it has X * been established that the cxm device is present X * which means that the cxm_iic device * must * X * be present since it's built into the cxm hardware. X */ Xstatic int Xcxm_iic_probe( device_t dev ) X{ X device_set_desc(dev, "Conexant iTVC15 / iTVC16 I2C controller"); X X return 0; X} X X X/* X * the attach routine. X */ Xstatic int Xcxm_iic_attach( device_t dev ) X{ X device_t *kids; X device_t iicbus; X int error; X int numkids; X int i; X int unit; X unsigned int bhandle; X unsigned int btag; X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X unit = device_get_unit(dev); X X /* build the device name */ X snprintf(sc->name, sizeof(sc->name), "cxm_iic%d",unit); X X /* retrieve the cxm btag and bhandle */ X if (BUS_READ_IVAR(device_get_parent(dev), dev, CXM_IVAR_BTAG, &btag) X || BUS_READ_IVAR(device_get_parent(dev), dev, X CXM_IVAR_BHANDLE, &bhandle)) { X device_printf(dev, X "could not retrieve bus space information\n"); X return ENXIO; X } X X sc->btag = btag; X sc->bhandle = bhandle; X X /* add bit-banging generic code onto cxm_iic interface */ X sc->iicbb = device_add_child(dev, "iicbb", -1); X X if (! sc->iicbb) { X device_printf(dev, "could not add iicbb\n"); X return ENXIO; X } X X /* probed and attached the bit-banging code */ X error = device_probe_and_attach(sc->iicbb); X X if (error) { X device_printf(dev, "could not attach iicbb\n"); X goto fail; X } X X /* locate iicbus which was attached by the bit-banging code */ X iicbus = NULL; X device_get_children(sc->iicbb, &kids, &numkids); X for (i = 0; i < numkids; i++) X if (strcmp(device_get_name(kids[i]), "iicbus") == 0) { X iicbus = kids[i]; X break; X } X free(kids, M_TEMP); X X if (! iicbus) { X device_printf(dev, "could not find iicbus\n"); X error = ENXIO; X goto fail; X } X X if (BUS_WRITE_IVAR(device_get_parent(dev), dev, X CXM_IVAR_IICBUS, (uintptr_t)iicbus)) { X device_printf(dev, "could not store iicbus information\n"); X error = ENXIO; X goto fail; X } X X return 0; X Xfail: X /* X * Detach the children before recursively deleting X * in case a child has a pointer to a grandchild X * which is used by the child's detach routine. X */ X bus_generic_detach(dev); X if (sc->iicbb) X device_delete_child(dev, sc->iicbb); X X return error; X} X X X/* X * the detach routine. X */ Xstatic int Xcxm_iic_detach( device_t dev ) X{ X struct cxm_iic_softc *sc; X device_t child; X X /* Get the device data */ X sc = device_get_softc(dev); X X (void)BUS_WRITE_IVAR(device_get_parent(dev), dev, CXM_IVAR_IICBUS, 0); X X /* X * Detach the children before recursively deleting X * in case a child has a pointer to a grandchild X * which is used by the child's detach routine. X * X * Remember the child before detaching so we can X * delete it (bus_generic_detach indirectly zeroes X * sc->child_dev). X */ X child = sc->iicbb; X bus_generic_detach(dev); X if (child) X device_delete_child(dev, child); X X return 0; X} X X X/* X * the child detached routine. X */ Xstatic void Xcxm_iic_child_detached( device_t dev, device_t child ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = device_get_softc(dev); X X if (child == sc->iicbb) X sc->iicbb = NULL; X} X X Xstatic int Xcxm_iic_callback( device_t dev, int index, caddr_t *data ) X{ X return 0; X} X X Xstatic int Xcxm_iic_reset( device_t dev, u_char speed, u_char addr, u_char * oldaddr ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = (struct cxm_iic_softc *)device_get_softc(dev); X X /* Set scl to 1 */ X CSR_WRITE_4(sc, CXM_REG_I2C_SETSCL, ~(int)1); X X /* Set sda to 1 */ X CSR_WRITE_4(sc, CXM_REG_I2C_SETSDA, ~(int)1); X X /* X * PCI writes may be buffered so force the X * write to complete by reading the last X * location written. X */ X X (void)CSR_READ_4(sc, CXM_REG_I2C_SETSDA); X X /* Wait for 10 usec */ X DELAY(10); X X return IIC_ENOADDR; X} X X Xstatic int Xcxm_iic_getscl( device_t dev ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = (struct cxm_iic_softc *)device_get_softc(dev); X X /* Get sda */ X return CSR_READ_1(sc, CXM_REG_I2C_GETSCL); X} X X Xstatic int Xcxm_iic_getsda( device_t dev ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = (struct cxm_iic_softc *)device_get_softc(dev); X X /* Get sda */ X return CSR_READ_1(sc, CXM_REG_I2C_GETSDA); X} X X Xstatic void Xcxm_iic_setscl( device_t dev, int val ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = (struct cxm_iic_softc *)device_get_softc(dev); X X /* Set scl to the requested value */ X CSR_WRITE_4(sc, CXM_REG_I2C_SETSCL, ~(int)(val ? 1 : 0)); X X /* X * PCI writes may be buffered so force the X * write to complete by reading the last X * location written. X */ X X (void)CSR_READ_4(sc, CXM_REG_I2C_SETSCL); X} X X Xstatic void Xcxm_iic_setsda( device_t dev, int val ) X{ X struct cxm_iic_softc *sc; X X /* Get the device data */ X sc = (struct cxm_iic_softc *)device_get_softc(dev); X X /* Set sda to the requested value */ X CSR_WRITE_4(sc, CXM_REG_I2C_SETSDA, ~(int)(val ? 1 : 0)); X X /* X * PCI writes may be buffered so force the X * write to complete by reading the last X * location written. X */ X X (void)CSR_READ_4(sc, CXM_REG_I2C_SETSDA); X} X X Xstatic void Xcxm_iic_setlines( device_t dev, int ctrl, int data ) X{ X X cxm_iic_setscl(dev, ctrl); X cxm_iic_setsda(dev, data); X X /* Wait for 10 usec */ X DELAY(10); X} END-of-dev/cxm/cxm_i2c.c echo x - dev/cxm/cxm_ir.c sed 's/^X//' >dev/cxm/cxm_ir.c << 'END-of-dev/cxm/cxm_ir.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Infrared remote routines for the Conexant MPEG-2 Codec driver. X * X * Ideally these routines should be implemented as a separate X * driver which has a generic infrared remote interface so that X * it's not necessary for each multimedia driver to re-invent X * the wheel. X */ X X X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X X#include X#include X X#include "iicbb_if.h" X X Xstatic int Xcxm_ir_read( device_t iicbus, int i2c_addr, char *buf, int len ) X{ X int received; X X if (iicbus_start(iicbus, i2c_addr + 1, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_read(iicbus, buf, len, &received, IIC_LAST_READ, 0) != 0) X goto fail; X X iicbus_stop(iicbus); X X return received; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X Xint Xcxm_ir_init( struct cxm_softc *sc ) X{ X unsigned char key[1]; X X if (cxm_ir_read(sc->iicbus, CXM_I2C_IR, X key, sizeof(key)) != sizeof(key)) X return -1; X X printf("%s: IR Remote\n", sc->name); X X return 0; X} X X Xint Xcxm_ir_key( struct cxm_softc *sc, char *buf, int len ) X{ X int result; X X result = cxm_ir_read(sc->iicbus, CXM_I2C_IR, buf, len); X X if (result >= 0) X return result; X X /* X * If the IR receiver didn't respond, X * then wait 50 ms and try again. X */ X X tsleep(&sc->iicbus, PZERO, "IR", hz / 20 ); X X return cxm_ir_read(sc->iicbus, CXM_I2C_IR, buf, len); X} END-of-dev/cxm/cxm_ir.c echo x - dev/cxm/cxm_tuner.c sed 's/^X//' >dev/cxm/cxm_tuner.c << 'END-of-dev/cxm/cxm_tuner.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Tuner routines for the Conexant MPEG-2 Codec driver. X * X * Ideally these routines should be implemented as a separate X * driver which has a generic tuner interface so that it's X * not necessary for each multimedia driver to re-invent the X * wheel. X */ X X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X X#include X#include X X#include "iicbb_if.h" X X X/* X * Channel mappings derived from X * http://developer.apple.com/technotes/tn/tn1012.html X */ X Xstatic const struct cxm_tuner_channels Xus_air_channels = { X "US Broadcast", X 2, X 69, X 45750, X { { 14, 471250, 6000 }, X { 7, 175250, 6000 }, X { 5, 77250, 6000 }, X { 2, 55250, 6000 } } X}; X Xstatic const struct cxm_tuner_channels Xus_cable_channels = { X "US Cable", X 2, X 125, X 45750, X { { 100, 649250, 6000 }, X { 95, 91250, 6000 }, X { 23, 217250, 6000 }, X { 14, 121250, 6000 }, X { 7, 175250, 6000 }, X { 5, 77250, 6000 }, X { 2, 55250, 6000 } } X}; X Xstatic const struct cxm_tuner_channels Xbg_air_channels = { X "B/G Broadcast", X 2, X 89, X 38900, X { { 82, 175250, 7000 }, X { 80, 55250, 7000 }, X { 79, 217250, 7000 }, X { 77, 209250, 7000 }, X { 76, 138250, 9000 }, X { 75, 102250, 9000 }, X { 73, 86250, 9000 }, X { 72, 64250, 7500 }, X { 70, 49750, 7500 }, X { 21, 471250, 8000 }, X { 20, 210250, 8500 }, X { 18, 192750, 8500 }, X { 16, 175250, 8000 }, X { 15, 82250, 8500 }, X { 13, 53750, 8500 }, X { 5, 175250, 7000 }, X { 2, 48250, 7000 } } X}; X Xstatic const struct cxm_tuner_channels Xi_air_channels = { X "I Broadcast", X 1, X 83, X 38900, X { { 75, 179750, 5000 }, X { 71, 51750, 5000 }, X { 70, 45000, 5000 }, X { 21, 471250, 8000 }, X { 20, 0, 0 }, X { 19, 0, 0 }, X { 18, 0, 0 }, X { 17, 0, 0 }, X { 16, 0, 0 }, X { 15, 0, 0 }, X { 14, 0, 0 }, X { 13, 247250, 8000 }, X { 12, 0, 0 }, X { 4, 175250, 8000 }, X { 1, 45750, 8000 } } X}; X X Xconst struct cxm_tuner Xcxm_tuners[CXM_TUNER_TYPES] = { X { "Philips FI1236 MK2", 55250, 801250, X { { 454000, { 0x8e, 0x30 } }, X { 160000, { 0x8e, 0x90 } }, X { 55250, { 0x8e, 0xa0 } } }, X 0, 0, X { 0, { 0x00, 0x00 } }, X { &us_air_channels, &us_cable_channels } }, X { "Philips FM1236", 55250, 801250, X { { 454000, { 0xce, 0x30 } }, X { 160000, { 0xce, 0x90 } }, X { 55250, { 0xce, 0xa0 } } }, X 76000, 108000, X { 76000, { 0x88, 0xa5 } }, X { &us_air_channels, &us_cable_channels } }, X { "Philips FI1216 MK2", 48250, 855250, X { { 450000, { 0x8e, 0x30 } }, X { 170000, { 0x8e, 0x90 } }, X { 48250, { 0x8e, 0xa0 } } }, X 0, 0, X { 0, { 0x00, 0x00 } }, X { &bg_air_channels, NULL } }, X { "Philips FM1216", 48250, 855250, X { { 450000, { 0xce, 0x30 } }, X { 170000, { 0xce, 0x90 } }, X { 48250, { 0xce, 0xa0 } } }, X 87500, 108000, X { 87500, { 0x88, 0xa5 } }, X { &bg_air_channels, NULL } }, X { "Philips FI1246 MK2", 45750, 855250, X { { 450000, { 0x8e, 0x30 } }, X { 170000, { 0x8e, 0x90 } }, X { 45750, { 0x8e, 0xa0 } } }, X 0, 0, X { 0, { 0x00, 0x00 } }, X { &i_air_channels, NULL } }, X { "Philips FM1246", 45750, 855250, X { { 450000, { 0xce, 0x30 } }, X { 170000, { 0xce, 0x90 } }, X { 45750, { 0xce, 0xa0 } } }, X 87500, 108000, X { 87500, { 0x88, 0xa5 } }, X { &i_air_channels, NULL } } X}; X X X/* Read from the tuner registers */ Xstatic int Xcxm_tuner_read( device_t iicbus, int i2c_addr, char *buf, int len ) X{ X int received; X X if (iicbus_start(iicbus, i2c_addr + 1, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_read(iicbus, buf, len, &received, IIC_LAST_READ, 0) != 0) X goto fail; X X iicbus_stop(iicbus); X X return received; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X X/* Write to the tuner registers */ Xstatic int Xcxm_tuner_write( device_t iicbus, int i2c_addr, const char *buf, int len ) X{ X int sent; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, buf, len, &sent, CXM_I2C_TIMEOUT) != 0) X goto fail; X X iicbus_stop(iicbus); X X return sent; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X Xint Xcxm_tuner_init( struct cxm_softc *sc ) X{ X unsigned char status; X int tuner_type; X X if (cxm_eeprom_init(sc) < 0) X return -1; X X tuner_type = cxm_eeprom_tuner_type(sc); X X if (tuner_type < 0 || tuner_type >= NUM_ELEMENTS(cxm_tuners)) X return -1; X X sc->tuner = &cxm_tuners[tuner_type]; X sc->tuner_channels = sc->tuner->channels.cable X ? sc->tuner->channels.cable X : sc->tuner->channels.air; X sc->tuner_freq = 0; X X if (cxm_tuner_read(sc->iicbus, CXM_I2C_TUNER, &status, sizeof(status)) X != sizeof(status)) X return -1; X X if (cxm_tuner_select_channel(sc, 4) < 0) X return -1; X X printf("%s: %s tuner\n", sc->name, sc->tuner->name); X X return 0; X} X X Xint Xcxm_tuner_select_frequency( struct cxm_softc *sc, X enum cxm_tuner_freq_type freq_type, X unsigned long freq ) X{ X unsigned char msg[4]; X unsigned long N; X unsigned long osc_freq; X const struct cxm_tuner_band_code *band_codes; X X N = 0; X X switch (freq_type) { X case cxm_tuner_fm_freq_type: X X if (freq < sc->tuner->fm_min_freq X || freq > sc->tuner->fm_max_freq X || ! sc->tuner->fm_band_code.freq) X return -1; X X /* X * N = { fRF(pc) + fIF(pc) } / step_size X * X * fRF = RF frequency in MHz X * fIF = Intermediate frequency in MHz (FM = 10.70 MHz) X * step_size = Step size in MHz (FM = 50 kHz) X */ X X osc_freq = freq + 10700; X X N = (20 * osc_freq) / 1000; X X msg[0] = (unsigned char)(N >> 8); X msg[1] = (unsigned char)N; X msg[2] = sc->tuner->fm_band_code.codes[0]; X msg[3] = sc->tuner->fm_band_code.codes[1]; X break; X X case cxm_tuner_tv_freq_type: X X if (freq < sc->tuner->min_freq X || freq > sc->tuner->max_freq) X return -1; X X /* X * N = 16 * { fRF(pc) + fIF(pc) } X * X * fRF = RF frequency in MHz X * fIF = Intermediate frequency in MHz X * X * The data sheet doesn't state it, however X * this is probably the same equation as X * FM simply with 62.5 kHz as the step size. X */ X X osc_freq = freq + sc->tuner_channels->if_freq; X X N = (16 * osc_freq) / 1000; X X for (band_codes = sc->tuner->band_codes; X band_codes->freq > freq; band_codes++) X ; X X if (freq >= sc->tuner_freq) { X msg[0] = (unsigned char)(N >> 8); X msg[1] = (unsigned char)N; X msg[2] = band_codes->codes[0]; X msg[3] = band_codes->codes[1]; X } X else { X msg[0] = band_codes->codes[0]; X msg[1] = band_codes->codes[1]; X msg[2] = (unsigned char)(N >> 8); X msg[3] = (unsigned char)N; X } X break; X X default: X return -1; X } X X if (N > 32767) X return -1; X X if (cxm_tuner_write(sc->iicbus, CXM_I2C_TUNER, msg, sizeof(msg)) X != sizeof(msg)) X return -1; X X sc->tuner_freq = freq; X X return 0; X} X X Xint Xcxm_tuner_select_channel( struct cxm_softc *sc, unsigned int channel ) X{ X unsigned long freq; X const struct cxm_tuner_channel_assignment *assignments; X const struct cxm_tuner_channels *channels; X X channels = sc->tuner_channels; X X if (! channels X || channel < channels->min_channel X || channel > channels->max_channel) X return -1; X X for (assignments = channels->assignments; X assignments->channel > channel; assignments++) X ; X X if (! assignments->freq) X return -1; X X freq = assignments->freq X + (channel - assignments->channel) * assignments->step; X X return cxm_tuner_select_frequency(sc, cxm_tuner_tv_freq_type, freq); X} X X Xint Xcxm_tuner_apply_afc( struct cxm_softc *sc ) X{ X unsigned char status; X unsigned int i; X unsigned long freq; X unsigned long max_offset; X unsigned long original_freq; X unsigned long prev_freq; X unsigned long step_size; X X if (cxm_tuner_wait_for_lock(sc) != 1) X return -1; X X original_freq = sc->tuner_freq; X X freq = sc->tuner_freq; X prev_freq = 0; X max_offset = 2000; X step_size = 63; X X for (i = 0; i < (max_offset / step_size); i++) { X if (cxm_tuner_read(sc->iicbus, CXM_I2C_TUNER, X &status, sizeof(status)) != sizeof(status)) X break; X X if (! (status & CXM_TUNER_PHASE_LOCKED) ) X break; X X switch (status & CXM_TUNER_AFC_MASK) { X case CXM_TUNER_AFC_FREQ_CENTERED: X return 0; X X case CXM_TUNER_AFC_FREQ_MINUS_125: X case CXM_TUNER_AFC_FREQ_MINUS_62: X freq -= step_size; X break; X X case CXM_TUNER_AFC_FREQ_PLUS_62: X case CXM_TUNER_AFC_FREQ_PLUS_125: X freq += step_size; X break; X X default: X goto fail; X } X X if (freq == prev_freq) X return 0; X prev_freq = sc->tuner_freq; X X if (cxm_tuner_select_frequency(sc, cxm_tuner_tv_freq_type, X freq) < 0) X break; X X /* X * Delay long enough for the tuner to update it's status. X */ X X tsleep(&sc->iicbus, PZERO, "afc", hz / 10 ); X } X Xfail: X (void)cxm_tuner_select_frequency(sc, cxm_tuner_tv_freq_type, X original_freq); X return -1; X} X X Xint Xcxm_tuner_is_locked( struct cxm_softc *sc ) X{ X unsigned char status; X X if (cxm_tuner_read(sc->iicbus, CXM_I2C_TUNER, &status, sizeof(status)) X != sizeof(status)) X return -1; X X return (status & CXM_TUNER_PHASE_LOCKED) ? 1 : 0; X} X X Xint Xcxm_tuner_wait_for_lock( struct cxm_softc *sc ) X{ X unsigned int i; X X /* X * The data sheet states the maximum lock-in time X * is 150 ms using fast tuning ... unfortunately X * it doesn't state the maximum lock-in time using X * moderate tuning. Hopefully 300 ms is enough. X */ X X for (i = 0; i < 3; i++) { X X /* X * The frequency may have just change (prior to X * cxm_tuner_wait_for_lock) so start with the delay X * to give the tuner a chance to update it's status. X */ X X tsleep(&sc->iicbus, PZERO, "tuner", hz / 10); X X switch (cxm_tuner_is_locked(sc)) { X case 1: X return 1; X X case 0: X break; X X default: X return -1; X } X } X X printf("%s: tuner failed to lock\n", sc->name); X X return 0; X} X X Xint Xcxm_tuner_status( struct cxm_softc *sc ) X{ X unsigned char status; X X if (cxm_tuner_read(sc->iicbus, CXM_I2C_TUNER, &status, sizeof(status)) X != sizeof(status)) X return -1; X X return status; X} END-of-dev/cxm/cxm_tuner.c echo x - dev/cxm/cxm_video.c sed 's/^X//' >dev/cxm/cxm_video.c << 'END-of-dev/cxm/cxm_video.c' X/* X * Copyright (c) 2003, 2004 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Video decoder routines for the Conexant MPEG-2 Codec driver. X * X * Ideally these routines should be implemented as a separate X * driver which has a generic video decoder interface so that X * it's not necessary for each multimedia driver to re-invent X * the wheel. X */ X X#include X#include X#include X#include X#include X#include X X#if __FreeBSD_version >= 500014 X# include X#else X# include X#endif X X#include X#include X#include X#include X X#include X#include X X#include X X#include X#include X X#include "iicbb_if.h" X X Xstatic const struct cxm_saa7115_command Xsaa7115_init = { X 19, X { X /* Full auto mode for CVBS */ X { 0x01, 1, { 0x08 } }, X { 0x03, 18, { 0x20, 0x90, 0x90, 0xeb, 0xe0, 0xb0, 0x40, 0x80, X 0x44, 0x40, 0x00, 0x03, 0x2a, 0x06, 0x00, 0x9d, X 0x80, 0x01 } }, X { 0x17, 7, { 0x99, 0x40, 0x80, 0x77, 0x42, 0xa9, 0x01 } }, X X /* VBI data slicer (raw VBI data on lines 10 through 20) */ X { 0x40, 20, { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X 0x00, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, X 0xdd, 0xdd, 0xdd, 0xdd } }, X { 0x56, 4, { 0x00, 0x00, 0x00, 0x47 } }, X { 0x5c, 3, { 0x00, 0x1f, 0x35 } }, X X /* I-port and X-port configuration */ X { 0x80, 2, { 0x00, 0x01 } }, X { 0x83, 5, { 0x00, 0x20, 0x21, 0xc5, 0x01 } }, X X /* Scaler input configuration and output format settings */ X { 0xc0, 4, { 0x00, 0x08, 0x00, 0x80 } }, X X /* VBI scaler configuration */ X { 0x90, 4, { 0x00, 0x48, 0x00, 0x84 } }, X { 0xa0, 3, { 0x01, 0x00, 0x00 } }, X { 0xa4, 3, { 0x80, 0x40, 0x40 } }, X { 0xa8, 3, { 0x00, 0x02, 0x00 } }, X { 0xac, 3, { 0x00, 0x01, 0x00 } }, X { 0xb0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X { 0xb8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* Audio Master Clock to Audio Serial Clock ratio */ X { 0x38, 3, { 0x03, 0x10, 0x00 } }, X X /* PLL2 target clock 27 MHz (using a 32.11 MHz crystal) */ X { 0xf1, 4, { 0x05, 0xd0, 0x35, 0x00 } }, X X /* Pulse generator */ X { 0xf6, 10, { 0x61, 0x0e, 0x60, 0x0e, 0x60, 0x0e, 0x00, X 0x00, 0x00, 0x88 } } X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_mute = { X 1, X { X /* Disable I-port */ X { 0x87, 1, { 0x00 } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_unmute = { X 1, X { X /* Enable I-port */ X { 0x87, 1, { 0x01 } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_select_fm = { X 1, X { X /* Enable audio clock */ X { 0x88, 1, { 0x33 } } X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_select_line_in_composite = { X 3, X { X /* Amp plus anti-alias filter, CVBS from AI11 */ X { 0x02, 1, { 0xc0 } }, X /* Adaptive luminance comb filter */ X { 0x09, 1, { 0x40 } }, X X /* Enable AD1, audio clock, scaler, decoder */ X { 0x88, 1, { 0x70 } } X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_select_line_in_svideo = { X 3, X { X /* Amp plus anti-alias filter, Y / C from AI11 / AI21 */ X { 0x02, 1, { 0xc8 } }, X /* Bypass chrominance trap / comb filter */ X { 0x09, 1, { 0x80 } }, X X /* Enable AD1 & 2, audio clock, scaler, decoder */ X { 0x88, 1, { 0xf0 } } X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_select_tuner = { X 3, X { X /* Amp plus anti-alias filter, CVBS (auto gain) from AI23 */ X { 0x02, 1, { 0xc4 } }, X /* Adaptive luminance comb filter */ X { 0x09, 1, { 0x40 } }, X X /* Enable AD2, audio clock, scaler, decoder */ X { 0x88, 1, { 0xb0 } } X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_vcd_ntsc_double_lines = { X 15, X { X /* X * Input window = 720 x 240, output window = 352 x 240 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 5 and active video starting at line 23 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * NTSC active video should actually start at line 22, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x12, 0x00, 0xf2, 0x00, X 0x60, 0x01, 0xf0, 0x00 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x02, 0x02, 0xaa } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x18, 0x04, 0x00 } }, X { 0xdc, 3, { 0x0c, 0x02, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 12, output window = 1440 x 12. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x05, 0x00, 0x0c, 0x00, X 0xa0, 0x05, 0x0c, 0x00 } }, X X /* Inverted VGATE start at line 23, stop after line 263 */ X { 0x15, 2, { 0x02, 0x12 } }, X X /* VBI data slicer 525 lines, line 21 is closed caption */ X { 0x54, 2, { 0x4d, 0x00 } }, X { 0x5a, 2, { 0x06, 0x83 } }, X X /* PLL2 525 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xad } }, X X /* Pulse generator 525 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xad } }, X X /* Audio clock 44.1 kHz NTSC (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0xbc, 0xdf, 0x02 } }, X { 0x34, 3, { 0xf2, 0x00, 0x2d } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_vcd_pal_double_lines = { X 15, X { X /* X * Input window = 720 x 288, output window = 352 x 288 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 2 and active video starting at line 25 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * PAL active video should actually start at line 24, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x17, 0x00, 0x22, 0x01, X 0x60, 0x01, 0x20, 0x01 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x02, 0x02, 0xaa } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x18, 0x04, 0x00 } }, X { 0xdc, 3, { 0x0c, 0x02, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 17, output window = 1440 x 17. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x04, 0x00, 0x11, 0x00, X 0xa0, 0x05, 0x11, 0x00 } }, X X /* Inverted VGATE start at line 25, stop after line 313 */ X { 0x15, 2, { 0x37, 0x17 } }, X X /* VBI data slicer 625 lines, line 22 is closed caption */ X { 0x54, 2, { 0xdd, 0x4d } }, X { 0x5a, 2, { 0x03, 0x03 } }, X X /* PLL2 625 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xb0 } }, X X /* Pulse generator 625 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xb0 } }, X X /* Audio clock 44.1 kHz PAL (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0x00, 0x72, 0x03 } }, X { 0x34, 3, { 0xf2, 0x00, 0x2d } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_svcd_ntsc = { X 15, X { X /* X * Input window = 720 x 240, output window = 480 x 240 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 5 and active video starting at line 23 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * NTSC active video should actually start at line 22, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x12, 0x00, 0xf2, 0x00, X 0xe0, 0x01, 0xf0, 0x00 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x01, 0x00, 0x00 } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x00, 0x06, 0x00 } }, X { 0xdc, 3, { 0x00, 0x03, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 12, output window = 1440 x 12. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x05, 0x00, 0x0c, 0x00, X 0xa0, 0x05, 0x0c, 0x00 } }, X X /* Inverted VGATE start at line 23, stop after line 263 */ X { 0x15, 2, { 0x02, 0x12 } }, X X /* VBI data slicer 525 lines, line 21 is closed caption */ X { 0x54, 2, { 0x4d, 0x00 } }, X { 0x5a, 2, { 0x06, 0x83 } }, X X /* PLL2 525 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xad } }, X X /* Pulse generator 525 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xad } }, X X /* Audio clock 44.1 kHz NTSC (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0xbc, 0xdf, 0x02 } }, X { 0x34, 3, { 0xf2, 0x00, 0x2d } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_svcd_pal = { X 15, X { X /* X * Input window = 720 x 288, output window = 480 x 288 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 2 and active video starting at line 25 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * PAL active video should actually start at line 24, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x17, 0x00, 0x22, 0x01, X 0xe0, 0x01, 0x20, 0x01 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x01, 0x00, 0x00 } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x00, 0x06, 0x00 } }, X { 0xdc, 3, { 0x00, 0x03, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 17, output window = 1440 x 17. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x04, 0x00, 0x11, 0x00, X 0xa0, 0x05, 0x11, 0x00 } }, X X /* Inverted VGATE start at line 25, stop after line 313 */ X { 0x15, 2, { 0x37, 0x17 } }, X X /* VBI data slicer 625 lines, line 22 is closed caption */ X { 0x54, 2, { 0xdd, 0x4d } }, X { 0x5a, 2, { 0x03, 0x03 } }, X X /* PLL2 625 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xb0 } }, X X /* Pulse generator 625 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xb0 } }, X X /* Audio clock 44.1 kHz PAL (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0x00, 0x72, 0x03 } }, X { 0x34, 3, { 0xf2, 0x00, 0x2d } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_dvd_ntsc = { X 15, X { X /* X * Input window = 720 x 240, output window = 720 x 240 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 5 and active video starting at line 23 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * NTSC active video should actually start at line 22, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x12, 0x00, 0xf2, 0x00, X 0xd0, 0x02, 0xf0, 0x00 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x01, 0x00, 0x00 } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x00, 0x04, 0x00 } }, X { 0xdc, 3, { 0x00, 0x02, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 12, output window = 1440 x 12. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x05, 0x00, 0x0c, 0x00, X 0xa0, 0x05, 0x0c, 0x00 } }, X X /* Inverted VGATE start at line 23, stop after line 263 */ X { 0x15, 2, { 0x02, 0x12 } }, X X /* VBI data slicer 525 lines, line 21 is closed caption */ X { 0x54, 2, { 0x4d, 0x00 } }, X { 0x5a, 2, { 0x06, 0x83 } }, X X /* PLL2 525 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xad } }, X X /* Pulse generator 525 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xad } }, X X /* Audio clock 48 kHz NTSC (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0xcd, 0x20, 0x03 } }, X { 0x34, 3, { 0xce, 0xfb, 0x30 } }, X } X}; X Xstatic const struct cxm_saa7115_command Xsaa7115_scaler_dvd_pal = { X 15, X { X /* X * Input window = 720 x 288, output window = 720 x 288 with X * YS extended by 2 as per section 17.4 of the data sheet X * and YO accounting for scaler processing triggering at X * line 2 and active video starting at line 25 (see section X * 8.2 table 8 and section 8.3.1.1 table 11 of the data sheet). X * PAL active video should actually start at line 24, however X * not all channels / programs do. X */ X { 0xc4, 12, { 0x02, 0x00, 0xd0, 0x02, 0x17, 0x00, 0x22, 0x01, X 0xd0, 0x02, 0x20, 0x01 } }, X X /* Prefiltering and prescaling */ X { 0xd0, 3, { 0x01, 0x00, 0x00 } }, X X /* Brightness, contrast, and saturation */ X { 0xd4, 3, { 0x80, 0x40, 0x40 } }, X X /* Horizontal phase scaling */ X { 0xd8, 3, { 0x00, 0x04, 0x00 } }, X { 0xdc, 3, { 0x00, 0x02, 0x00 } }, X X /* Vertical scaling */ X { 0xe0, 5, { 0x00, 0x04, 0x00, 0x04, 0x00 } }, X X /* Vertical phase offsets */ X { 0xe8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}, X X /* X * VBI input window = 720 x 17, output window = 1440 x 17. X */ X { 0x94, 12, { 0x02, 0x00, 0xd0, 0x02, 0x04, 0x00, 0x11, 0x00, X 0xa0, 0x05, 0x11, 0x00 } }, X X /* Inverted VGATE start at line 25, stop after line 313 */ X { 0x15, 2, { 0x37, 0x17 } }, X X /* VBI data slicer 625 lines, line 22 is closed caption */ X { 0x54, 2, { 0xdd, 0x4d } }, X { 0x5a, 2, { 0x03, 0x03 } }, X X /* PLL2 625 lines, 27 Mhz target clock */ X { 0xf0, 1, { 0xb0 } }, X X /* Pulse generator 625 lines, 27 Mhz target clock */ X { 0xf5, 1, { 0xb0 } }, X X /* Audio clock 48 kHz PAL (using a 32.11 MHz crystal) */ X { 0x30, 3, { 0x00, 0xc0, 0x03 } }, X { 0x34, 3, { 0xce, 0xfb, 0x30 } }, X } X}; X Xstatic const struct cxm_saa7115_scaling Xsaa7115_scalings[] = { X { 352, 480, &saa7115_scaler_vcd_ntsc_double_lines }, X { 352, 576, &saa7115_scaler_vcd_pal_double_lines }, X { 480, 480, &saa7115_scaler_svcd_ntsc }, X { 480, 576, &saa7115_scaler_svcd_pal }, X { 720, 480, &saa7115_scaler_dvd_ntsc }, X { 720, 576, &saa7115_scaler_dvd_pal } X}; X X/* Reset the SAA7115 chip */ Xstatic int Xcxm_saa7115_reset( device_t iicbus, int i2c_addr ) X{ X unsigned char msg[2]; X int sent; X X /* put into reset mode */ X msg[0] = 0x88; X msg[1] = 0x0b; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X iicbus_stop(iicbus); X X /* put back to operational mode */ X msg[0] = 0x88; X msg[1] = 0x2b; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X iicbus_stop(iicbus); X X return 0; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X X/* Read from the SAA7115 registers */ Xstatic int Xcxm_saa7115_read( device_t iicbus, int i2c_addr, X unsigned char addr, char *buf, int len ) X{ X unsigned char msg[1]; X int received; X int sent; X X msg[0] = addr; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X if (iicbus_repeated_start(iicbus, i2c_addr + 1, CXM_I2C_TIMEOUT) != 0) X goto fail; X X if (iicbus_read(iicbus, buf, len, &received, IIC_LAST_READ, 0) != 0) X goto fail; X X iicbus_stop(iicbus); X X return received; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X X/* Write to the SAA7115 registers */ Xstatic int Xcxm_saa7115_write( device_t iicbus, int i2c_addr, X unsigned char addr, const char *buf, int len ) X{ X unsigned char msg[1]; X int sent; X X msg[0] = addr; X X if (iicbus_start(iicbus, i2c_addr, CXM_I2C_TIMEOUT) != 0) X return -1; X X if (iicbus_write(iicbus, msg, sizeof(msg), &sent, CXM_I2C_TIMEOUT) != 0 X || sent != sizeof(msg)) X goto fail; X X if (iicbus_write(iicbus, buf, len, &sent, CXM_I2C_TIMEOUT) != 0) X goto fail; X X iicbus_stop(iicbus); X X return sent; X Xfail: X iicbus_stop(iicbus); X return -1; X} X X Xint Xcxm_saa7115_init( struct cxm_softc *sc ) X{ X unsigned char rev[1]; X unsigned int i; X unsigned int nsettings; X const struct cxm_saa7115_setting *settings; X X if (cxm_saa7115_reset (sc->iicbus, CXM_I2C_SAA7115) < 0) X return -1; X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x00, X rev, sizeof(rev)) != sizeof(rev)) X return -1; X X nsettings = saa7115_init.nsettings; X settings = saa7115_init.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, X settings[i].addr, X settings[i].values, settings[i].nvalues) X != settings[i].nvalues) X return -1; X X if (cxm_saa7115_select_source(sc, cxm_tuner_source) < 0) X return -1; X X printf("%s: SAA7115 rev %u video decoder\n", X sc->name, (unsigned int)rev[0] >> 4); X X return 0; X} X X Xint Xcxm_saa7115_mute( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_saa7115_setting *settings; X X nsettings = saa7115_mute.nsettings; X settings = saa7115_mute.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, X settings[i].addr, X settings[i].values, settings[i].nvalues) X != settings[i].nvalues) X return -1; X X return 0; X} X X Xint Xcxm_saa7115_unmute( struct cxm_softc *sc ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_saa7115_setting *settings; X X nsettings = saa7115_unmute.nsettings; X settings = saa7115_unmute.settings; X X for (i = 0; i < nsettings; i++) X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, X settings[i].addr, X settings[i].values, settings[i].nvalues) X != settings[i].nvalues) X return -1; X X return 0; X} X X Xint Xcxm_saa7115_select_source( struct cxm_softc *sc, enum cxm_source source ) X{ X unsigned int i; X unsigned int nsettings; X const struct cxm_saa7115_setting *settings; X X switch (source) { X case cxm_fm_source: X nsettings = saa7115_select_fm.nsettings; X settings = saa7115_select_fm.settings; X break; X X case cxm_line_in_source_composite: X nsettings = saa7115_select_line_in_composite.nsettings; X settings = saa7115_select_line_in_composite.settings; X break; X X case cxm_line_in_source_svideo: X nsettings = saa7115_select_line_in_svideo.nsettings; X settings = saa7115_select_line_in_svideo.settings; X break; X X case cxm_tuner_source: X nsettings = saa7115_select_tuner.nsettings; X settings = saa7115_select_tuner.settings; X break; X X default: X return -1; X } X X for (i = 0; i < nsettings; i++) X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, X settings[i].addr, X settings[i].values, settings[i].nvalues) X != settings[i].nvalues) X return -1; X X return 0; X} X X Xint Xcxm_saa7115_configure_scaler( struct cxm_softc *sc, X unsigned int width, unsigned int height ) X{ X unsigned char power[1]; X unsigned char task[1]; X unsigned int i; X unsigned int nsettings; X const struct cxm_saa7115_setting *settings; X X for (i = 0; NUM_ELEMENTS(saa7115_scalings); i++) X if (saa7115_scalings[i].width == width X && saa7115_scalings[i].height == height) X break; X X if (i >= NUM_ELEMENTS(saa7115_scalings)) X return -1; X X nsettings = saa7115_scalings[i].scaling->nsettings; X settings = saa7115_scalings[i].scaling->settings; X X /* X * Reset scaler. X */ X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x88, X power, sizeof(power)) != sizeof(power)) X return -1; X X power[0] &= ~0x20; X X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, 0x88, X power, sizeof(power)) != sizeof(power)) X return -1; X X /* X * Configure scaler. X */ X X for (i = 0; i < nsettings; i++) X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, X settings[i].addr, X settings[i].values, settings[i].nvalues) X != settings[i].nvalues) X return -1; X X /* X * Enable task register set A and B. X */ X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x80, X task, sizeof(task)) != sizeof(task)) X return -1; X X task[0] |= 0x30; X X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, 0x80, X task, sizeof(task)) != sizeof(task)) X return -1; X X /* X * Enable scaler. X */ X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x88, X power, sizeof(power)) != sizeof(power)) X return -1; X X power[0] |= 0x20; X X if (cxm_saa7115_write(sc->iicbus, CXM_I2C_SAA7115, 0x88, X power, sizeof(power)) != sizeof(power)) X return -1; X X return 0; X} X X Xenum cxm_source_format Xcxm_saa7115_detected_format( struct cxm_softc *sc ) X{ X unsigned char status[2]; X enum cxm_source_format source_format; X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x1e, X status, sizeof(status)) != sizeof(status)) X return cxm_unknown_source_format; X X if (! (status[1] & 0x01) ) { X printf("%s: video decoder isn't locked\n", sc->name); X return cxm_unknown_source_format; X } X X source_format = cxm_unknown_source_format; X X if (! (status[1] & 0x20) ) X switch (status[0] & 0x03) { X case 0: X source_format = cxm_bw_50hz_source_format; X break; X X case 1: X source_format = cxm_ntsc_50hz_source_format; X break; X X case 2: X source_format = cxm_pal_50hz_source_format; X break; X X case 3: X source_format = cxm_secam_50hz_source_format; X break; X X default: X break; X } X else X switch (status[0] & 0x03) { X case 0: X source_format = cxm_bw_60hz_source_format; X break; X X case 1: X source_format = cxm_ntsc_60hz_source_format; X break; X X case 2: X source_format = cxm_pal_60hz_source_format; X break; X X default: X break; X } X X return source_format; X} X X Xint Xcxm_saa7115_detected_fps( struct cxm_softc *sc ) X{ X unsigned char status[1]; X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x1f, X status, sizeof(status)) != sizeof(status)) X return -1; X X if (! (status[0] & 0x01) ) { X printf("%s: video decoder isn't locked\n", sc->name); X return -1; X } X X return (status[0] & 0x20) ? 30 : 25; X} X X Xint Xcxm_saa7115_is_locked( struct cxm_softc *sc ) X{ X unsigned char status[1]; X X if (cxm_saa7115_read(sc->iicbus, CXM_I2C_SAA7115, 0x1f, X status, sizeof(status)) != sizeof(status)) X return -1; X X return (status[0] & 0x01) ? 1 : 0; X} X X Xint Xcxm_saa7115_wait_for_lock( struct cxm_softc *sc ) X{ X unsigned int i; X X /* X * Section 2.7 of the data sheet states: X * X * Ultra-fast frame lock (almost 1 field) X * X * so hopefully 300 ms is enough (the lock X * sometimes takes a long time to occur ... X * possibly due to the time it takes to X * autodetect the format). X */ X X for (i = 0; i < 6; i++) { X X /* X * The input may have just change (prior to X * cxm_saa7115_wait_for_lock) so start with X * the delay to give the video decoder a X * chance to update it's status. X */ X X tsleep(&sc->iicbus, PZERO, "video", hz / 20 ); X X switch (cxm_saa7115_is_locked(sc)) { X case 1: X return 1; X X case 0: X break; X X default: X return -1; X } X } X X printf("%s: video decoder failed to lock\n", sc->name); X X return 0; X} END-of-dev/cxm/cxm_video.c echo x - dev/cxm/cxm_extract_fw.c sed 's/^X//' >dev/cxm/cxm_extract_fw.c << 'END-of-dev/cxm/cxm_extract_fw.c' X/* X * Copyright (c) 2003 X * John Wehle . All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by John Wehle. X * 4. The name of the author may not be used to endorse or promote products X * derived from this software without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE X * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, X * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES X * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR X * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, X * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN X * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE X * POSSIBILITY OF SUCH DAMAGE. X */ X X/* X * Conexant MPEG-2 Codec firmware extraction program. X * X * Generates cxm_dec_fw.c and cxm_enc_fw.c from the X * Hauppauge PVR-250 / PVR-350 Microsoft Windows driver X * (i.e. hcwpvrp2.sys). X * X * This was written using the invaluable information X * compiled by The IvyTV Project (ivtv.sourceforge.net). X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X Xconst char *MyName = "cxm_extract_fw"; X Xconst u_int8_t decoder_magic[] = { X 0xa7, 0x03, 0x00, 0x00, 0x66, 0xbb, 0x55, 0xaa }; Xconst u_int8_t encoder_magic[] = { X 0xa7, 0x0d, 0x00, 0x00, 0x66, 0xbb, 0x55, 0xaa }; X X Xstatic int Xsave_firmware (const char *name, const u_int8_t *buf, size_t nbytes) X { X FILE *ofp; X char outfile[MAXPATHLEN]; X size_t i; X X if (nbytes < (256 * 1024)) { X fprintf (stderr, "%s: save_firmware -- firmware image isn't long enough\n", X MyName); X return -1; X } X X if (snprintf (outfile, sizeof (outfile), "%s.c", name) >= sizeof (outfile)) { X fprintf (stderr, "%s: save_firmware -- firmware name is too long\n", X MyName); X return -1; X } X X if (! (ofp = fopen (outfile, "w")) ) { X fprintf (stderr, "%s: save_firmware -- can't open output file <%s>\n", X MyName, outfile); X perror (MyName); X return -1; X } X X fprintf (ofp, "#include \n" X "\n" X "const u_int8_t %s[] __attribute__ ((aligned(4))) = {", X name); X X for (i = 0; i < (256 * 1024); i++) { X if (i) X fputc (',', ofp); X if ((i % 8) == 0) X fputs ("\n\t", ofp); X else X fputc (' ', ofp); X fprintf (ofp, "0x%.2x", buf[i]); X } X X fprintf (ofp, "\n};\n"); X X if (ferror (ofp)) { X fclose (ofp); X return -1; X } X X fclose (ofp); X return 0; X } X X Xint Xmain (int argc, char **argv) X { X const char *infile; X const u_int8_t *end; X const u_int8_t *ptr; X const u_int8_t *start; X int decoder_fw_saved; X int encoder_fw_saved; X int fd; X struct stat statbuf; X X if (argc != 2) { X fprintf (stderr, "Usage: %s \n", MyName); X exit (1); X } X X infile = argv[1]; X X /* X * Open the file. X */ X X if ((fd = open (infile, O_RDONLY)) < 0) { X fprintf (stderr, "%s: can't open %s for reading\n", MyName, infile); X perror (MyName); X exit (1); X } X X /* X * Determine how big it is. X */ X X if (fstat (fd, &statbuf) < 0) { X fprintf (stderr, "%s: can't fstat %s\n", MyName, infile); X perror (MyName); X close (fd); X exit (1); X } X X /* X * Map it into memory. X */ X X if ( !(start = (u_int8_t *)mmap (NULL, (size_t)statbuf.st_size, X PROT_READ, MAP_SHARED, fd, (off_t)0)) ) { X fprintf (stderr, "%s: can't mmap %s\n", MyName, infile); X perror (MyName); X close (fd); X exit (1); X } X X end = start + statbuf.st_size; X X close (fd); X X decoder_fw_saved = 0; X encoder_fw_saved = 0; X X for (ptr = start; ptr != end; ptr++) { X if ((end - ptr) >= sizeof (decoder_magic) X && memcmp (ptr, decoder_magic, sizeof (decoder_magic)) == 0) X if (! decoder_fw_saved) { X if (save_firmware ("cxm_dec_fw", ptr, end - ptr) < 0) { X fprintf (stderr, "%s: save_firmware failed\n", MyName); X exit (1); X } X decoder_fw_saved = 1; X } X else { X fprintf (stderr, "%s: multiple decoder images present\n", MyName); X exit (1); X } X X if ((end - ptr) >= sizeof (encoder_magic) X && memcmp (ptr, encoder_magic, sizeof (encoder_magic)) == 0) X if (! encoder_fw_saved) { X if (save_firmware ("cxm_enc_fw", ptr, end - ptr) < 0) { X fprintf (stderr, "%s: save_firmware failed\n", MyName); X exit (1); X } X encoder_fw_saved = 1; X } X else { X fprintf (stderr, "%s: multiple encoder images present\n", MyName); X exit (1); X } X } X X munmap ((caddr_t)start, (size_t)statbuf.st_size); X X if (! decoder_fw_saved) X fprintf (stderr, "%s: decoder image not present\n", MyName); X X if (! encoder_fw_saved) X fprintf (stderr, "%s: encoder image not present\n", MyName); X X if (! decoder_fw_saved || ! encoder_fw_saved) X exit (1); X X exit (0); X } END-of-dev/cxm/cxm_extract_fw.c echo c - modules/cxm mkdir -p modules/cxm > /dev/null 2>&1 echo x - modules/cxm/Makefile sed 's/^X//' >modules/cxm/Makefile << 'END-of-modules/cxm/Makefile' XSUBDIR = XSUBDIR += cxm XSUBDIR += cxm_iic X X.include END-of-modules/cxm/Makefile echo c - modules/cxm/cxm mkdir -p modules/cxm/cxm > /dev/null 2>&1 echo x - modules/cxm/cxm/Makefile sed 's/^X//' >modules/cxm/cxm/Makefile << 'END-of-modules/cxm/cxm/Makefile' X.PATH: ${.CURDIR}/../../../dev/cxm XKMOD = cxm XSRCS = cxm.c cxm.h cxm_dec_fw.c cxm_enc_fw.c cxm_audio.c cxm_eeprom.c \ X cxm_ir.c cxm_tuner.c cxm_video.c opt_cxm.h \ X bus_if.h device_if.h iicbb_if.h pci_if.h vnode_if.h X X.include END-of-modules/cxm/cxm/Makefile echo c - modules/cxm/cxm_iic mkdir -p modules/cxm/cxm_iic > /dev/null 2>&1 echo x - modules/cxm/cxm_iic/Makefile sed 's/^X//' >modules/cxm/cxm_iic/Makefile << 'END-of-modules/cxm/cxm_iic/Makefile' X.PATH: ${.CURDIR}/../../../dev/cxm XKMOD = cxm_iic XSRCS = cxm_i2c.c cxm.h \ X opt_cxm.h bus_if.h device_if.h iicbb_if.h pci_if.h X X.include END-of-modules/cxm/cxm_iic/Makefile exit ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | ------------------------------------------------------------------------- From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 11:23:19 2004 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 40F2F16A4CE for ; Sat, 31 Jan 2004 11:23:19 -0800 (PST) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1C2043D54 for ; Sat, 31 Jan 2004 11:23:17 -0800 (PST) (envelope-from john@feith.com) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.12.10+Sun/8.12.9) with ESMTP id i0VJMOAL021926; Sat, 31 Jan 2004 14:22:24 -0500 (EST) Received: (from john@localhost) by jwlab.FEITH.COM (8.11.7+Sun/8.11.7) id i0VJL0028112; Sat, 31 Jan 2004 14:21:00 -0500 (EST) Date: Sat, 31 Jan 2004 14:21:00 -0500 (EST) From: John Wehle Message-Id: <200401311921.i0VJL0028112@jwlab.FEITH.COM> To: rclancey-freebsd-multimedia@dfmm.org Content-Type: text X-Scanned-By: MIMEDefang 2.39 X-Archived: cashew.FEITH.COM cc: multimedia@freebsd.org Subject: Re: FreeBSD 4.9 Hauppauge PVR-250 / 350 Driver Patch (Jan 25, 2004) 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: Sat, 31 Jan 2004 19:23:19 -0000 > mplayer -tv driver=bsdbt848:channel=28:device=/dev/bktr0 /dev/bktr0 It's not really a bt848 so various pieces of software unfortunately don't work correctly with it. Only a subset of the ioctls are supported and there's only one device node (/dev/tuner0 isn't supported ... all access / ioctls go through /dev/bktr0 ... on my system I have tuner0 linked to bktr0). However, it should be a easy task to write a cxm driver for mplayer. > #!/usr/bin/perl > ... Yep ... I see the same error here using your perl script. > have any tips? I use the enclosed program. -- John -------------8<-----------------------------8<----------------------- #include #include #include #include #include #include /****************************************************************************/ /* setchannel.c - Set the channel of the bktr tuner card. */ /* */ /* COMPILE WITH: cc -o setchannel setchannel.c */ /****************************************************************************/ static void usage() { printf("Usage: setchannel <-c|-s|-t|-t channel|channel>\n" " -c Select composite input.\n" " -s Select svideo input.\n" " -t Select tuner.\n"); } int main( int argc, char *argv[] ) { int c; int status; int tfd; unsigned int channel; unsigned long device; channel = 0; device = 0; status = 0; while ((c = getopt (argc, argv, "cst")) != -1) switch (c) { case 'c': device = METEOR_INPUT_DEV2; break; case 's': device = METEOR_INPUT_DEV_SVIDEO; break; case 't': device = METEOR_INPUT_DEV1; break; default: usage (); exit (1); } if ( optind < argc) channel = atoi( argv[optind] ); if (! channel && ! device) { usage (); exit (1); } tfd = open( "/dev/bktr0", O_RDONLY ); if ( tfd < 0 ) { perror( "open() of /dev/bktr0 failed." ); exit(1); } if (device) if ( ioctl( tfd, METEORSINPUT, &device ) < 0 ) { perror( "ioctl( tfd, METEORSINPUT ) failed." ); status = 1; } if (channel) if ( ioctl( tfd, TVTUNER_SETCHNL, &channel ) < 0 ) { perror( "ioctl( tfd, TVTUNER_SETCHNL ) failed." ); status = 1; } close ( tfd ); exit ( status ); } ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | ------------------------------------------------------------------------- From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 11:36:05 2004 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 7EA7F16A4CE for ; Sat, 31 Jan 2004 11:36:05 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F7D143D1D for ; Sat, 31 Jan 2004 11:36:04 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id 9EA1740823; Sat, 31 Jan 2004 20:35:25 +0100 (CET) From: Cordula's Web To: julian@elischer.org In-reply-to: (message from Julian Elischer on Sat, 31 Jan 2004 08:47:38 -0800 (PST)) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: Message-Id: <20040131193525.9EA1740823@fw.farid-hajji.net> Date: Sat, 31 Jan 2004 20:35:25 +0100 (CET) cc: freebsd-multimedia@freebsd.org Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 19:36:05 -0000 > > > in an attempt to save power on FreeBSD servers, I'm > > > trying to replace the hdd with a ramdisk. The idea is to: > > > > As for powering down the hdd I did find a page for this, > > but havent had time to play with it yet: > > http://www.cran.org.uk/bruce/software.php > > there is a port "ataidle" that sets teh IDE drive's internal idle > timeout timer so it will spin down if you dont use it.. Yes, thank you. ataidle works like a charm. > as for scsi, you can sent it a spin-down command with camcontrol but I > forget the actual command.. > (it should be in the scsi .h files) # camcontrol stop da0 # camcontrol start da0 works for me. Now, all I need would be a syscall to switch the kernel's notion of the root device. Or is there a way to umount root, and remount it on the md drive? -- Cordula's Web. http://www.cordula.ws/ From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 15:27:14 2004 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 22EC716A4CF for ; Sat, 31 Jan 2004 15:27:14 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FC4043D64 for ; Sat, 31 Jan 2004 15:26:59 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <2004013123265801300ctk4ee>; Sat, 31 Jan 2004 23:26:58 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA47391; Sat, 31 Jan 2004 15:26:56 -0800 (PST) Date: Sat, 31 Jan 2004 15:26:54 -0800 (PST) From: Julian Elischer To: "Cordula's Web" In-Reply-To: <20040131193525.9EA1740823@fw.farid-hajji.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-multimedia@freebsd.org Subject: Re: Transferring the root filesystem to a ramdisk? 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: Sat, 31 Jan 2004 23:27:14 -0000 you could mount the replacement root device on '/' alternatively you could make init do the chroot (you have source no? :-) On Sat, 31 Jan 2004, Cordula's Web wrote: > > > > in an attempt to save power on FreeBSD servers, I'm > > > > trying to replace the hdd with a ramdisk. The idea is to: > > > > > > As for powering down the hdd I did find a page for this, > > > but havent had time to play with it yet: > > > http://www.cran.org.uk/bruce/software.php > > > > there is a port "ataidle" that sets teh IDE drive's internal idle > > timeout timer so it will spin down if you dont use it.. > > Yes, thank you. ataidle works like a charm. > > > as for scsi, you can sent it a spin-down command with camcontrol but I > > forget the actual command.. > > (it should be in the scsi .h files) > > # camcontrol stop da0 > # camcontrol start da0 > works for me. > > Now, all I need would be a syscall to switch the kernel's notion > of the root device. > > Or is there a way to umount root, and remount it on the md drive? > > -- > Cordula's Web. http://www.cordula.ws/ > > From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 15:45:36 2004 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 D78AC16A4CE for ; Sat, 31 Jan 2004 15:45:36 -0800 (PST) Received: from hak.cnd.mcgill.ca (hak.cnd.mcgill.ca [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 309C843D3F for ; Sat, 31 Jan 2004 15:45:35 -0800 (PST) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.9/8.12.8) with ESMTP id i0VNfgpq056234; Sat, 31 Jan 2004 18:41:42 -0500 (EST) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.9/8.12.8/Submit) id i0VNfg6Q056233; Sat, 31 Jan 2004 18:41:42 -0500 (EST) Date: Sat, 31 Jan 2004 18:41:42 -0500 From: Mathew Kanner To: Bjorn Eikeland Message-ID: <20040131234142.GA54460@cnd.mcgill.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Organization: I speak for myself, operating in Montreal, CANADA X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.62 X-Spam-Checker-Version: SpamAssassin 2.62 (2004-01-11) on hak.cnd.mcgill.ca cc: freebsd-multimedia@freebsd.org Subject: Re: two soundcards - one works 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: Sat, 31 Jan 2004 23:45:37 -0000 On Jan 31, Bjorn Eikeland wrote: > I'm fairly new to FreeBSD, and I'm trying to set it up to replace windows, > only bits left is sound, video and tv-out. > > I've got two soundcards, one onboard AC'97 (on a asus A7V8X w/KT400) and a > pci soundblaster 128 card. I've been using the pci card sending sound to > the living room, (music & movies) and the onboard for everything else. > > At first sound didnt work at all, but reading the handbook got one card > working, and I've looked through the mailing list archives and google - > couldnt fint anything on how to get the other working. (I havent tried the > options PNPBIOS yet, as I want to keep the generic kernel till I'm done > setting evrything up, and besides dmesg show the pci device so its a > driver issue isnt it?) > > Below you can find various outputs form dmesg, kldstat and /dev. If anyone > needs more details to help please ask. Hello Bjorn, I have to keep this short as I'm on a slow link. Please tell us what version of FreeBSD you are using and forward the output of pciconf -v. --Mat -- Applicants must also have extensive knowledge of UNIX, although they should have sufficiently good programming taste to not consider this an achievement. - MIT AI Lab job ad in the /Boston Globe/ From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 16:10:32 2004 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 542FE16A4CE for ; Sat, 31 Jan 2004 16:10:32 -0800 (PST) Received: from mail.valuehost.co.uk (mail.valuehost.co.uk [62.25.99.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 24CCB43D1F for ; Sat, 31 Jan 2004 16:10:30 -0800 (PST) (envelope-from bjorn@eikeland.info) Received: (qmail 23659 invoked by uid 89); 1 Feb 2004 00:10:14 +0000 Received: from unknown (HELO beer.eikeland.info) (bjorn@eikeland.info@80.202.106.8) by mail.valuehost.co.uk with SMTP; 1 Feb 2004 00:10:14 +0000 Date: Sun, 01 Feb 2004 01:10:33 +0100 To: Mathew Kanner References: <20040131234142.GA54460@cnd.mcgill.ca> From: Bjorn Eikeland Content-Type: text/plain; format=flowed; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <20040131234142.GA54460@cnd.mcgill.ca> User-Agent: Opera7.23/FreeBSD M2 build 518 cc: "freebsd-multimedia@freebsd.org" Subject: Re: two soundcards - one works [solved] 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, 01 Feb 2004 00:10:32 -0000 > On Jan 31, Bjorn Eikeland wrote: >> I'm fairly new to FreeBSD, and I'm trying to set it up to replace >> windows, >> only bits left is sound, video and tv-out. >> >> I've got two soundcards, one onboard AC'97 (on a asus A7V8X w/KT400) >> and a >> pci soundblaster 128 card. I've been using the pci card sending sound to >> the living room, (music & movies) and the onboard for everything else. >> >> At first sound didnt work at all, but reading the handbook got one card >> working, and I've looked through the mailing list archives and google - >> couldnt fint anything on how to get the other working. (I havent tried >> the >> options PNPBIOS yet, as I want to keep the generic kernel till I'm done >> setting evrything up, and besides dmesg show the pci device so its a >> driver issue isnt it?) >> >> Below you can find various outputs form dmesg, kldstat and /dev. If >> anyone >> needs more details to help please ask. > > Hello Bjorn, > I have to keep this short as I'm on a slow link. Please tell > us what version of FreeBSD you are using and forward the output of > pciconf -v. > > --Mat Sorry, using 5.2 Release. Well, it seems that was all needed, pciconf -lv showed the onboard card to be a VT8233/33A AC97 Enhanced Audio Controller, and after kldload snd_via8233.ko it's suddenly pcm1! Even plays mp3's through mpg123 -a /dev/pcm1.0 :) Just out of curiosity, does anyone know why kldload snd_driver.ko only loaded the one driver? Thanks a lot! Bjorn (And sorry for the cross postings before list!) From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 31 20:33:32 2004 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 A864016A4CE for ; Sat, 31 Jan 2004 20:33:32 -0800 (PST) Received: from praetor.linc-it.com (adsl-068-157-070-217.sip.jan.bellsouth.net [68.157.70.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E7A643D2D for ; Sat, 31 Jan 2004 20:33:31 -0800 (PST) (envelope-from fullermd@over-yonder.net) Received: from mortis.over-yonder.net (adsl-33-227-172.jan.bellsouth.net [67.33.227.172]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by praetor.linc-it.com (Postfix) with ESMTP id D509F155E0; Sat, 31 Jan 2004 22:33:29 -0600 (CST) Received: by mortis.over-yonder.net (Postfix, from userid 100) id 9EB3A20F94; Sat, 31 Jan 2004 22:33:27 -0600 (CST) Date: Sat, 31 Jan 2004 22:33:27 -0600 From: "Matthew D. Fuller" To: "M.G.Kishalmi" Message-ID: <20040201043327.GA68129@over-yonder.net> References: <200401301736.i0UHaErd001905@tm.kishalmi.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401301736.i0UHaErd001905@tm.kishalmi.net> User-Agent: Mutt/1.4.1i-fullermd.1 X-Editor: vi X-OS: FreeBSD cc: multimedia@freebsd.org Subject: Re: libvorbis.so.3 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, 01 Feb 2004 04:33:32 -0000 On Fri, Jan 30, 2004 at 06:36:14PM +0100 I heard the voice of M.G.Kishalmi, and lo! it spake thus: > > hey robert, > > i remember a similar issue.. > > as you can see the libvorbis-port does not create the .so.3 link for > you: That's because it's not supposed to. It's not installing verison 3 of the shared library, it's installing version 4. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ "The only reason I'm burning my candle at both ends, is because I haven't figured out how to light the middle yet" From owner-freebsd-multimedia@FreeBSD.ORG Sun Feb 1 03:28:29 2004 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 459AC16A4CE for ; Sun, 1 Feb 2004 03:28:29 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8341843D2F for ; Sun, 1 Feb 2004 03:28:26 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id 7785640826; Sun, 1 Feb 2004 12:27:47 +0100 (CET) From: Cordula's Web To: julian@elischer.org In-reply-to: (message from Julian Elischer on Sat, 31 Jan 2004 15:26:54 -0800 (PST)) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: Message-Id: <20040201112747.7785640826@fw.farid-hajji.net> Date: Sun, 1 Feb 2004 12:27:47 +0100 (CET) cc: freebsd-multimedia@freebsd.org Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 11:28:29 -0000 > > Now, all I need would be a syscall to switch the kernel's notion > > of the root device. > > > > Or is there a way to umount root, and remount it on the md drive? > > you could mount the replacement root device on '/' > > alternatively you could make init do the chroot (you have source no? :-) chroot()ing init looks like a good idea, but: 1. Isn't /sbin/init itself mmap()ed to the physical device which I'd like to turn off later? 2. Other processes, forked earlier from init will also be mmap()ed to the physical device, so they'll have to die? 1. means that chroot() can only happen before /sbin/init is created, somewhere around /usr/src/sys/kern/init_main.c:mi_startup() 2. means that all these processes will die, when the device is turned off. I'm not a kernel hacker, so the following is just a guess: * A new syscall foo(device_t) is needed. * foo() manipulates the vnode for "/", effectively mounting the memory device. * foo() creates a new process 1, but doesn't switch to it yet * foo() loads process 1 from /sbin/init, which is now on the memory device. * foo() removes all old processes (including the old init process) from the process table, cleans up vm etc... * foo() starts (the new) init process, effectively rebooting with a new root. That's way above and beyond my modest understanding of the kernel. It may be an easy task for kernel gurus though... Thanks, -cpghost. -- Cordula's Web. http://www.cordula.ws/ From owner-freebsd-multimedia@FreeBSD.ORG Sun Feb 1 23:45:30 2004 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 31E4916A4CE for ; Sun, 1 Feb 2004 23:45:30 -0800 (PST) Received: from ftp.ccrle.nec.de (ftp.netlab.nec.de [195.37.70.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3D2C43D41 for ; Sun, 1 Feb 2004 23:45:27 -0800 (PST) (envelope-from lars.eggert@netlab.nec.de) Received: from netlab.nec.de (tokyo.netlab.nec.de [195.37.70.2]) by ftp.ccrle.nec.de (Postfix) with ESMTP id 064E2F5A9; Mon, 2 Feb 2004 08:50:08 +0100 (CET) Message-ID: <401E000F.4050609@netlab.nec.de> Date: Mon, 02 Feb 2004 08:45:19 +0100 From: Lars Eggert Organization: NEC Network Laboratories User-Agent: Mozilla Thunderbird 0.5a (Macintosh/20040126) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stacy Millions References: <401B3B65.50807@millions.ca> In-Reply-To: <401B3B65.50807@millions.ca> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020702090105030403080703" cc: freebsd-multimedia@freebsd.org cc: Mark Linimon Subject: Re: freevo port 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: Mon, 02 Feb 2004 07:45:30 -0000 This is a cryptographically signed message in MIME format. --------------ms020702090105030403080703 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Stacy, glad to hear that you it is at least mildly useful. I should have my freevo hardware back in a week or so, and will then resume hacking on the port (1.5 is around the corner). Would you mind sending this information as an update to the PR log? The committer looking into the port (linimon@) had some issues installing it, but I have gotten reports from several people that installed if with no problems. (Mark: Maybe this is a -current vs. -stable issue?) Lars Stacy Millions wrote: > I took a shot at the freevo port to see if I could get it to work > my pvr350. This is on STABLE. I had two issues building the port: > > 1) I had to install xmltv by hand, x11-toolkits/p5-Tk-TableMatrix > doesn't build any more. It is optional for xmltv, but a dependancy > for the port version. > > 2) sysutils/stat should be a dependancy, freevo won't run without it. > > The TV/VCR features don't work with new PVR[23]50 driver. The problem is > some unsupported ioctl's that mplayer/mencoder -tv use. I'm not sure > that you would want to use mencoder any way since the pvr[23]50 gives > you an mpeg2 stream native... > > the web interface does not work either. This is an abridged version > of what I get on the browser: > web.Server Traceback (most recent call last): > exceptions.AttributeError: 'module' object has no attribute 'statvfs' > > I don't know how many of freevo's features are actually supposed > to work, the web interface is documented (in the config file) as > being experimental. > > So far, freevo will play existing media files and play from > the dvd-rom. I can browse the TV listings and schedule recordings > and I hope with a bit of creative hacking to actually get it > to record from my pvr350. > > -stacy > -- Lars Eggert NEC Network Laboratories --------------ms020702090105030403080703 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJ/zCC Az8wggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQI EwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENv bnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAi BgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVy c29uYWwtZnJlZW1haWxAdGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5 NTlaMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBM dGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzAN BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9Vvy Gna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7dyfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOC dz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCB kTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwudGhh d3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3JsMAsGA1UdDwQEAwIBBjApBgNV HREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgwDQYJKoZIhvcNAQEFBQAD gYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A9BxQIJNwPP2t4WFi w9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYITq726jTlEBpb NU1341YheILcIRk13iSx0x1G/11fZU8wggNaMIICw6ADAgECAgMLU6IwDQYJKoZIhvcNAQEE BQAwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0 ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTAz MTIxNTEyMzEyOFoXDTA0MTIxNDEyMzEyOFowgYQxDzANBgNVBAQTBkVnZ2VydDENMAsGA1UE KhMETGFyczEUMBIGA1UEAxMLTGFycyBFZ2dlcnQxKDAmBgkqhkiG9w0BCQEWGWxhcnMuZWdn ZXJ0QG5ldGxhYi5uZWMuZGUxIjAgBgkqhkiG9w0BCQEWE2xhcnMuZWdnZXJ0QGdteC5uZXQw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWps58Zq8Buu2DKDl9crbvzSo6zWsZ TkQLr5zOTqUMs/eU7Mcohv64O4IxWWYGLfYsjDRxUlmdHdJUbyTtUh2lH452DUDJByXidlLm RDgohG0AVwztedqy1+hE3VnCdpMhUGks+6ntrr3dKSxMgLM0AM1kPWsH9lWX6IOPdxOC30gM PiQ65zH9PR70befQLgFPKcAv0wP8210l05n8ekwYAcq2cm3/j+nuDu0HEh5pgsnY7cVELeNJ ODvr4IiE1t3c2w4+0Nc/WJrqGCMl+gZ8c+7FtzjoyDeEsCjNFDeA2ymNd+10O6kjwvPHlzPr 3rW73RDRPAjMJ49HXlueiuoNAgMBAAGjdzB1MCoGBStlAQQBBCEwHwIBADAaMBgCAQQEE0wy dU15ZmZCTlViTkpKY2RaMnMwOQYDVR0RBDIwMIEZbGFycy5lZ2dlcnRAbmV0bGFiLm5lYy5k ZYETbGFycy5lZ2dlcnRAZ214Lm5ldDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBAUAA4GB AHgrv3SQFD4AS4lY4oKcI3iTHcclEHbYfg3UUb8zzCUsl+OJoz0nmebGmOL+tvNj5GvCrWnN H4LvVLh8ZBhFXms7eKJ1YiHgbKwTRK23P8Y5NDit5ico0ZjpFWeenUWj3ajEbN6n4K8dNp+C 0b2apnSrlFVWY6BucZFIYqQ1Lf91MIIDWjCCAsOgAwIBAgIDC1OiMA0GCSqGSIb3DQEBBAUA MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQu MSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTAeFw0wMzEy MTUxMjMxMjhaFw0wNDEyMTQxMjMxMjhaMIGEMQ8wDQYDVQQEEwZFZ2dlcnQxDTALBgNVBCoT BExhcnMxFDASBgNVBAMTC0xhcnMgRWdnZXJ0MSgwJgYJKoZIhvcNAQkBFhlsYXJzLmVnZ2Vy dEBuZXRsYWIubmVjLmRlMSIwIAYJKoZIhvcNAQkBFhNsYXJzLmVnZ2VydEBnbXgubmV0MIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1qbOfGavAbrtgyg5fXK2780qOs1rGU5E C6+czk6lDLP3lOzHKIb+uDuCMVlmBi32LIw0cVJZnR3SVG8k7VIdpR+Odg1AyQcl4nZS5kQ4 KIRtAFcM7XnastfoRN1ZwnaTIVBpLPup7a693SksTICzNADNZD1rB/ZVl+iDj3cTgt9IDD4k Oucx/T0e9G3n0C4BTynAL9MD/NtdJdOZ/HpMGAHKtnJt/4/p7g7tBxIeaYLJ2O3FRC3jSTg7 6+CIhNbd3NsOPtDXP1ia6hgjJfoGfHPuxbc46Mg3hLAozRQ3gNspjXftdDupI8Lzx5cz6961 u90Q0TwIzCePR15bnorqDQIDAQABo3cwdTAqBgUrZQEEAQQhMB8CAQAwGjAYAgEEBBNMMnVN eWZmQk5VYk5KSmNkWjJzMDkGA1UdEQQyMDCBGWxhcnMuZWdnZXJ0QG5ldGxhYi5uZWMuZGWB E2xhcnMuZWdnZXJ0QGdteC5uZXQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQQFAAOBgQB4 K790kBQ+AEuJWOKCnCN4kx3HJRB22H4N1FG/M8wlLJfjiaM9J5nmxpji/rbzY+Rrwq1pzR+C 71S4fGQYRV5rO3iidWIh4GysE0Sttz/GOTQ4reYnKNGY6RVnnp1Fo92oxGzep+CvHTafgtG9 mqZ0q5RVVmOgbnGRSGKkNS3/dTGCAzswggM3AgEBMGkwYjELMAkGA1UEBhMCWkExJTAjBgNV BAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJz b25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAgMLU6IwCQYFKw4DAhoFAKCCAacwGAYJKoZIhvcN AQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDQwMjAyMDc0NTE5WjAjBgkqhkiG 9w0BCQQxFgQU0Jo8ZkddmHvFHwhk98hKQni1z8UwUgYJKoZIhvcNAQkPMUUwQzAKBggqhkiG 9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcN AwICASgweAYJKwYBBAGCNxAEMWswaTBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3Rl IENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt YWlsIElzc3VpbmcgQ0ECAwtTojB6BgsqhkiG9w0BCRACCzFroGkwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0 ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAgMLU6IwDQYJKoZIhvcNAQEBBQAEggEA B1ww4HP+KAuyrvYwKlujObNe5BsZ3L/GslZoGdid7wIy0ZZtBgv7oJiiviNjUGcUDmoHrdaN Q599Bk41HX5jMQ+ZeZ1DhTUumdZDrQhggcV8k3c0XluevR/niHZANKuDvU9eEqDIKAJ7uAmZ nDlXfpcsbLkmeicGTBhYMdb0MbnzeRt8WdS8q8bJRJYtG/b68eLIgt9wUyO2rNmr+P4Nat3q 1UwD4u9OEcgDIMpt0nn+M19k5NKBKOVMhnJKzyg3Ti6JMr+glY/r1rA7PhzLuRShdK7LQ2gy 1H+x7EIDHApVkZ0w4NLSONp1IfCv+BFNGzCWWo6X9PSRDUs/Cc8fvQAAAAAAAA== --------------ms020702090105030403080703-- From owner-freebsd-multimedia@FreeBSD.ORG Mon Feb 2 09:18:18 2004 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 60E1F16A4CE for ; Mon, 2 Feb 2004 09:18:18 -0800 (PST) Received: from lurza.secnetix.de (lurza.secnetix.de [195.143.231.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 264DA43D39 for ; Mon, 2 Feb 2004 09:18:16 -0800 (PST) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (jajcho@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.9p2/8.12.9) with ESMTP id i12HI5b0039592; Mon, 2 Feb 2004 18:18:06 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.9p2/8.12.9/Submit) id i12HI42L039591; Mon, 2 Feb 2004 18:18:04 +0100 (CET) (envelope-from olli) Date: Mon, 2 Feb 2004 18:18:04 +0100 (CET) Message-Id: <200402021718.i12HI42L039591@lurza.secnetix.de> From: Oliver Fromme To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws In-Reply-To: <20040201112747.7785640826@fw.farid-hajji.net> X-Newsgroups: list.freebsd-multimedia User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.9-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 17:18:18 -0000 Cordula's Web wrote: > > > you could mount the replacement root device on '/' > > > > alternatively you could make init do the chroot (you have source no? :-) > > chroot()ing init looks like a good idea, but: > 1. Isn't /sbin/init itself mmap()ed to the physical device > which I'd like to turn off later? > 2. Other processes, forked earlier from init will also > be mmap()ed to the physical device, so they'll have to die? > > 1. means that chroot() can only happen before /sbin/init is > created, somewhere around /usr/src/sys/kern/init_main.c:mi_startup() > > 2. means that all these processes will die, when the device > is turned off. No, they won't die, they'll just block for a brief moment while the drive is coming back online. Note that "ataidle" does not turn the device off, but it merely causes the disks to spin down after a certain idle time. As soon as some process tries to access the disk, they'll spin up again. You should not physically remove the drive, though (if it's in a removable drive bay), nor switch off power from the drive. So the chroot solution is probably the easiest solution. The init process is idle most of the time, so chances are that it doesn't want to spin up your disk. Init only wakes up when you send it a HUP signal (i.e. after modifying the /etc/ttys file), or when one of the daemons from that file dies (i.e. a getty process). And upon shutdown, of course. > * A new syscall foo(device_t) is needed. > * foo() manipulates the vnode for "/", effectively mounting the > memory device. I think that would be prohibitively complicated. Keep in mind that all existing open files on that disk depend on the vnode, so you would have to manipulate a _lot_ of data. All memory mappings, locks etc. would have to be renewed somehow. It's a huge can of worms. Regards Oliver PS: Uhm, why is this in the -multimedia list anyway? :-) -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Perl will consistently give you what you want, unless what you want is consistency." -- Larry Wall From owner-freebsd-multimedia@FreeBSD.ORG Mon Feb 2 19:35:07 2004 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 C3DB716A4ED for ; Mon, 2 Feb 2004 19:35:05 -0800 (PST) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1113F43D2D for ; Mon, 2 Feb 2004 19:35:03 -0800 (PST) (envelope-from wilkinsa@squirm.dsto.defence.gov.au) Received: from ednmsw503.dsto.defence.gov.au (ednmsw503.dsto.defence.gov.au [131.185.2.150]) by digger1.defence.gov.au with ESMTP id i133YhZl000060 for ; Tue, 3 Feb 2004 14:04:44 +1030 (CST) Received: from muttley.dsto.defence.gov.au (unverified) by ednmsw503.dsto.defence.gov.au (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Tue, 3 Feb 2004 14:04:48 +1030 Received: from ednex501.dsto.defence.gov.au (ednex501.dsto.defence.gov.au [131.185.2.81]) by muttley.dsto.defence.gov.au (8.11.3/8.11.3) with ESMTP id i133Qio03129 for ; Tue, 3 Feb 2004 13:56:44 +1030 (CST) Received: from squirm.dsto.defence.gov.au ([131.185.40.211]) by ednex501.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id DLF4L55W; Tue, 3 Feb 2004 13:56:43 +1030 Received: from squirm.dsto.defence.gov.au (localhost [127.0.0.1]) by squirm.dsto.defence.gov.au (8.12.10/8.12.10) with ESMTP id i133QjO7020493 for ; Tue, 3 Feb 2004 13:56:45 +1030 (CST) (envelope-from wilkinsa@squirm.dsto.defence.gov.au) Received: (from wilkinsa@localhost) by squirm.dsto.defence.gov.au (8.12.10/8.12.10/Submit) id i133QjDL020492 for freebsd-multimedia@freebsd.org; Tue, 3 Feb 2004 13:56:45 +1030 (CST) (envelope-from wilkinsa) Date: Tue, 3 Feb 2004 13:56:43 +1030 From: Alex Wilkinson To: freebsd-multimedia@freebsd.org Message-ID: <20040203032643.GL18959@squirm.dsto.defence.gov.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: sound card blocking 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: Tue, 03 Feb 2004 03:35:07 -0000 Hi all, I have a strange problem. I am using xmms 1.2.8 to play mp3's and a very 'weird' thing happens. Whilst an mp3 is playing, xmms randomly will stop playing and a message will pop up that states: "Please check that: 1. You have the correct outplut plugin selected 2. No other programs is blocking the soundcard 3. Your soundcard is configured properly. " This becommes *very* frustrating because I can just hit the play button on xmms and it starts playing again. Then in 30 mins or so it gets blocked again. Here are some details. be happy if someone could suggest some solutions. FreeBSD 4.9-STABLE #8: Tue Dec 16 10:38:45 CST 2003 (448)-03.02.2004 host-{13:47}-[/home/username]->fstat | grep esd username esd 20220 root / 2 drwxr-xr-x 1024 r username esd 20220 wd /export 1483777 drwx------ 6144 r username esd 20220 text /usr 619045 -r-xr-xr-x 34732 r username esd 20220 0 / 16795 crw--w---- ttyp2 rw username esd 20220 1 / 16795 crw--w---- ttyp2 rw username esd 20220 2 / 16795 crw--w---- ttyp2 rw username esd 20220 3* local stream d5e31a00 username esd 20220 4* local stream d5e31e60 username esd 20220 7* local stream d5d7a3c0 username esd 20220 8* pipe dd170300 <-> dd1703a0 0 rw username esd 20220 9* pipe dd1703a0 <-> dd170300 0 rw username esd 20220 10 /export 1487132 -rw------- 5676169 r username esd 20220 11* pipe dd16fd60 <-> dd1706c0 1 rw username esd 20220 12* pipe dd1706c0 <-> dd16fd60 0 rw (450)-03.02.2004 host-{13:52}-[/home/username]->cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: at io 0xd800, 0xdc00 irq 11 bufsz 16384 (1p/1r/0v channels duplex) Thanks - aW From owner-freebsd-multimedia@FreeBSD.ORG Tue Feb 3 05:33:39 2004 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 0781816A4D9 for ; Tue, 3 Feb 2004 05:33:39 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5C4F43D45 for ; Tue, 3 Feb 2004 05:33:35 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id AB92040826; Tue, 3 Feb 2004 14:32:56 +0100 (CET) From: Cordula's Web To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws In-reply-to: <200402021718.i12HI42L039591@lurza.secnetix.de> (message from Oliver Fromme on Mon, 2 Feb 2004 18:18:04 +0100 (CET)) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: <200402021718.i12HI42L039591@lurza.secnetix.de> Message-Id: <20040203133256.AB92040826@fw.farid-hajji.net> Date: Tue, 3 Feb 2004 14:32:56 +0100 (CET) Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 13:33:39 -0000 > > > you could mount the replacement root device on '/' > > > > > > alternatively you could make init do the chroot (you have source no? :-) > > > > chroot()ing init looks like a good idea, but: > > 1. Isn't /sbin/init itself mmap()ed to the physical device > > which I'd like to turn off later? > > 2. Other processes, forked earlier from init will also > > be mmap()ed to the physical device, so they'll have to die? > > > > 1. means that chroot() can only happen before /sbin/init is > > created, somewhere around /usr/src/sys/kern/init_main.c:mi_startup() > > > > 2. means that all these processes will die, when the device > > is turned off. > > No, they won't die, they'll just block for a brief moment > while the drive is coming back online. Note that "ataidle" > does not turn the device off, but it merely causes the disks > to spin down after a certain idle time. As soon as some > process tries to access the disk, they'll spin up again. Hmmm, let's see: * / is mounted on, say, /dev/da0s1a * some processes (including /sbin/init) have open files from / * /sbin/init chroot()s to something else. * new processes spawned by init inherit the chroot() settings. * /dev/da0 is powered down * ??? What happens now to /sbin/init? What happens to the filesystem that (was) mounted on /? > You should not physically remove the drive, though (if it's > in a removable drive bay), nor switch off power from the > drive. Yep, that's the catch. The drive should be powered off, and it should be potentially removable/replacable. It's remarkable that it is so difficult to change the root device on-the-fly. I didn't expect it to be so difficult :( > So the chroot solution is probably the easiest solution. > The init process is idle most of the time, so chances are > that it doesn't want to spin up your disk. Init only wakes > up when you send it a HUP signal (i.e. after modifying the > /etc/ttys file), or when one of the daemons from that file > dies (i.e. a getty process). And upon shutdown, of course. Any process that gets orphaned will be inherited by init. This means that the PPID of that process will change to 1. But will init not be notified of this, therefore reactivated? Yes, init is idle most of the time, but is it safe to assume that it will not access its own drive or backing store? > > * A new syscall foo(device_t) is needed. > > * foo() manipulates the vnode for "/", effectively mounting the > > memory device. > > I think that would be prohibitively complicated. Keep in > mind that all existing open files on that disk depend on > the vnode, so you would have to manipulate a _lot_ of > data. All memory mappings, locks etc. would have to be > renewed somehow. It's a huge can of worms. Yes, that's exactly the problem. It means a nearly full reboot, but not 100%, because that would kill e.g. the ramdisk. Hairy it is... > Regards > Oliver > > PS: Uhm, why is this in the -multimedia list anyway? :-) No idea. This started on questions@, but migrated somehow. Sorry if it is off topic here. What would the appropriate place be? Thanks, -cpghost. -- Cordula's Web. http://www.cordula.ws/ From owner-freebsd-multimedia@FreeBSD.ORG Tue Feb 3 10:24:26 2004 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 DA3A716A4CF for ; Tue, 3 Feb 2004 10:24:26 -0800 (PST) Received: from vanish.yandex.ru (vanish.yandex.ru [213.180.200.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4D9B43D2D for ; Tue, 3 Feb 2004 10:24:25 -0800 (PST) (envelope-from grint@yandex.ru) Received: from gw01.nln.ru ([217.174.98.193]:202 "EHLO grint.int.nln.ru" smtp-auth: "grint") by mail.yandex.ru with ESMTP id ; Tue, 3 Feb 2004 21:24:17 +0300 Received: from grint by grint.int.nln.ru with local (Exim 4.30; FreeBSD) id 1Ao59z-000Kyw-Ky for freebsd-multimedia@freebsd.org; Tue, 03 Feb 2004 21:20:31 +0300 Date: Tue, 3 Feb 2004 21:20:31 +0300 From: "Ruslan N. Gogunsci" To: freebsd-multimedia@freebsd.org Message-ID: <20040203182031.GA74904@grint.int.nln.ru> References: <4016A37E.000004.20502@soapbox.yandex.ru> <20040202171204.GA3972@grint.int.nln.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040202171204.GA3972@grint.int.nln.ru> User-Agent: Mutt/1.4.1i Subject: fm801 based sound card and FreeBSD5.2 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: Tue, 03 Feb 2004 18:24:27 -0000 Hello, I can't use my sound card based on fm801 (Genius Sound Maker) on FreeBSD5.2 On FreeBSD5.1 I download older fm801.c and build new kernel. And all work fine. But when I try do it on FreeBSD5.2 I have errors when try compile kernel: somthing like structurs changes format. Native fm801.c for FreeBSD5.2 dosn't work too. How can I use my sound card? From owner-freebsd-multimedia@FreeBSD.ORG Tue Feb 3 11:40:38 2004 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 6694B16A4CE for ; Tue, 3 Feb 2004 11:40:38 -0800 (PST) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF91843D1D for ; Tue, 3 Feb 2004 11:40:36 -0800 (PST) (envelope-from torfinn.ingolfsen@broadpark.no) Received: from kg-work.kg4.no (150.80-202-72.nextgentel.com [80.202.72.150]) by mail.broadpark.no (Postfix) with SMTP id BA6E079F52 for ; Tue, 3 Feb 2004 20:40:34 +0100 (MET) Date: Tue, 3 Feb 2004 20:40:34 +0100 From: Torfinn Ingolfsen To: freebsd-multimedia@freebsd.org Message-Id: <20040203204034.22df605b.torfinn.ingolfsen@broadpark.no> X-Mailer: Sylpheed version 0.9.8a (GTK+ 1.2.10; i386-portbld-freebsd4.9) X-Face: "t9w2,-X@O^I`jVW\sonI3.,36KBLZE*AL[y9lL[PyFD*r_S:dIL9c[8Y>V42R0"!"yb_zN,f#%.[PYYNq;m"_0v;~rUM2Yy!zmkh)3&U|u!=T(zyv,MHJv"nDH>OJ`t(@mil461d_B'Uo|'nMwlKe0Mv=kvV?Nh@>Hb<3s_z2jYgZhPb@?Wi^x1a~Hplz1.zH Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Driver for Hauppauge WinTV card with CX2388x chip (NOT BT8x8)? 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: Tue, 03 Feb 2004 19:40:38 -0000 Hi, I have started to build myself a Home Theater PC (HTPC). I'm using FreeBSD 4.9-stable as operating system, because this is what I know (and I'm lazy). In this machine, I need a TV card in order to watch or record TV programs. So I looked at the documentation for the bktr driver, in order to make sure I got myself a supprted TV card. I also searched the web extensively, to see if there was prveious experience, Finally, I bought a Hauppauge WinTV PCI FM, model 747. According to all the common knowledge, the WinTV series uses BT8x8 chips, and are supported by the bktr driver. However, this seems to be a newer model. from dmesg: pci1: (vendor=0x14f1, dev=0x8800) at 2.0 irq 11 pci1: (vendor=0x14f1, dev=0x8811) at 2.1 irq 11 from 'pciconf -lv': none2@pci1:2:0: class=0x040000 card=0x34010070 chip=0x880014f1 rev=0x03 hdr=0x00 vendor = 'Conexant Systems, Inc.' device = 'CX2388x TV Card (MSI PVS Video Capture)' class = multimedia subclass = video none3@pci1:2:1: class=0x048000 card=0x34010070 chip=0x881114f1 rev=0x03 hdr=0x00 vendor = 'Conexant Systems, Inc.' class = multimedia and finally, from 'lspci -v' (from the pciutils port): 01:02.0 Multimedia video controller: Conexant: Unknown device 8800 (rev 03) Subsystem: Hauppauge computer works Inc.: Unknown device 3401 Flags: bus master, medium devsel, latency 32, IRQ 10 Memory at dd000000 (32-bit, non-prefetchable) Capabilities: [44] Vital Product Data Capabilities: [4c] Power Management version 2 01:02.1 Multimedia controller: Conexant: Unknown device 8811 (rev 03) Subsystem: Hauppauge computer works Inc.: Unknown device 3401 Flags: bus master, medium devsel, latency 32, IRQ 10 Memory at de000000 (32-bit, non-prefetchable) Capabilities: [44] Vital Product Data Capabilities: [4c] Power Management version 2 Has anybody got one of these cards working with FreeBSD? If so, where can I get a driver? Or do you know if this chip (the CX2388x) is so similar to the BT8x8 chip that it would be worthwile spending some time trying to make it work with the bktr driver? Option three, how hard would it be to write a driver for this chip? I have never written a driver under FreeBSD before, so this will require me to as all of you a lot of questions. ;^) -- Torfinn Ingolfsen, Norway From owner-freebsd-multimedia@FreeBSD.ORG Tue Feb 3 12:08:37 2004 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 664B716A4CE for ; Tue, 3 Feb 2004 12:08:37 -0800 (PST) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFE8D43D3F for ; Tue, 3 Feb 2004 12:08:34 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <2004020320083301600a4arje>; Tue, 3 Feb 2004 20:08:33 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA88377; Tue, 3 Feb 2004 12:08:33 -0800 (PST) Date: Tue, 3 Feb 2004 12:08:31 -0800 (PST) From: Julian Elischer To: Torfinn Ingolfsen In-Reply-To: <20040203204034.22df605b.torfinn.ingolfsen@broadpark.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-multimedia@freebsd.org Subject: Re: Driver for Hauppauge WinTV card with CX2388x chip (NOT BT8x8)? 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: Tue, 03 Feb 2004 20:08:37 -0000 Are you in luck! one was posted here last week.. http://www.freebsd.org/cgi/getmsg.cgi?fetch=25222+187217+/usr/local/www/db/text/2004/freebsd-multimedia/20040201.freebsd-multimedia not specifically for THAT card, but a related one.. I'm sure the author would like ot hear from you :-) On Tue, 3 Feb 2004, Torfinn Ingolfsen wrote: > Hi, > > I have started to build myself a Home Theater PC (HTPC). I'm using > FreeBSD 4.9-stable as operating system, because this is what I know (and > I'm lazy). > > In this machine, I need a TV card in order to watch or record TV > programs. So I looked at the documentation for the bktr driver, in order > to make sure I got myself a supprted TV card. I also searched > the web extensively, to see if there was prveious experience, Finally, I > bought a Hauppauge WinTV PCI FM, model 747. According to all the common > knowledge, the WinTV series uses BT8x8 chips, and are supported by the > bktr driver. However, this seems to be a newer model. > from dmesg: > pci1: (vendor=0x14f1, dev=0x8800) at 2.0 irq 11 > pci1: (vendor=0x14f1, dev=0x8811) at 2.1 irq 11 > > from 'pciconf -lv': > none2@pci1:2:0: class=0x040000 card=0x34010070 chip=0x880014f1 rev=0x03 > hdr=0x00 vendor = 'Conexant Systems, Inc.' > device = 'CX2388x TV Card (MSI PVS Video Capture)' > class = multimedia > subclass = video > none3@pci1:2:1: class=0x048000 card=0x34010070 chip=0x881114f1 rev=0x03 > hdr=0x00 vendor = 'Conexant Systems, Inc.' > class = multimedia > > and finally, from 'lspci -v' (from the pciutils port): > 01:02.0 Multimedia video controller: Conexant: Unknown device 8800 (rev > 03) Subsystem: Hauppauge computer works Inc.: Unknown device 3401 > Flags: bus master, medium devsel, latency 32, IRQ 10 > Memory at dd000000 (32-bit, non-prefetchable) > Capabilities: [44] Vital Product Data > Capabilities: [4c] Power Management version 2 > > 01:02.1 Multimedia controller: Conexant: Unknown device 8811 (rev 03) > Subsystem: Hauppauge computer works Inc.: Unknown device 3401 > Flags: bus master, medium devsel, latency 32, IRQ 10 > Memory at de000000 (32-bit, non-prefetchable) > Capabilities: [44] Vital Product Data > Capabilities: [4c] Power Management version 2 > > Has anybody got one of these cards working with FreeBSD? If so, where > can I get a driver? > Or do you know if this chip (the CX2388x) is so similar to the BT8x8 > chip that it would be worthwile spending some time trying to make it > work with the bktr driver? > > Option three, how hard would it be to write a driver for this chip? I > have never written a driver under FreeBSD before, so this will require > me to as all of you a lot of questions. ;^) > -- > Torfinn Ingolfsen, > Norway > > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to "freebsd-multimedia-unsubscribe@freebsd.org" > From owner-freebsd-multimedia@FreeBSD.ORG Wed Feb 4 02:35:16 2004 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 0B6D016A4CE for ; Wed, 4 Feb 2004 02:35:16 -0800 (PST) Received: from lurza.secnetix.de (lurza.secnetix.de [195.143.231.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id A560643D39 for ; Wed, 4 Feb 2004 02:35:12 -0800 (PST) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lwxklm@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.9p2/8.12.9) with ESMTP id i14AZ1b0021222; Wed, 4 Feb 2004 11:35:02 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.9p2/8.12.9/Submit) id i14AZ07w021221; Wed, 4 Feb 2004 11:35:00 +0100 (CET) (envelope-from olli) Date: Wed, 4 Feb 2004 11:35:00 +0100 (CET) Message-Id: <200402041035.i14AZ07w021221@lurza.secnetix.de> From: Oliver Fromme To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws In-Reply-To: <20040203133256.AB92040826@fw.farid-hajji.net> X-Newsgroups: list.freebsd-multimedia User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.9-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 10:35:16 -0000 BTW, please include an attribution line when quoting others. That makes it a lot easier to see who wrote which parts of the thread. Cordula's Web wrote: > > > No, they won't die, they'll just block for a brief moment > > while the drive is coming back online. Note that "ataidle" > > does not turn the device off, but it merely causes the disks > > to spin down after a certain idle time. As soon as some > > process tries to access the disk, they'll spin up again. > > Hmmm, let's see: > * / is mounted on, say, /dev/da0s1a > * some processes (including /sbin/init) have open files from / > * /sbin/init chroot()s to something else. > * new processes spawned by init inherit the chroot() settings. > * /dev/da0 is powered down > * ??? > > What happens now to /sbin/init? Nothing. As long as the existing init process is idle, (i.e. it doesn't need to be scheduled for time slices), nothing happens. To be more exact: As long as the init process doesn't need any executable pages which aren't already in memory. > What happens to the filesystem that (was) mounted on /? othing. It is still mounted, but inaccessible by any processes after the chroot() call. > > You should not physically remove the drive, though (if it's > > in a removable drive bay), nor switch off power from the > > drive. > > Yep, that's the catch. The drive should be powered off, and > it should be potentially removable/replacable. Then you can't use the chroot() solution. > It's remarkable > that it is so difficult to change the root device on-the-fly. > I didn't expect it to be so difficult :( Well, just _changing_ the root device (as it appears to processes) is easy -- that's what chroot() does. But what you really want is to completely _unmount_ the original root device. That's not possible in UNIX. > > The init process is idle most of the time, so chances are > > that it doesn't want to spin up your disk. Init only wakes > > up when you send it a HUP signal (i.e. after modifying the > > /etc/ttys file), or when one of the daemons from that file > > dies (i.e. a getty process). And upon shutdown, of course. > > Any process that gets orphaned will be inherited by init. > This means that the PPID of that process will change to 1. > But will init not be notified of this, therefore reactivated? Right. I didn't think of that. The init process will be notified and pick up the exit code of the orphaned process. But that part of init should already be mapped into memory, so no physical disk access should be necessary. > Yes, init is idle most of the time, but is it safe to assume > that it will not access its own drive or backing store? No, that's not safe to assume. If the drive has just spun down, then it doesn't matter much, because it'll spin up automatically for a short time, then spin back down when the idle time has elapsed again. But if you remove power from the drive (or remove the whole drive), then you're asking for trouble, sooner or later. > > PS: Uhm, why is this in the -multimedia list anyway? :-) > > No idea. This started on questions@, but migrated somehow. Sorry > if it is off topic here. What would the appropriate place be? Depends on your kind of application. :-) If you need it for some kind of embedded system, then the -small mailing list might be appropriate. BTW, why are you booting from a hard disk in the first place? There are several alternatives that might be possible, depending on your requirements. For example, you could boot from CD-R. Or, if you have a network connection and a server nearby, you could boot from the network, without any drives in the box. Finally, a very common approach is to use a CF-to-ATA adaptor and boot from a Compact-Flash card. That's how I boot my self-made mp3 player box, which -- of course -- runs FreeBSD. :) Regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind." -- Alan Kay, OOPSLA '97 From owner-freebsd-multimedia@FreeBSD.ORG Wed Feb 4 12:50:12 2004 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 3538616A4CF for ; Wed, 4 Feb 2004 12:50:12 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2432743D1D for ; Wed, 4 Feb 2004 12:50:11 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id 169954082E; Wed, 4 Feb 2004 21:49:31 +0100 (CET) From: Cordula's Web To: freebsd-multimedia@FreeBSD.ORG, cpghost@cordula.ws In-reply-to: <200402041035.i14AZ07w021221@lurza.secnetix.de> (message from Oliver Fromme on Wed, 4 Feb 2004 11:35:00 +0100 (CET)) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: <200402041035.i14AZ07w021221@lurza.secnetix.de> Message-Id: <20040204204931.169954082E@fw.farid-hajji.net> Date: Wed, 4 Feb 2004 21:49:31 +0100 (CET) Subject: Re: Transferring the root filesystem to a ramdisk? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 20:50:12 -0000 > Finally, a very common approach is to use a CF-to-ATA > adaptor and boot from a Compact-Flash card. That's how Yes, we've already implemented this solution yesterday, and it works like a charm. The system boots from CF and accesses the hard drive(s) only for copying data over, when CF cards are full of sensor data. Thanks, -cpghost. -- Cordula's Web. http://www.cordula.ws/ From owner-freebsd-multimedia@FreeBSD.ORG Wed Feb 4 13:34:37 2004 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 632B716A4CE for ; Wed, 4 Feb 2004 13:34:37 -0800 (PST) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E178A43D1D for ; Wed, 4 Feb 2004 13:34:35 -0800 (PST) (envelope-from torfinn.ingolfsen@broadpark.no) Received: from kg-work.kg4.no (150.80-202-72.nextgentel.com [80.202.72.150]) by mail.broadpark.no (Postfix) with SMTP id A466279552 for ; Wed, 4 Feb 2004 22:34:21 +0100 (MET) Date: Wed, 4 Feb 2004 22:34:18 +0100 From: Torfinn Ingolfsen To: freebsd-multimedia@freebsd.org Message-Id: <20040204223418.21fc0d8c.torfinn.ingolfsen@broadpark.no> In-Reply-To: References: <20040203204034.22df605b.torfinn.ingolfsen@broadpark.no> X-Mailer: Sylpheed version 0.9.8a (GTK+ 1.2.10; i386-portbld-freebsd4.9) X-Face: "t9w2,-X@O^I`jVW\sonI3.,36KBLZE*AL[y9lL[PyFD*r_S:dIL9c[8Y>V42R0"!"yb_zN,f#%.[PYYNq;m"_0v;~rUM2Yy!zmkh)3&U|u!=T(zyv,MHJv"nDH>OJ`t(@mil461d_B'Uo|'nMwlKe0Mv=kvV?Nh@>Hb<3s_z2jYgZhPb@?Wi^x1a~Hplz1.zH Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Driver for Hauppauge WinTV card with CX2388x chip (NOT BT8x8)? 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: Wed, 04 Feb 2004 21:34:37 -0000 Julian Elischer wrote: > one was posted here last week.. > http://www.freebsd.org/cgi/getmsg.cgi?fetch=25222+187217+/usr/local/www/db/text/2004/freebsd-multimedia/20040201.freebsd-multimedia > > not specifically for THAT card, but a related one.. Actually, I found the cxm driver (in the mailing list archives) and tried it. I think it support cards that are too different from mine, thus making it difficult to make it work with mine (I would love to be proved wrong, of course). The cxm driver is for cars that have a hardware MPEG encoder, mine does not. Also, the included driver CD does not include the firmware file that the cxm driver uses. Without that the driver would not build on my FreeBSD 4.9-stable system. > I'm sure the author would like ot hear from you :-) I'm sure he reads this mailing list from time to time. -- Torfinn Ingolfsen, Norway From owner-freebsd-multimedia@FreeBSD.ORG Wed Feb 4 14:03:24 2004 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 D9E7716A4CE for ; Wed, 4 Feb 2004 14:03:24 -0800 (PST) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2EE243D1D for ; Wed, 4 Feb 2004 14:03:19 -0800 (PST) (envelope-from torfinn.ingolfsen@broadpark.no) Received: from kg-work.kg4.no (150.80-202-72.nextgentel.com [80.202.72.150]) by mail.broadpark.no (Postfix) with SMTP id 9A59879584 for ; Wed, 4 Feb 2004 23:03:18 +0100 (MET) Date: Wed, 4 Feb 2004 23:03:16 +0100 From: Torfinn Ingolfsen To: freebsd-multimedia@freebsd.org Message-Id: <20040204230316.6886d596.torfinn.ingolfsen@broadpark.no> X-Mailer: Sylpheed version 0.9.8a (GTK+ 1.2.10; i386-portbld-freebsd4.9) X-Face: "t9w2,-X@O^I`jVW\sonI3.,36KBLZE*AL[y9lL[PyFD*r_S:dIL9c[8Y>V42R0"!"yb_zN,f#%.[PYYNq;m"_0v;~rUM2Yy!zmkh)3&U|u!=T(zyv,MHJv"nDH>OJ`t(@mil461d_B'Uo|'nMwlKe0Mv=kvV?Nh@>Hb<3s_z2jYgZhPb@?Wi^x1a~Hplz1.zH Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Pinnacle WinTV card - warning about unknown vendor and model? 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: Wed, 04 Feb 2004 22:03:25 -0000 Hei, I have borrowed another Pinnacle WinTV card from a friend who had it lying around. This is an older card, with the BT8x8 chip on it. It is detected by the bktr driver, but I get a warning. These are the bktr messages from dmesg: bktr0: mem 0xcfbfe000-0xcfbfefff irq 11 at device 2.0 on pci1 bktr0: Warning - card vendor 0x11bd (model 0x0012) unknown. bktr0: Detected a MSP3451G-A2 at 0x80 bktr0: Pinnacle/Miro TV, Temic PAL tuner, msp3400c stereo. Is this warning something I should act on? Or can i just ignore it? I haven't actually connected the card to an antenna yet. Now I must learn how to use fxtv... -- Torfinn Ingolfsen, Norway From owner-freebsd-multimedia@FreeBSD.ORG Wed Feb 4 15:05:39 2004 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 72C4616A4CE for ; Wed, 4 Feb 2004 15:05:39 -0800 (PST) Received: from quynh-and-brian.org (h-69-3-155-2.MCLNVA23.covad.net [69.3.155.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E9D043D46 for ; Wed, 4 Feb 2004 15:05:36 -0800 (PST) (envelope-from brian@quynh-and-brian.org) Received: (qmail 42158 invoked from network); 4 Feb 2004 23:05:34 -0000 Received: from localhost.quynh-and-brian.org (HELO localhost) ([127.0.0.1]) (envelope-sender ) by localhost.quynh-and-brian.org (qmail-ldap-1.03) with SMTP for ; 4 Feb 2004 23:05:34 -0000 From: Brian Skrab To: Torfinn Ingolfsen , freebsd-multimedia@freebsd.org Date: Wed, 4 Feb 2004 18:03:25 -0500 User-Agent: KMail/1.5.4 References: <20040204230316.6886d596.torfinn.ingolfsen@broadpark.no> In-Reply-To: <20040204230316.6886d596.torfinn.ingolfsen@broadpark.no> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402041803.25610.brian@quynh-and-brian.org> Subject: Re: Pinnacle WinTV card - warning about unknown vendor and model? 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: Wed, 04 Feb 2004 23:05:39 -0000 Hello, I have a similar card (Pinnacle PCTV), which required a few overrides in the kernel for the bktr driver, in order to get rid of a similar dmesg warning. I've included the relevant section below: device bktr options BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_NTSC options OVERRIDE_CARD=1 options OVERRIDE_TUNER=4 # options OVERRIDE_MSP=1 # options OVERRIDE_DBX=1 # These options can be used to override the auto detection # The current values for xxx are found in src/sys/dev/bktr/bktr_card.h # Using sysctl(8) run-time overrides on a per-card basis can be made # options BKTR_USE_PLL # PAL or SECAM users who have a 28Mhz crystal (and no 35Mhz crystal) # must enable PLL mode with this option. eg some new Bt878 cards. # options BKTR_GPIO_ACCESS # This enable IOCTLs which give user level access to the GPIO port. After installing the new kernel, fxtv, mplayer, nuppelvideo, and ffmpeg were all able to grab video from the card (and audio from /dev/dsp). Note that all of this was done on a 4.9-STABLE system. Hope this helps. ~brian On Wednesday 04 February 2004 05:03 pm, Torfinn Ingolfsen wrote: > Hei, > > I have borrowed another Pinnacle WinTV card from a friend who had it > lying around. This is an older card, with the BT8x8 chip on it. > It is detected by the bktr driver, but I get a warning. These are the > bktr messages from dmesg: > bktr0: mem 0xcfbfe000-0xcfbfefff irq 11 at device 2.0 on > pci1 bktr0: Warning - card vendor 0x11bd (model 0x0012) unknown. > bktr0: Detected a MSP3451G-A2 at 0x80 > bktr0: Pinnacle/Miro TV, Temic PAL tuner, msp3400c stereo. > > Is this warning something I should act on? Or can i just ignore it? > I haven't actually connected the card to an antenna yet. > > Now I must learn how to use fxtv... From owner-freebsd-multimedia@FreeBSD.ORG Thu Feb 5 16:10:29 2004 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 DB27616A4CE for ; Thu, 5 Feb 2004 16:10:29 -0800 (PST) Received: from jktim01.indosat.net.id (jktim01.indosat.net.id [202.155.50.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41A6A43D39 for ; Thu, 5 Feb 2004 16:10:28 -0800 (PST) (envelope-from lnugroho@indosat.net.id) Received: from indosat.net.id ([127.0.0.1]) by imsmail.indosat.net.id (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0HSM00JS5Z712O@imsmail.indosat.net.id> for freebsd-multimedia@freebsd.org; Fri, 06 Feb 2004 07:11:25 +0700 (JVT) Received: from [202.155.103.215] by imsmail.indosat.net.id (mshttpd); Fri, 06 Feb 2004 07:11:25 +0700 Date: Fri, 06 Feb 2004 07:11:25 +0700 From: lnugroho@indosat.net.id To: freebsd-multimedia@freebsd.org Message-id: <7987179f2a.79f2a79871@indosat.net.id> MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.18 (built Jul 28 2003) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal Subject: Xine Engine Error 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: Fri, 06 Feb 2004 00:10:30 -0000 I've been install xine on FBSD 5.2. Mount cdrom using mount_cd9660 -s 0 /dev/acd0 /cdrom. When I open my vcd file /cdrom/mpegav/avseq01.dat. Xine engine error with the message "There is no demuxer plugin available to handel '/cdrom/mpegav/avseq01.dat' Ussualy this means that the file format was not recognized". How can I solve this problems. My vcd is playing well in winxp with Media Player 9. Lambang Nugroho Indonesia From owner-freebsd-multimedia@FreeBSD.ORG Fri Feb 6 09:20:47 2004 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 3E4C916A4CE for ; Fri, 6 Feb 2004 09:20:47 -0800 (PST) Received: from meitner.wh.uni-dortmund.de (meitner.wh.uni-dortmund.de [129.217.129.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id D88DC43D54 for ; Fri, 6 Feb 2004 09:20:45 -0800 (PST) (envelope-from michaelnottebrock@gmx.net) Received: from lofi.dyndns.org (pc2-105.intern.meitner [10.3.12.105]) by meitner.wh.uni-dortmund.de (Postfix) with ESMTP id 559B6167522 for ; Fri, 6 Feb 2004 18:17:04 +0100 (CET) Received: from localhost.invalid (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id i16HH3ju015326 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 6 Feb 2004 18:17:03 +0100 (CET) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: multimedia@FreeBSD.org Date: Fri, 6 Feb 2004 18:16:59 +0100 User-Agent: KMail/1.6 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_Ow8IAucs+vPLwCS"; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200402061817.03251.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new Subject: bktr device detection 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: Fri, 06 Feb 2004 17:20:47 -0000 --Boundary-02=_Ow8IAucs+vPLwCS Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I have a (three, four years old) Pinnacle PCTVpro (stereo TV/Radio) here,=20 which isn't properly detected by the bktr driver: bktr0: mem 0xdfbfe000-0xdfbfefff irq 11 at device 7.0 on pc= i3 bktr0: Warning - card vendor 0x11bd (model 0x0012) unknown. bktr0: Detected a MSP3451G-A2 at 0x80 bktr0: Pinnacle/Miro TV, Temic PAL tuner, msp3400c stereo. I need to manually set hw.bt848.tuner to 10 in order to make it work, but I= =20 still get no stereo sound and radio channel tuning doesn't work, so no radi= o=20 either. Anything I can do or contribute to fix those issues? =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --Boundary-02=_Ow8IAucs+vPLwCS Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAI8wOXhc68WspdLARAvbzAJ4q135zbGG2ULeZWOympzP3O8kjAACgpBpR p0js+WIyoOS3CGj1XrOZMj4= =uXZA -----END PGP SIGNATURE----- --Boundary-02=_Ow8IAucs+vPLwCS-- From owner-freebsd-multimedia@FreeBSD.ORG Fri Feb 6 09:21:15 2004 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 C1C0316A4CE for ; Fri, 6 Feb 2004 09:21:15 -0800 (PST) Received: from meitner.wh.uni-dortmund.de (meitner.wh.uni-dortmund.de [129.217.129.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B7AB43D41 for ; Fri, 6 Feb 2004 09:21:13 -0800 (PST) (envelope-from michaelnottebrock@gmx.net) Received: from lofi.dyndns.org (pc2-105.intern.meitner [10.3.12.105]) by meitner.wh.uni-dortmund.de (Postfix) with ESMTP id 226BA167591 for ; Fri, 6 Feb 2004 18:18:17 +0100 (CET) Received: from localhost.invalid (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id i16HIGju015338 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 6 Feb 2004 18:18:16 +0100 (CET) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: multimedia@FreeBSD.org Date: Fri, 6 Feb 2004 18:18:16 +0100 User-Agent: KMail/1.6 References: <200402061817.03251.michaelnottebrock@gmx.net> In-Reply-To: <200402061817.03251.michaelnottebrock@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_Yx8IAqZbY0bdyKT"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402061818.16506.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new Subject: Re: bktr device detection 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: Fri, 06 Feb 2004 17:21:15 -0000 --Boundary-02=_Yx8IAqZbY0bdyKT Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 06 February 2004 18:16, I wrote: > I have a (three, four years old) Pinnacle PCTVpro (stereo TV/Radio) here, > which isn't properly detected by the bktr driver > [...] =46orgot to mention, this is 4.9-STABLE ( ~ 2 weeks old). =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --Boundary-02=_Yx8IAqZbY0bdyKT Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAI8xYXhc68WspdLARAtbeAKCjx6P0s1BimmfYduCfmO8h4wcoVACdE2gd MoAEEUwOkKk3FH18gQJQhFQ= =YxnC -----END PGP SIGNATURE----- --Boundary-02=_Yx8IAqZbY0bdyKT-- From owner-freebsd-multimedia@FreeBSD.ORG Fri Feb 6 11:20:48 2004 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 C1EFE16A4CE for ; Fri, 6 Feb 2004 11:20:48 -0800 (PST) Received: from kumr.lns.com (kumr.lns.com [63.198.122.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3BDA43D6D for ; Fri, 6 Feb 2004 11:20:27 -0800 (PST) (envelope-from pozar@kumr.lns.com) Received: from kumr.lns.com (localhost [127.0.0.1]) by kumr.lns.com (8.12.10/8.12.10) with ESMTP id i16JLWq5005974 for ; Fri, 6 Feb 2004 11:21:32 -0800 (PST) (envelope-from pozar@kumr.lns.com) Received: (from pozar@localhost) by kumr.lns.com (8.12.10/8.12.10/Submit) id i16JLVcF005973 for multimedia@freebsd.org; Fri, 6 Feb 2004 11:21:31 -0800 (PST) (envelope-from pozar) Date: Fri, 6 Feb 2004 11:21:31 -0800 From: Tim Pozar To: multimedia@freebsd.org Message-ID: <20040206192131.GB311@lns.com> References: <200402061817.03251.michaelnottebrock@gmx.net> <200402061818.16506.michaelnottebrock@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402061818.16506.michaelnottebrock@gmx.net> User-Agent: Mutt/1.4.1i Subject: port for audio/tuneradio 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: Fri, 06 Feb 2004 19:20:48 -0000 With encouragement a couple of months ago from Jason Andresen to put this in ports, I have submitted tuneradio to FreeBSD's ports project. Not sure when it will be showing up, but until then, I have a shar that has the port below. Tim -- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # tuneradio # tuneradio/Makefile # tuneradio/pkg-plist # tuneradio/pkg-descr # tuneradio/distinfo # echo c - tuneradio mkdir -p tuneradio > /dev/null 2>&1 echo x - tuneradio/Makefile sed 's/^X//' >tuneradio/Makefile << 'END-of-tuneradio/Makefile' X# New ports collection makefile for: tuneradio X# Date created: 5 Febuary 2004 X# Whom: pozar X# X# $FreeBSD$ X# X XPORTNAME= tuneradio XPORTVERSION= 1.3 XCATEGORIES= audio XMASTER_SITES= http://www.lns.com/papers/tuneradio/ X XMAINTAINER= pozar@lns.com XCOMMENT= A command line method of tuning a Brooktree FM tuner card X X.include END-of-tuneradio/Makefile echo x - tuneradio/pkg-plist sed 's/^X//' >tuneradio/pkg-plist << 'END-of-tuneradio/pkg-plist' Xbin/tuneradio END-of-tuneradio/pkg-plist echo x - tuneradio/pkg-descr sed 's/^X//' >tuneradio/pkg-descr << 'END-of-tuneradio/pkg-descr' XThis is a command line program to set the frequency and various Xmodes to an FM tuner using a Brooktree based card. X XWWW: http://www.lns.com/papers/tuneradio/ X X- Tim Xpozar@lns.com END-of-tuneradio/pkg-descr echo x - tuneradio/distinfo sed 's/^X//' >tuneradio/distinfo << 'END-of-tuneradio/distinfo' XMD5 (tuneradio-1.3.tar.gz) = 784d8928f5b7703c2b20d6ec0371f38c END-of-tuneradio/distinfo exit From owner-freebsd-multimedia@FreeBSD.ORG Fri Feb 6 12:41:18 2004 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 C6E5A16A4CE for ; Fri, 6 Feb 2004 12:41:18 -0800 (PST) Received: from meitner.wh.uni-dortmund.de (meitner.wh.uni-dortmund.de [129.217.129.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F66E43D1D for ; Fri, 6 Feb 2004 12:41:17 -0800 (PST) (envelope-from michaelnottebrock@gmx.net) Received: from lofi.dyndns.org (pc2-105.intern.meitner [10.3.12.105]) by meitner.wh.uni-dortmund.de (Postfix) with ESMTP id 733FE16758C for ; Fri, 6 Feb 2004 21:41:16 +0100 (CET) Received: from localhost.invalid (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id i16KfFju020825 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 6 Feb 2004 21:41:16 +0100 (CET) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: multimedia@FreeBSD.org Date: Fri, 6 Feb 2004 21:41:10 +0100 User-Agent: KMail/1.6 References: <200402061817.03251.michaelnottebrock@gmx.net> <200402061818.16506.michaelnottebrock@gmx.net> <20040206192131.GB311@lns.com> In-Reply-To: <20040206192131.GB311@lns.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_rv/IAcMJ7BlsVNK"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402062141.15312.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new Subject: Re: port for audio/tuneradio 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: Fri, 06 Feb 2004 20:41:18 -0000 --Boundary-02=_rv/IAcMJ7BlsVNK Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 06 February 2004 20:21, Tim Pozar wrote: > With encouragement a couple of months ago from Jason Andresen to > put this in ports, I have submitted tuneradio to FreeBSD's ports > project. Not sure when it will be showing up, but until then, I > have a shar that has the port below. Thanks! Committed to ports, too. Unfortunately, it's the same as with the=20 other radio utilities in ports: It doesn't tune my card. It's a driver=20 problem. =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --Boundary-02=_rv/IAcMJ7BlsVNK Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAI/vrXhc68WspdLARAjErAJ9qJelOL3ZHr0W4cIcuZ9LaH8V6zgCaAnmw hHxA4UdBoiuNad3pWPfDQg8= =L+Tv -----END PGP SIGNATURE----- --Boundary-02=_rv/IAcMJ7BlsVNK--