From owner-freebsd-multimedia@FreeBSD.ORG Mon Apr 12 20:21:35 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 8BFFB16A4CE for ; Mon, 12 Apr 2004 20:21:35 -0700 (PDT) Received: from gw.visp.com.au (gw.visp.com.au [202.6.158.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8359243D41 for ; Mon, 12 Apr 2004 20:21:32 -0700 (PDT) (envelope-from tim@spyderweb.com.au) Received: from bofh.spyderweb.com.au (202-6-150-37.ip.visp.com.au [202.6.150.37] (may be forged)) by gw.visp.com.au (8.12.8p2/8.12.8) with ESMTP id i3D3LZ8L012149 for ; Tue, 13 Apr 2004 12:51:35 +0930 (CST) (envelope-from tim@spyderweb.com.au) Received: from spyderweb.com.au (localhost [127.0.0.1])i3D3LV4c046899 for ; Tue, 13 Apr 2004 12:51:32 +0930 (CST) (envelope-from tim@spyderweb.com.au) Date: Tue, 13 Apr 2004 12:51:31 +0930 From: Tim Aslat To: FreeBSD Multimedia Message-Id: <20040413125131.04358c77@bofh.spyderweb.com.au> Organization: Spyderweb Consulting X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-portbld-freebsd5.2.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Media 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: Tue, 13 Apr 2004 03:21:35 -0000 Hi All, Just trying to set up a PVR type device and would like to throw in a feature to detect what media (if any) is inserted into the DVD burner. Currently I'm running FreeBSD 5.2.1-RELEASE-p1 with atapicam and the burner device is a CDRW as reported by the kernel boot messages. The dmesg gives me this info cd0 at ata1 bus 0 target 0 lun 0 cd0: Removable CD-ROM SCSI-0 device cd0: 16.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present How would I go about checking the media if it's a blank, non-blank or RW disk? C or C++ code would be great. Cheers Tim -- Tim Aslat Spyderweb Consulting http://www.spyderweb.com.au P: +61 8 82243020 M: +61 0401088479