From geoff@cangeordie.com  Mon Apr  6 05:59:01 2009
Return-Path: <geoff@cangeordie.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0795106567D
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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
Reply-To: baileygeoff@telus.net
To: FreeBSD-gnats-submit@freebsd.org
Cc: mich@freebsd.org
Subject: [patch]  sysctls/libcdio-0.78.2 is broken for CDROM's that don't support media-changed notification.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         133414
>Category:       ports
>Synopsis:       [patch] sysutils/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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 06 06:00:05 UTC 2009
>Closed-Date:    Thu Apr 30 11:21:15 UTC 2009
>Last-Modified:  Thu Apr 30 13:49:56 UTC 2009
>Originator:     Geoff Bailey <baileygeoff@telus.net>
>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:
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Thu Apr 30 11:20:47 UTC 2009 
State-Changed-Why:  
Duplicate PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133414 
>Unformatted:
