Re: libdvdread: Can't seek to block 256

H}kan Hjort <[email protected]>
Newsgroups gmane.comp.video.ogle.user
Message-ID <[email protected]>
Mon Dec 08 2003, Felix Kurth wrote:
> Hi 
> 
> using kernel 2.6.0-test11, i encounter, the following by invoking:
> tcprobe -i /dev/dvd
> (of course xine is broken too)
> 
(I'm not sure what tcprobe is but anyway...)

> libdvdread: Using libdvdcss version 1.2.8 for DVD access
> libdvdread: Can't seek to block 256
> libdvdread: Can't seek to block 256
> libdvdread: Can't open file VIDEO_TS.IFO.
> (iodump.c) unable to open directory "/dev/dvd"
> 
> im not using ide-scsi, since its deprecaded on that kernel, also cd/dvd
> -burning ist broken with it. (Tried it with ide-scsi, dvd-reading does
> work, but not cd-burning)
> 
dvd-reading with tcprobe or just mount ls/cp and such?


> at last, here is the output of a strace:
> 
[-snip-]
> felix@~ 116 files 81Mb -> strace tcprobe -i /dev/dvd
> open("/dev/dvd", O_RDONLY|O_LARGEFILE)  = 3
> fstat64(3, {st_mode=S_IFBLK|0600, st_rdev=makedev(22, 0), ...}) = 0
> ioctl(3, 0x5390, 0xbfffbf30)            = 0
> read(3, "", 2048)                       = 0
> _llseek(3, 0, [0], SEEK_SET)            = 0
> _llseek(3, 524288, 0xbfffc5a0, SEEK_SET) = -1 EINVAL (Invalid argument)
> write(2, "libdvdread: Can\'t seek to block "..., 36libdvdread: Can't seek to
> block 256
> ) = 36

_llseek(3, 524288, 0xbfffc5a0, SEEK_SET) = -1 EINVAL

Well reading the man page

       int _llseek(unsigned int fd, unsigned long offset_high,  unsigned  long
       offset_low, loff_t *result, unsigned int whence);

       The  _llseek  function repositions the offset of the file descriptor fd
       to (offset_high<<32) | offset_low bytes relative to  the  beginning  of
       the  file,  the  current  position in the file, or the end of the file,
       depending on whether whence is SEEK_SET, SEEK_CUR, or SEEK_END, respec-
       tively.

So the offset seems to be awfully large here... much larger than the DVD
could possibly be... in fact it's close to INT_MAX Mbyte.

I'm no sure what could be causing this, some possiblilities are wrong/buggy
code in libdvdread, in libdvdcss, in the dvdcss.h file, the Makefile of
either of these packages, a compiler bug (i.e. gcc misscompiling it), a
broken gnulibc header, broken largefile system code in gnulibc, a kernel
bug.

So which of these can we rule out?

> so the problem is related to the atapi stuff ?

Well it would seem so if it all the same binaries work when using ide-scsi.

> Drive is a brand new Plextor PX708A DVD+-RW.
> If more information are needed please contact me. I tried to debug
> libdvdread, recompiled transcode and libdvdread with -g, but i had no fun,
> since gdb crashed very often (GNU gdb 5.3). So i gave up. Maybe i should
> try it again with some help. Or is this a kernel bug that i should report ?
> 
> has anybody an idea/fix ?

You could try to write out the block offset value in the
UDFReadBlocksRaw function just before it calls dvdinput_seek.  
and/or inside the css_seek() wrapper function 
and/or inside libdvdcss's dvdcss_seek() (see src/libdvdcss.c)
and/or inside it's various pf_seek() implementations.  For you it
would probably be libc_seek (device.c).  The cast/multiplication from
int (blocks) to off_t is in the libc_seek function...

-- 
Håkan Hjort
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.