From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Apr 6 06:00:06 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82C9B106567C for ; Mon, 6 Apr 2009 06:00:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 572BE8FC21 for ; Mon, 6 Apr 2009 06:00:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n36606Jm005553 for ; Mon, 6 Apr 2009 06:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n36606ap005551; Mon, 6 Apr 2009 06:00:06 GMT (envelope-from gnats) Resent-Date: Mon, 6 Apr 2009 06:00:06 GMT Resent-Message-Id: <200904060600.n36606ap005551@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, baileygeoff@telus.net Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0795106567D for ; Mon, 6 Apr 2009 05:59:00 +0000 (UTC) (envelope-from geoff@cangeordie.com) Received: from defout.telus.net (defout.telus.net [204.209.205.13]) by mx1.freebsd.org (Postfix) with ESMTP id 776388FC1C for ; Mon, 6 Apr 2009 05:59:00 +0000 (UTC) (envelope-from geoff@cangeordie.com) Received: from priv-edtnaa06.telusplanet.net ([207.81.164.151]) by priv-edtnes25.telusplanet.net (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090406054047.XJML23170.priv-edtnes25.telusplanet.net@priv-edtnaa06.telusplanet.net>; Sun, 5 Apr 2009 23:40:47 -0600 Received: from uzyod.ca (d207-81-164-151.bchsia.telus.net [207.81.164.151]) by priv-edtnaa06.telusplanet.net (BorderWare Security Platform) with ESMTP id A0B30A21340B83F1; Sun, 5 Apr 2009 23:40:47 -0600 (MDT) Received: (from geoff@localhost) by uzyod.ca (8.14.3/8.14.3/Submit) id n365ePRn001624 for geoffrey@telus.net; Sun, 5 Apr 2009 22:40:25 -0700 (PDT) (envelope-from geoff) Message-Id: <200904060540.n365ePRn001624@uzyod.ca> Date: Sun, 5 Apr 2009 22:40:25 -0700 (PDT) From: baileygeoff@telus.net To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: mich@FreeBSD.org Subject: ports/133414: [patch] sysctls/libcdio-0.78.2 is broken for CDROM's that don't support media-changed notification. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: baileygeoff@telus.net List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 06:00:06 -0000 >Number: 133414 >Category: ports >Synopsis: [patch] sysctls/libcdio-0.78.2 is broken for CDROM's that don't support media-changed notification. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 06 06:00:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Geoff Bailey >Release: FreeBSD 7.1-RELEASE i386 >Organization: >Environment: sysctls/libcdio-0.78.2_2 used by multimedia/audacious-1.5.1_3 System: FreeBSD uzyod 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: 1. The function get_media_changed_freebsd(), in lib/driver/FreeBSD/freebsd.c, returns DRIVER_OP_UNSUPPORTED for my NEC-28D CDROM device. The lshal program shows: 'storage.cdrom.support_media_changed = false' for this device. This causes the Audacious Media Player's cdaudio-ng plugin to only load the first track of a CD in the playlist. The problem is solved if this function returns 0 (not changed) for unsupported devices instead of DRIVER_OP_UNSUPPORTED. While the player may not be able to detect media changes under these circumstances, it at least remains functional for older drives. I have attached 'patch-lib_driver_FreeBSD_freebsd.c' which makes the the requested change. It also adds a few lines to set access_mode='ioctl' if the atapi (/dev/acd0) driver is being used by the the application. 2. The read_audio_sectors_freebsd_ioctl() function, in lib/driver/FreeBSD/freebsd_ioctl.c, calls the CDIOCREADAUDIO ioctl, which has been deprecated for some time. However, this call can be easily replaced with a CDRIOCSETBLOCKSIZE ioctl call followed by a pread() call. Since the atapicd driver is in the generic kernel and the atapicam driver module must be explicitly loaded, this simple fix to the atapi ioctl interface will allow programs (such as Audacious) to function 'out of the box'. I have attached 'patch-lib_driver_FreeBSD_freebsd_ioctl.c' which makes the requested changes. >How-To-Repeat: >Fix: please see atached patches: 'patch-lib_driver_FreeBSD_freebsd.c' 'patch-lib_driver_FreeBSD_freebsd_ioctl.c' >Release-Note: >Audit-Trail: >Unformatted: