libcdio-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-help] Re: libcdio-0.78.2 fails with adaptec and plextor on linu


From: R. Bernstein
Subject: [Libcdio-help] Re: libcdio-0.78.2 fails with adaptec and plextor on linux 2.6.21.3
Date: Sun, 27 May 2007 16:55:08 -0400 (EDT)
User-agent: SquirrelMail/1.4.9a

Here's what I think is going on. The CD has two sessions written on it.
The second is empty. The first one has the audio. libcdio is getting
messed up on the second session.

Try running cd-info and send that output. My guess is that you'll see the
track data from the first session and it will match the information from
cdparanoia with the following transformations. the cd-info track numbers
may be one more than the cdparanoia numbers and there will be two seconds
added to libcdio. There is other important information that would be
interesting if you get this far. The disk mode and the last session
reported. Here's an example:

cd-info
...

Disc mode is listed as: CD-DA
                        ^^^^^

CD-ROM Track List (1 - 16)
  #: MSF       LSN    Type   Green? Copy? Channels Premphasis?
  1: 00:02:00  000000 audio  false  no    2        no
  2: 01:41:07  007432 audio  false  no    2        no
 ...
 16: 67:43:12  304587 audio  false  no    2        no
170: 78:47:00  354375 leadout (794 MB raw, 794 MB formatted)
Media Catalog Number (MCN):
Last CD Session LSN: 0
^^^^^^^^^^^^^^^^^^^^^^^

To compare with cdparanoia output

  1.     7432 [01:39.07]        0 [00:00.00]    no   no  2
 ...
TOTAL  354375 [78:45.00]    (audio only)

So 01:39:07 in cdparanoia is 01:41:07 in libcdio and 78:45:00 is 78:47:00.

> Hello,
>
> After applying patch, a.out still has random data as shown in these lines:
> On 1st run:
>                 CDROM sensed: /dev/cdr om", {st_mode=S_ IFBL SCSI CD-ROM
> On 2nd run:
>                 CDROM sensed: Xxð·0   SCSI CD-ROM
> On 3rd run:
>                 CDROM sensed: ÿÿÿÿÿÿÿÿ
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ SCSI CD-ROM
>
> Here are the two strace outputs you requested:
>
> BEGIN trace of cdparanoia you requested
> lstat64("/dev/sr0", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...}) =
> 0
> open("/dev/sr0", O_RDONLY|O_NONBLOCK)   = 3
> ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0xbfcb95f4) = 0
> ioctl(3, SCSI_IOCTL_GET_BUS_NUMBER, 0xbfcb95f0) = 0
> --
> open("/dev/sga", O_RDONLY|O_NONBLOCK)   = -1 ENOENT (No such file or
> directory)
> open("/dev/sg1", O_RDONLY|O_NONBLOCK)   = 4
> ioctl(4, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0xbfcb95f4) = 0
> ioctl(4, SCSI_IOCTL_GET_BUS_NUMBER, 0xbfcb95f0) = 0
> --
> Looking at revision of the SG interface in use...
> ) = 89
> ioctl(4, SG_GET_VERSION_NUM, 0xbfcb9728) = 0
> write(2, "\tSG interface version 3.5.34; OK"..., 34     SG interface
> version 3.5.34; OK.
> ) = 34
> ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0xbfcb9724) = 0
> ioctl(3, SCSI_IOCTL_GET_BUS_NUMBER, 0xbfcb9720) = 0
> --
> Checking for SCSI emulation...
> ) = 32
> ioctl(4, SG_EMULATED_HOST, 0xbfcb98a8)  = 0
> --
> read(4, "0\0\0\0000\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 48) =
> 48
> rt_sigprocmask(SIG_UNBLOCK, [], NULL, 8) = 0
> ioctl(3, CDROMMULTISESSION or SNDRV_SEQ_IOCTL_GET_CLIENT_INFO, 0xbfcb9844)
> = 0
> ioctl(4, SG_GET_RESERVED_SIZE, 0xbfcb98a4) = 0
> ioctl(4, SG_GET_SG_TABLESIZE, 0xbfcb98a8) = 0
> --
>
> ) = 57
> ioctl(4, SG_SET_COMMAND_Q, 0xbfcb98a4)  = 0
> END trace
>
> **************************************************************************************
>
> BEGIN trace of cd-paranoia (using libcdio with both patches)
> stat64("/dev/cdrom", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...})
> = 0
> open("/dev/cdrom", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
> ioctl(3, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) =
> 3701743
> --
> stat64("/dev/cdrom", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...})
> = 0
> open("/dev/cdrom", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 4
> ioctl(4, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) =
> 3701743
> --
> stat64("/dev/sr0", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...}) =
> 0
> open("/dev/sr0", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 5
> ioctl(5, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) =
> 3701743
> --
> stat64("/dev/sr0", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...}) =
> 0
> open("/dev/sr0", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 4
> ioctl(4, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) =
> 3701743
> --
> stat64("/dev/cdrom", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...})
> = 0
> open("/dev/cdrom", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
> ioctl(3, CDROMREADTOCHDR, 0x805ae0c)    = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a95c)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a968)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a974)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a980)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a98c)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a998)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9a4)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9b0)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9bc)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9c8)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9d4)  = 0
> --
> stat64("/dev/sr0", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...}) =
> 0
> open("/dev/sr0", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
> ioctl(3, CDROMREADTOCHDR, 0x805ae0c)    = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a95c)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a968)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a974)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a980)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a98c)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a998)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9a4)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9b0)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9bc)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9c8)  = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a9d4)  = 0
> --
> open("/dev/sr0", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
> stat64("/dev/sr0", {st_mode=S_IFBLK|0660, st_rdev=makedev(11, 0), ...}) =
> 0
> ioctl(3, CDROM_SEND_PACKET, 0xbfd6df60) = 0
> --
>
> ) = 60
> ioctl(3, CDROMREADTOCHDR, 0x805ae0c)    = 0
> ioctl(3, CDROMREADTOCENTRY, 0x805a95c)  = -1 ENOMEDIUM (No medium found)
> END trace
>
>
> On 5/28/07, R. Bernstein <address@hidden> wrote:
>> With CDROM sensed problem you are coming across another place where
>> libcdio is accessing uninitialized data. The patch below should fix
>> this.
>>
>> The real problem is that the ioctls are failing. It probably has to do
>> with the fact that you have SCSI drives. Does cd-parnaoia (from libcdio)
>> show the tracks of the drive? Issue cd-paranoia -vsQ to see. And compare
>> with
>>
>> Also interesting would be to compare the status of the ioctl's report,
>> and
>> with that we need to know what device is used with that. On my system
>> the
>> file descriptors are always 4 so we need the open that returns 4.
>>
>> So try running these commands
>>
>>   strace cdparanoia  -vsQ 2>&1 | grep -B 2 '^ioctl('
>> and libcdio's version:
>>   strace cd-paranoia  -vsQ 2>&1 | grep -B 2 '^ioctl('
>>
>> For comparison, here's what I get on my GNU/Linux box where I don't have
>> a
>> problem.
>>
>> strace cdparanoia  -vsQ 2>&1 | grep -B 2 '^ioctl('
>> close(4)                                = 0
>> open("/dev/hdc", O_RDONLY|O_NONBLOCK)   = 4
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this line is important
>> ioctl(4, CDROMVOLREAD, 0xbff9a6c0)      = 0
>> ioctl(4, 0x30d, 0x8058088)              = 0
>> --
>>
>> ) = 58
>> ioctl(4, CDROMREADTOCHDR, 0xbff9a6ba)   = 0
>> ioctl(4, CDROMREADTOCENTRY, 0xbff9a6ac) = 0
>> ioctl(4, CDROMREADTOCENTRY, 0xbff9a6ac) = 0
>>
>>
>> and
>>
>> strace cd-paranoia  -vsQ 2>&1 | grep -B 2 '^ioctl('
>> stat64("/dev/cdrom", {st_mode=S_IFBLK|0660, st_rdev=makedev(22, 0),
>> ...}) =
>> 0
>> open("/dev/cdrom", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 4
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is helpful
>> ioctl(4, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) =
>> 2228207
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this line failed
>> ioctl(4, CDROMREADTOCHDR, 0x805ae0c)    = 0
>> ioctl(4, CDROMREADTOCENTRY, 0x805a95c)  = 0
>> ioctl(4, CDROMREADTOCENTRY, 0x805a968)  = 0
>> ioctl(4, CDROMREADTOCENTRY, 0x805a974)  = 0
>> ioctl(4, CDROMREADTOCENTRY, 0x805a980)  = 0
>> ioctl(4, CDROMREADTOCENTRY, 0x805a98c)  = 0
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ these lines didn't fail
>>
>> > Hello,
>> >
>> >     I have GNU libc 2.3.6 and use compiler GNU gcc 4.0.4.  After
>> > applying your patch and rebuilding libcdio, the segfault problem is
>> > cured.  However, my CD-ROM drive is still unusuable.  The sample
>> > program output this:
>> >
>> > bash-3.2$ ./a.out /dev/sr0
>> > Trying to open device '/dev/sr0', using default access mode.
>> > Checking /dev/sr0 for cdrom...
>> >                 CDROM sensed: <   SCSI CD-ROM
>> >
>> > ++ WARN: error in ioctl CDROMREADTOCHDR: No medium found
>> >
>> >
>> > Attempting to determine drive endianness from data...
>> >         Cannot determine CDROM drive endianness.
>> > bash-3.2$
>> >
>> > On the line that says "CDROM sensed: <   SCSI CD-ROM" the part between
>> > the colon and the word SCSI seems to be randomly changed each time I
>> run
>> > the program.  Here is the program run again just a second later with
>> the
>> > same
>> > CD still in the drive:
>> > bash-3.2$ ./a.out /dev/sr0
>> > Trying to open device '/dev/sr0', using default access mode.
>> > Checking /dev/sr0 for cdrom...
>> >                 CDROM sensed: ÿÿÿÿÿÿÿÿ
>> > ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ SCSI CD-ROM
>> >
>> > ++ WARN: error in ioctl CDROMREADTOCENTRY for track 162: No medium
>> found
>> >
>> >
>> > Attempting to determine drive endianness from data...
>> >         Cannot determine CDROM drive endianness.
>> > bash-3.2$
>> >
>> > Also note it is a different ioctl this time.
>> >
>> > JGH
>> >
>> > On 5/27/07, R. Bernstein <address@hidden> wrote:
>> >> I said..
>> >>  > ... As for more
>> >>  > information, well, the thing that may be interesting is the OS, OS
>> >>  > release number, and version of libc (Standard C library) that you
>> are
>> >>  > using.
>> >>
>> >> About the OS and release number... Sorry I do see that. From this I
>> >> imagine that libc is also pretty new.
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> Libcdio-help mailing list
>> >> address@hidden
>> >> http://lists.gnu.org/mailman/listinfo/libcdio-help
>> >>
>> >
>>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]