Date: Thu, 06 Nov 2003 01:34:50 -0000 From: Simon Barner <barner@in.tum.de> To: freebsd-ports-bugs@FreeBSD.org, vkushnir@Alfacom.net, fjoe@iclub.nsu.ru, corecode@corecode.ath.cx Subject: Re: ports/57226: audio/cdparanoia fix to work with cooked_ioctl under -CURRENT Message-ID: <20031106013446.GA25025@zi025.glhnet.mhn.de> In-Reply-To: <86llqupkad.wl@gray.plala.or.jp> References: <200311050450.hA54oLUA027741@freefall.freebsd.org> <20031105130540.GB411@zi025.glhnet.mhn.de> <86llqupkad.wl@gray.plala.or.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
[ 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031106013446.GA25025>