ports/142049: [PATCH:] make audio/cdparanoia work with new cam/ata code

Juergen Lock nox at jelal.kn-bremen.de
Sat Dec 26 19:40:02 UTC 2009

>Number:         142049
>Category:       ports
>Synopsis:       [PATCH:] make audio/cdparanoia work with new cam/ata code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 26 19:40:01 UTC 2009
>Originator:     Juergen Lock
>Release:        FreeBSD 8.0-STABLE amd64
me?  organized??
System: FreeBSD triton8.kn-bremen.de 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Dec 5 16:24:45 CET 2009 nox at triton8.kn-bremen.de:/usr/obj/data/home/nox/src-s8/src/sys/TRITON8 amd64

	As noted on -current some time ago, cdparanoia seems to be
	currently broken for optical drives using the new cam/ata code
	i.e. connected via ahci(4)/siis(4):

	Make sure the drive is using the new cam/ata code (this thread
	may be useful:
	), then:

	Insert audio cd, make sure cdparanoia can access the drive's
	/dev/cdX and /dev/passY devices (you can find the corresponding
	passY device by running
		camcontrol devlist
	), then run:
		cdparanoia -d /dev/cdX 1
	to try and rip the first track.

	If you have mplayer built with cdparanoia support you can
	also test this way:
		mplayer -cache 8192 -cdrom-device /dev/cdX cdda://


	The patch works for me, only drives conneted on a SAS controller
	(i.e. not native (S)ATA) may still be broken, but that's probably
	still rare so this is at least much better than it was.  (The patch
	can go in e.g. /usr/ports/audio/cdparanoia/files/patch-camata )

Index: interface/scsi_interface.c
@@ -1480,10 +1480,16 @@
 	 * if the bus device name is `ata', we're (obviously)
 	 * running ATAPICAM.
+	 * same for the new ahci(4) and siis(4) drivers and future others
+	 * which use SATA transport too...
-	if (strncmp(d->ccb->cpi.dev_name, "ata", 3) == 0) {
-		cdmessage(d, "\tDrive is ATAPI (using ATAPICAM)\n");
+	if (strncmp(d->ccb->cpi.dev_name, "ata", 3) == 0 ||
+#if __FreeBSD_version >= 800102
+	    d->ccb->cpi.transport == XPORT_SATA ||
+	    d->ccb->cpi.transport == XPORT_ATA) {
+		cdmessage(d, "\tDrive is ATAPI (using ATAPICAM or direct CAM (S)ATA transport)\n");
 		d->is_atapi = 1;
 	} else {
 		cdmessage(d, "\tDrive is SCSI\n");

More information about the freebsd-ports-bugs mailing list