From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Nov 5 17:34:50 2003 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F10216A4CE for ; Wed, 5 Nov 2003 17:34:50 -0800 (PST) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE6AF43FE9 for ; Wed, 5 Nov 2003 17:34:48 -0800 (PST) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id 08D586D; Thu, 6 Nov 2003 02:34:46 +0100 (CET) From: Simon Barner To: freebsd-ports-bugs@FreeBSD.org, vkushnir@Alfacom.net, fjoe@iclub.nsu.ru, corecode@corecode.ath.cx Message-ID: <20031106013446.GA25025@zi025.glhnet.mhn.de> References: <200311050450.hA54oLUA027741@freefall.freebsd.org> <20031105130540.GB411@zi025.glhnet.mhn.de> <86llqupkad.wl@gray.plala.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86llqupkad.wl@gray.plala.or.jp> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de Subject: Re: ports/57226: audio/cdparanoia fix to work with cooked_ioctl under -CURRENT X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Thu, 06 Nov 2003 01:34:50 -0000 X-Original-Date: Thu, 6 Nov 2003 02:34:46 +0100 X-List-Received-Date: Thu, 06 Nov 2003 01:34:50 -0000 [ Added Cc for maintainer of the cdparanoia port and Max Khon who posted the patch on current@. Credits: vkushnir@Alfacom.net -- originator of the patch fjoe@iclub.nsu.ru -- unified version for 4.x and 5.x barner@in.tum.de -- added CDRIOCSETBLOCKSIZE, integration and testing ] > It would be great if we stop using CDIOCREADAUDIO in all case and > migrate to CDRIOCSETBLOCKSIZE which has been available since > 4.0-RELEASE. Ah, good to know. I wanted to research on that anyway. > Or it just doesn't work on non-current system? It works fine for me. Here is a version of Max Khon's patch that he posted on current@. I used also CDRIOCSETBLOCKSIZE, as you requested. The is no measurable performance gain when I omit that ioctl, and I don't know what might happen if the block size is not set every time. Tested on -stable and -current diff -ruN cdparanoia/Makefile cdparanoia.patched/Makefile --- cdparanoia/Makefile Mon Jul 14 04:52:55 2003 +++ cdparanoia.patched/Makefile Thu Nov 6 01:49:47 2003 @@ -7,7 +7,7 @@ PORTNAME= cdparanoia PORTVERSION= 3.9.8 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= audio sysutils MASTER_SITES= http://www.xiph.org/paranoia/download/ DISTNAME= ${PORTNAME}-${PORTVERSION:C/^3\./III-alpha/} diff -ruN cdparanoia/files/patch-interface-cooked_interface.c cdparanoia.patched/files/patch-interface-cooked_interface.c --- cdparanoia/files/patch-interface-cooked_interface.c Sat Jan 11 10:15:00 2003 +++ cdparanoia.patched/files/patch-interface-cooked_interface.c Thu Nov 6 01:54:16 2003 @@ -1,11 +1,5 @@ -Index: interface/cooked_interface.c -=================================================================== -RCS file: /home/cvs/cdparanoia/interface/cooked_interface.c,v -retrieving revision 1.1.1.1 -retrieving revision 1.8 -diff -u -r1.1.1.1 -r1.8 ---- interface/cooked_interface.c 2003/01/05 09:46:26 1.1.1.1 -+++ interface/cooked_interface.c 2003/01/11 08:58:45 1.8 +--- interface/cooked_interface.c.orig Thu Apr 20 00:41:04 2000 ++++ interface/cooked_interface.c Thu Nov 6 01:53:25 2003 @@ -1,6 +1,8 @@ /****************************************************************** * CopyPolicy: GNU Public License 2 applies @@ -23,7 +17,7 @@ static int cooked_readtoc (cdrom_drive *d){ int i; int tracks; -@@ -129,6 +132,128 @@ +@@ -129,6 +132,122 @@ return(sectors); } @@ -96,18 +90,12 @@ +cooked_read(cdrom_drive *d, void *p, long begin, long sectors) +{ + int retry_count = 0; -+ struct ioc_read_audio arg; -+ -+ if (sectors > d->nsectors) -+ sectors = d->nsectors; -+ -+ arg.address_format = CD_LBA_FORMAT; -+ arg.address.lba = begin; -+ arg.buffer = p; ++ int bsize = CD_FRAMESIZE_RAW; + + for (;;) { -+ arg.nframes = sectors; -+ if (ioctl(d->ioctl_fd, CDIOCREADAUDIO, &arg) == -1) { ++ if (ioctl(d->ioctl_fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) ++ return -7; ++ if (pread(d->ioctl_fd, p, sectors*bsize, begin*bsize) != sectors*bsize) { + if (!d->error_retry) + return -7; + @@ -152,7 +140,7 @@ /* hook */ static int Dummy (cdrom_drive *d,int Switch){ return(0); -@@ -193,6 +318,7 @@ +@@ -193,6 +312,7 @@ int cooked_init_drive (cdrom_drive *d){ int ret; @@ -160,7 +148,7 @@ switch(d->drive_type){ case MATSUSHITA_CDROM_MAJOR: /* sbpcd 1 */ case MATSUSHITA_CDROM2_MAJOR: /* sbpcd 2 */ -@@ -243,6 +369,9 @@ +@@ -243,6 +363,9 @@ default: d->nsectors=40; }