The old Readblock value is fine for data tracks, because 4 2048 byte blocks fit in the 8192 byte RPCMAX. But cdda blocks are 2352 bytes and 4 of those don't fit into 8192 bytes and stuff breaks. If I read the code correctly my change should set the number of blocks to 4 for data tracks and to 3 for everything else. I've attached the patch to this mail to preserve whitespace. > ori@eigenstate.org hat am 01.10.2022 21:20 GMT geschrieben: > > > Quoth Arne Meyer : > > The Readblock enum does not work when you try to read audio cds. 4 > > cdda blocks are lager than 8192 and the command fails (at least when > > using an usb cd drive). This sets the block count according to the > > track block size. With this and the fix for libdisk I can rip audio > > cds on my el cheapo usb dvd drive. Tested with "Midnight Oil - Blue > > Sky Mining" > > Greetings, > > Arne > > > > > > typedef struct Buf Buf; > > --- a/sys/src/cmd/cdfs/mmc.c > > +++ b/sys/src/cmd/cdfs/mmc.c > > @@ -1171,7 +1171,7 @@ > > o->track = &drive->track[trackno]; > > o->nchange = drive->nchange; > > o->omode = OREAD; > > - o->buf = bopen(mmcread, OREAD, o->track->bs, Readblock); > > + o->buf = bopen(mmcread, OREAD, o->track->bs, Maxrpc/o->track->bs); > > these changes smell funny to me; if the block size is larger than Maxrpc, we > set nblock to 0. Looking at bread in buf.c, it seems like we'd simplly end up > trying to read 0 bytes out of these large buffers.