CDROMPLAYTRKIND off by one?

Peter Samuelson (peter@wire.cadcamlab.org)
Wed, 1 Dec 1999 14:22:50 -0600 (CST)


Hi Jens and all,

`cdtool' is refusing to play the last track on any of my audio CDs
these days. In fact, it will always play one track less than I ask
for. I'm using late 2.3.x kernel with cdrom.o and ide-cd.o as
modules.

I think I tracked it down. `cdtool' is using CDROMPLAYTRKIND, which
passes in the first and last track to play. The following is from
drivers/cdrom/cdrom.c:

/* get toc entry for start and end track */
entry.cdte_track = ti.cdti_trk0;
if (cdi->ops->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
return -EINVAL;

cgc.cmd[3] = entry.cdte_addr.msf.minute;
cgc.cmd[4] = entry.cdte_addr.msf.second;
cgc.cmd[5] = entry.cdte_addr.msf.frame;

entry.cdte_track = ti.cdti_trk1;
if (cdi->ops->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
return -EINVAL;

cgc.cmd[6] = entry.cdte_addr.msf.minute;
cgc.cmd[7] = entry.cdte_addr.msf.second;
cgc.cmd[8] = entry.cdte_addr.msf.frame;

Looks to me like cgc.cmd[6] through cgc.cmd[8] are getting the
*beginning* of the last track, not the *end* of it. Right?

But now I'm lost. I looked around the CDROM code (even the 2.2 code)
but couldn't figure out an easy way to fix this. The CDROM code is not
at all hard to understand, but there are just too many packet formats
and ioctls for me to keep straight. Can someone who knows something
about these things please take it from here?

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/