Skip to content

Add data support 0 4 1#34

Open
danifunker wants to merge 3 commits intoBloomca:mainfrom
danifunker:add-data-support-0-4-1
Open

Add data support 0 4 1#34
danifunker wants to merge 3 commits intoBloomca:mainfrom
danifunker:add-data-support-0-4-1

Conversation

@danifunker
Copy link
Copy Markdown

I can't recall why I made my code changes, but I think it was to support mixed data/audio CDs and have it working correctly for lookups on musicbrainz.

I'm not sure if you want this, but figured I should submit it.

I recently rebased my changes against your branch without any issues as well. I believe this was mostly AI written just a heads up.

I had to resolve the issues with the MacOS build, but it seems to be working now.

google-labs-jules Bot and others added 3 commits May 5, 2026 13:36
- Added missing IOKit SCSI headers to shim_common.h.
- Implemented SCSI Task Device initialization in device_service.c by traversing the IORegistry parent chain.
- Corrected the SCSI transfer direction in data_reader.c.
- These changes restore the ability to perform direct SCSI commands for data sector reading on macOS.

Co-authored-by: danifunker <1643018+danifunker@users.noreply.github.com>
- Replaced `kIOMediaClass` with `kIOCDMediaClass` for compatibility.
- Replaced deprecated `kIOMasterPortDefault` with `kIOMainPortDefault`.
- Replaced undeclared `S32` with the correct `SInt32` type.
- Retained previous fixes: added missing SCSI headers, implemented device session initialization by traversing IORegistry, and corrected SCSI transfer direction for READ CD.
- These changes ensure the new data reader works correctly on modern macOS versions.

Co-authored-by: danifunker <1643018+danifunker@users.noreply.github.com>
…4448739249

Add data support fix 12974352404448739249
@Bloomca
Copy link
Copy Markdown
Owner

Bloomca commented May 7, 2026

@danifunker hey, thanks, I will review in a couple of days!

I think it was to support mixed data/audio CDs and have it working correctly for lookups on musicbrainz.

Do you mean enhanced CDs? The ones which contain some data tracks?

I actually was debugging my own CD ripper app (it failed on some CDs), and it turns out that the calculation of the leadout LBA for the last audio track is a bit different if there are data tracks. They actually mention it in musicbrainz docs -- you are supposed to get the start LBA of the data track, and subtract 152 seconds, or 11400 frames. It is described somewhere in the SCSI standard for audio CD extension -- something like 60 seconds gap, 90 seconds buffer between audio and data, and another 2 seconds gap similar to one when we start reading regular data.

@danifunker
Copy link
Copy Markdown
Author

Very cool! Please keep me posted on this. I actually extended this initially to support classic CD-ROM games which shipped with CD audio support. Think mid to late 90s games for PC. I know it is a bit of an obscure use case, but for the app I was writing, it was important. I was able to lookup the jewel case by getting the name of the disc through musicbrainz then queries discogs to find the title of the game to get the cd cover art.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants