Bug 45589 - cdrtools 2.01_alpha27 (~x86): dvdr patches break cdrw
Bug#: 45589 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: pylon@gentoo.org Reported By: mseigneurin@aliceadsl.fr
Component: Applications
URL: 
Summary: cdrtools 2.01_alpha27 (~x86): dvdr patches break cdrw
Keywords:  
Status Whiteboard: 
Opened: 2004-03-24 04:44 0000
Description:   Opened: 2004-03-24 04:44 0000
I've had some problems very recently with cdrecord (from the above ebuild).
I could blank a cd/rw, but not write to it. cdrecord kept saying
"Error trying to open /dev/sg0 exclusivly (Operation not permitted)..."

The patch (cdrtools-2.01a27-o_excl.patch) makes the following calls:
open(device, O_RDONLY|O_NONBLOCK|O_EXCL);
which according to this: [http://www.torque.net/sg/p/sg_v3_ho.html#OPEN] is illegal.
Removing that patch yielded other errors (writemode broken: cdrecord tried TAO when DAO was specified).

Adding -dvdr to USE flags "fixes" this, but the logic seems flawed. I think it would be better to require "dvdr" in the USE flags if people have this kind of HW rather than adding the feature unless explicitly removed with the '-dvdr'

(better solution would probably be to fix the patches, but i'm not sure I would manage that)

Reproducible: Always
Steps to Reproduce:
1. cdrecord -prcap dev=0,0,0
(should list device capabilities if 0,0,0 is the dev id.)
Actual Results:  
Error trying to open /dev/sg0 exclusivly (Operation not permitted)...

Expected Results:  
list device capabilities

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.6.4-mm2)
=================================================================
System uname: 2.6.4-mm2 i686 Intel(R) Pentium(R) 4 CPU 3.06GHz
Gentoo Base System version 1.4.3.13p1
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=pentium4 -march=pentium4 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -mcpu=pentium4 -march=pentium4 -funroll-loops -pipe"
DISTDIR="/shared/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://212.219.247.11/sites/www.ibiblio.org/gentoo/
http://212.219.247.10/sites/www.ibiblio.org/gentoo/
http://212.219.247.12/sites/www.ibiblio.org/gentoo/
http://212.219.247.16/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib acpi alsa apache2 apm arts avi berkdb cdr crypt cups directfb
doc dv dvb dvd encode esd ethereal ext-png ext-zlib fam fbcon ffmpeg fftw flash
foomaticdb freetype fs gdbm ggi gif glut gpm gtk gtk2 gtkhtml guile imagemagick
imlib imlib2 java javascript jpeg lcd lcms libg++ libwww lids mad mikmod mmx
motif mozilla moznoirc moznoxft mpeg music ncurses nls nptl offensive oggvorbis
opengl openssh oss pam pdflib perl pic png python quicktime radeon readline
scanner sdl slang spell sse ssl svga tcltk tcpd tetex tiff transcode truetype
usb videos wmf x86 xfs xine xml2 xmms xosd xv xvid zlib"

[-dvdr added to fix this]

------- Comment #1 From Lars Weiler (RETIRED) 2004-03-24 18:33:41 0000 -------
I will check, if the author of the patch has some new information or patches. 
Also I will check it on my system (with a built-in CD/DVD-writer).

------- Comment #2 From SpanKY 2004-04-05 23:10:32 0000 -------
*** Bug 46257 has been marked as a duplicate of this bug. ***

------- Comment #3 From SpanKY 2004-04-05 23:13:44 0000 -------
*** Bug 46667 has been marked as a duplicate of this bug. ***

------- Comment #4 From SpanKY 2004-04-05 23:14:26 0000 -------
the patches also break bin/cue burning :(

------- Comment #5 From Lars Weiler (RETIRED) 2004-04-18 18:57:52 0000 -------
After reading all related bugs, I tested some things.

First, I can do cdrecord -prcap with dev=ATAPI:0,0,0 which points to my DVD-writer.  With dev=0,0,0 I get this /dev/sg0 error (which is okay, as 0,0,0 is my SCSI-CD-ROM that can't work as an scsi generic device).

k3b also works fine without any change on the parameters.  Check if the System device name points to the correct dev-path.

Second, the cuefile writing also disappears after using -dvdr.  This is really stupid to add dvdr-capabilities, but remove proper writing of cdr...

I will remove all the dvdr-stuff in cdrecord.  Who wants to write dvds should use cdrecord-prodvd or the dvd+rw-tools.  All in all most users I know use k3b as the graphical frontend.  This one needs no patches on cdrtools and uses other applications for dvd-writing.

cdrtools-2.01_alpha27-r1 builds now without dvdr-patches.

------- Comment #6 From CJ Kucera 2004-05-24 14:08:33 0000 -------
It'd be nice to have some version available which uses the DVD-writing patches
that were removed...  These are the only patches that actually work on my DVD
burner; I've tried all the other ones with no success at all.  I can always
just build it by hand, of course, but it'd be nice to have it in Portage
somewhere.