Media Detection

Tim Aslat tim at
Mon Apr 12 20:21:35 PDT 2004

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 <LITE-ON DVDRW LDW-451S> as reported by the
kernel boot messages.

The dmesg gives me this info

cd0 at ata1 bus 0 target 0 lun 0
cd0: <LITE-ON DVDRW LDW-451S GSB6> 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

C or C++ code would be great.



Tim Aslat <tim at>
Spyderweb Consulting
P: +61 8 82243020    M: +61 0401088479

More information about the freebsd-multimedia mailing list