Open jengelh opened 2 days ago
So, okay, yes, this doesn't support physical discs, making a CD player app significantly less useful, but this program does work with a directory of MP3s[^1], like the INFO
lines say.
The reasons we dropped physical drive support:
The thinking is that faking audio discs with a directory of MP3s fixes up a generation of games that have CD audio tracks--like Quake 1, etc--for modern systems that might be able to play the game but can't even insert a physical disc.
Obviously all of this does not help tcd at all though. If we were to deal better with this, my thinking would be:
Right now sdl12-compat's entire CD subsystem runs on the expectation that there's either zero drives, or one fake drive, and all of that would need to get more generalized if we're going to drop platform-specific code in here to work with actual physical hardware.
I'm putting this in the next milestone, but I'm extremely likely to bump it back out, as this is low-priority for me. If someone else wants to take a run at it before I get around to it, I'm happy to help, though.
[^1]: I had to fix a buffer overflow in cddb.c's cddb_filename
where it ended up with a massively large value for discid
, presumably because somewhere it's trying to read real data from a Linux CD-ROM drive device node, outside of SDL, that doesn't exist, and long
went from 32 to 64 bits since tcd was written.
Lots of computers don't even have a CD/DVD drive anymore.
Rest assured we emulate it already ;-)
# readcd dev=/dev/disk/by-id/usb-TSSTcorp_CDDVDW_SE-208DB_R90V6GAD1006WH-0:0 f=fury3.readcd -clone
# modprobe vhba
# cdemu-daemon &
# cdemu load 0 fury3.readcd.toc
# cdrecord -dev=/dev/disk/by-id/scsi-1CDEmu_CD-ROM_000 -toc
first: 1 last 6
track: 1 lba: 0 ( 0) 00:02:00 adr: 1 control: 4 mode: -1
track: 2 lba: 100302 ( 401208) 22:19:27 adr: 1 control: 0 mode: -1
track: 3 lba: 124178 ( 496712) 27:37:53 adr: 1 control: 0 mode: -1
track: 4 lba: 137278 ( 549112) 30:32:28 adr: 1 control: 0 mode: -1
track: 5 lba: 154824 ( 619296) 34:26:24 adr: 1 control: 0 mode: -1
track: 6 lba: 179617 ( 718468) 39:56:67 adr: 1 control: 0 mode: -1
track:lout lba: 191631 ( 766524) 42:37:06 adr: 1 control: 0 mode: -1
FWIW, I have a super-hacky half-finished proof-of-concept to implement CD-audio using libcdio_paranoia — this does the digital audio extraction (so works with any modern CD/DVD/Blu-Ray drive), and then mixes it in the same way the mp3 implementation works.
I think, if I clean it up and update it to (a) not hang the audio thread while the drive is spinning up, and (b) make it dlopen() the cdio/cdio_paranoia libraries, then this could be a pretty good solution. (If we were building on top of SDL3's new audio API, this'd actually be really quite easy. As-is it'd be uglier, but not too bad if done carefully.)
Feel free to assign this to me if that sounds like a good plan, and I'll try to get something done over the holidays.
FWIW, I have a super-hacky half-finished proof-of-concept to implement CD-audio using libcdio_paranoia
Sure!
cdemu has audio output on its own, so I'd already be happy if SDL just sent the necessary ioctls :-)
Version: sdl12_compat-1.2.68, openSUSE Tumbleweed 20241129 amd64, tcd 2.2.0
Observed
Starting tcd with sdl12-compat-1.2.68 leads to program termination:
Expected to see instead
With SDL-1.2.15, tcd works fine: