From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 12 18:00:37 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26C2716A403 for ; Fri, 12 Jan 2007 18:00:37 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id BBD7513C442 for ; Fri, 12 Jan 2007 18:00:36 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0CI0a0V043012 for ; Fri, 12 Jan 2007 18:00:36 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0CI0aVl043011; Fri, 12 Jan 2007 18:00:36 GMT (envelope-from gnats) Date: Fri, 12 Jan 2007 18:00:36 GMT Message-Id: <200701121800.l0CI0aVl043011@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Andriy Gapon Cc: Subject: Re: kern/106432: Record of disks (DVD-R) through the k3b program leads to lag of system X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andriy Gapon List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jan 2007 18:00:37 -0000 The following reply was made to PR kern/106432; it has been noted by GNATS. From: Andriy Gapon To: bug-followup@FreeBSD.org, andrew@dobrohot.org, h.eichmann@gmx.de Cc: Subject: Re: kern/106432: Record of disks (DVD-R) through the k3b program leads to lag of system Date: Fri, 12 Jan 2007 19:57:06 +0200 I would like to followup on the portion of this PR that says that k3b shows incorrect speed list in its "Speed" drop-down for DVD media. I have this problem as well and I think that I found a reason. The following lines from k3b debug output raised my suspicion: k3b: (K3bDevice::openDevice) open device /dev/pass0 succeeded. k3b: (K3bDevice::ScsiCommand) transport command ac, length: 12 k3b: (K3bDevice::openDevice) open device /dev/pass0 succeeded. k3b: (K3bDevice::ScsiCommand) transport command ac, length: 10 k3b: (K3bDevice::Device) /dev/cd0: Number of supported write speeds via GET PERFORMANCE: 7 k3b: (K3bDevice::Device) /dev/cd0 : 13854 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s k3b: (K3bDevice::Device) /dev/cd0 Invalid DVD speed: 0 KB/s It seems that the second 0xAC (GET PERFORMANCE) command was sent as 10-byte command instead of correct 12-byte command. I've checked the sources of k3b and dvd+rw-mediainfo and they both send two 0xAC commands , first one is to query number of writing profiles and the second one is to actually get them. Only dvd+rw-mediainfo does it correctly and k3b does it incorrectly. The problem is in libk3bdevice/k3bdevice_mmc.cpp file, method K3bDevice::Device::getPerformance(): the code assumes that some bytes in cmd[] will survive the first execution and so they do not need to be set again. This might be an incorrect assumption. So I changed the corresponding lines so that they look like follows: [[[[]]]] int numDesc = (dataLen-8)/16; cmd[0] = MMC_GET_PERFORMANCE; cmd[1] = dataType; cmd[2] = lba >> 24; cmd[3] = lba >> 16; cmd[4] = lba >> 8; cmd[5] = lba; cmd[8] = numDesc>>8; cmd[9] = numDesc; cmd[10] = type; cmd[11] = 0; // Necessary to set the proper command length [[[[]]]] Now everything is correct: k3b: (K3bDevice::openDevice) open device /dev/pass0 succeeded. k3b: (K3bDevice::ScsiCommand) transport command ac, length: 12 k3b: (K3bDevice::openDevice) open device /dev/pass0 succeeded. k3b: (K3bDevice::ScsiCommand) transport command ac, length: 12 k3b: (K3bDevice::Device) /dev/cd0: Number of supported write speeds via GET PERFORMANCE: 7 k3b: (K3bDevice::Device) /dev/cd0 : 22161 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 22160 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 16621 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 16620 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 11081 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 11080 KB/s k3b: (K3bDevice::Device) /dev/cd0 : 5540 KB/s And I see the correct list in GUI drop-down too. Before that I had to always set DVD writing speed to "Ignore", so that k3b wouldn't try to force some unnatural speed on my DVD drive. -- Andriy Gapon