BGM CD (Background Music CD)

Anything relating to CD-i can be discussed in this forum. From the multiple hardware iterations of the system to the sofware including games, reference, music and Video CDs. Maybe you hold an interest in Philips Media and the many development houses set up to cater for CD-i if so then this is the forum.
jpagac
Burn:Cycle Activated
Posts: 2
Joined: Tue Oct 17, 2006 6:22 am

XA != ADPCM

Post by jpagac » Tue Oct 17, 2006 10:14 pm

XA (eXtended Architecture) has to do with the way data is placed on a CD. Specifically, raw data is on one sector, while headers and text are on a separate sector.
Muzak CDs are probably XA format - but that has nothing to do with decoding the audio data. First I need to decipher the audio - then work on the XA part.

User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Post by cdoty » Fri Aug 17, 2007 4:58 am

cdifan wrote:Try looking for the CD-ROM XA ADPCM format, it is a subset of the CD-i encoding (restricted sample rates and/or bitrates, I think). I believe FFMPEG is able to decode it; don't know if there is an open-source encoder for it...
I wonder if ACU Shell or Media Stockroom (from icdia.co.uk) decode mode would work on it?

These programs can create it.

You should be able to take the files from the disk using IsoBuster.
Visit RasterSoft on facebook or visit the website.

User avatar
cdifan
CD-i Emulator Author
Posts: 902
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Post by cdifan » Fri Aug 17, 2007 7:15 am

cdoty wrote:I wonder if ACU Shell or Media Stockroom (from icdia.co.uk) decode mode would work on it?
They should, otherwise the discs wouldn't play on stock CD-i hardware (which they did, in addition to the BGM players).

The files were not created with ACU Shell, though; much too slow. Codim used a hardware encoding board (very rare and treated with extreme care; I think it was produced by Sony).

User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Post by cdoty » Thu Aug 30, 2007 4:26 am

cdifan wrote:The files were not created with ACU Shell, though; much too slow. Codim used a hardware encoding board (very rare and treated with extreme care; I think it was produced by Sony).
That was then, this is now! :)

I wonder if a modern PC would be faster than the board today? It probably wouldn't take advantage of a multi-core processor, but in raw processing power alone it might blow the board away.
Visit RasterSoft on facebook or visit the website.

User avatar
cdifan
CD-i Emulator Author
Posts: 902
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Re: BGM CD (Background Music CD)

Post by cdifan » Tue Dec 27, 2016 11:22 pm

musicbymuzak wrote:I get the impression that the 76kb music player from 1995, included on every one of these discs, was based on the original 1989 CD-I music player application, adapted for AEI's purposes, and eventually supposed to enable sophisticated features on later machines. It seems to have provisions for recognising a non-AEI player (so it would crash a home CD-I player; it won't work when I try to get a CD-I emulator to run it), "expiring" a disc based on date-time, enable different remix sequences based on the day; and relies on three files to tell it what to do.
What CD-I emulator did you use, and how does it crash? If I had a sample disc, I could probably do some reverse engineering. The original BGM discs did play on "regular" CD-I players, as far as I know.
musicbymuzak wrote: "RemixSEQ" tells it to sequence a set of four folders (CBCACDC for example, if folder "C" contained popular music and "B" not so much); and "BGMINDEX" may act like a TOC, that tells the player where each song is within the folders in the MUSIC suitcase. "PATH_TBL" may be for defining paths.
The "PATH_TBL" file is usually the "path table" that defines paths to all the directories on the disc, its format is defined directly in the Green Book.
musicbymuzak wrote: Jac, do you recall any names of the mastering or creation programs? I would reeeeallly love to create CD-BGMs if only for the novelty!
The ultimate mastering program was probably just "master", the standard disc image creation program by OptImage. It would take a build script and data files to build that image.
For a BGM disc, the data files would all the files mentioned above except the "PATH_TBL" file.

User avatar
cdifan
CD-i Emulator Author
Posts: 902
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Re: BGM CD (Background Music CD)

Post by cdifan » Wed Dec 28, 2016 12:41 pm

musicbymuzak wrote:I used the version of CdiEmu that has the ROMS bundled in the ZIP file that's floating around the net. The black and white "display" box will flash "AEI--" and then the player will continually reboot.
That would be the cracked version, and I know the ROMs it has. Interesting that the application "hacks" the front display... I didn't know of any CD-I application that does this.

User avatar
omegalfa
Le Monde Du CD-i Team
Posts: 38
Joined: Mon Jun 27, 2005 1:26 am
Location: Lisbon, Portugal

Re: BGM CD (Background Music CD)

Post by omegalfa » Wed Dec 28, 2016 1:02 pm

Lucky luck CD-i game have 2 discs on it.
Disc1 - the game
Disc 2 - the sound tracks

I will search my game to see in which format it is... I don't remember...
_____________________________________
omegalfa
The World of CD-i / Le Monde du CD-i
The World is Interactive!
http://www.theworldofcdi.com

User avatar
cdifan
CD-i Emulator Author
Posts: 902
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Re: BGM CD (Background Music CD)

Post by cdifan » Sun Jan 01, 2017 3:15 pm

Thanks for the info so far, but I really need an actual disc image if I am to start debugging...

User avatar
jac_goudsmit
Burn:Cycle Activated
Posts: 5
Joined: Fri Jan 27, 2006 11:23 pm
Location: Mesa, Arizona

Re: BGM CD (Background Music CD)

Post by jac_goudsmit » Tue Jan 03, 2017 9:58 pm

musicbymuzak wrote:At first I thought the 500mb "music" file on an AEI Prodisc was just an XA audio file, since PSMplay can play it and shows 4 51min tracks. But any XA audio file made from a WAV at the same sampling rate wouldn't work in PsmPlay.
I've forgotten most details but the music file would be a large file with 4 tracks of interleaved ADPCM encoded data. This is a real-time-file, i.e. it gets played at single speed i.e. 75 sectors per second. It's stored on the disc as Mode 2 Form 2 (M2F2), i.e. 2324 bytes of data per sector instead of the 2048 that are usual for CD-ROM (so to extract the file from the disc, you need a program that knows how to extract M2F2 sectors). Because the file is played in real-time and ADPCM is 4:1 compressed, it's possible to put 4 (mono) tracks of ADPCM in a single file. Each sector has 4 ADPCM frames; one for each audio track. The Green Book describes how ADPCM is encoded and interleaved.

I know many people refer to PCM files as WAV files and PCM files (i.e. with uncompressed audio data) are usually stored as WAV files but a WAV file can contain other data too. Replacing the music file of a BGM disc with PCM data wouldn't work because (1) it's not ADPCM (2) it's not interleaved and (3) the information in the other files won't match your music file. Also (4) to make the BGM disc play on an actual BGM player, some files need to be in the right locations on the disc.

It should be possible and not too hard to encode ADPCM from any music data, and use a simple program to interleave it into a file that could be used on your own BGM disc. That would solve problem 1 and 2. But you would still need to solve problems 3 and possibly 4.
I thought I would be clever and simply make one giant XA file and swap it out within the CDi image of a 'working' BGM disc, but the genuine MUSIC file has all the song, artist and label info embedded in a header; I can't tell where the actual audio data begins or ends. There went that idea.
Are you sure that the music file has a header on your disc? I'm quite sure that song, artist and title data is stored in separate files (stored in Mode 2 form 1) to make sure that the information can be read without a chance that it might get corrupted. If you're seeing non-ADPCM data in the music file on your disc, it may be because the disc producer made a mistake when mastering, or it may be because they wanted to add some redundancy or it may be because they wanted to make the music more difficult to copy or something.

That being said, the file that contains the track/artist info contains time codes if I recall correctly, and it's definitely possible to make the first song of each track start at a different location than the first sector, so the BGM player and CD-i player can definitely deal with garbage at the beginning of the music file -- they just skip it if the time codes tell it to do so.
The discs do seem to follow the basic standard, with some seemingly empty files from 1992ish and 3 that are always updated in addition to MUSIC.

REMIXSEQ, PATH_TBL, BGMINDEX.PRO, and MUSIC are always dated the same month the disc is marked for.
They always have different data within them, so it stands to reason they're created at the same time MUSIC is. I just have no idea what relation these files have to each other, aside from speculation.
The path_tbl file (as well as "album" "author" "manufacturer") are standard CD-i files described in the Green Book. I don't remember which files are required for BGM discs and the Green Book PDF that I just found online doesn't have any information about BGM (I think it was a separate attachment that came later, but I don't remember).

I expect that BGMINDEX.PRO contains track information in ASCII. It's possible that time codes are stored as binary codes or as BCD codes (e.g. 0x123456 means 12 minutes, 34 seconds and 56 sectors; there are 75 sectors in a second and there are 2324 bytes per sector, of which I think 2304 bytes are used for four ADPCM frames). Either way the time codes are probably offsets in terms of sectors, stored in Big Endian format because the CPU was a 68000. Probably the information for each title on the disc takes up the same number of bytes in the file.
I get the impression that the 76kb music player from 1995, included on every one of these discs, was based on the original 1989 CD-I music player application, adapted for AEI's purposes, and eventually supposed to enable sophisticated features on later machines. It seems to have provisions for recognising a non-AEI player (so it would crash a home CD-I player; it won't work when I try to get a CD-I emulator to run it), "expiring" a disc based on date-time, enable different remix sequences based on the day; and relies on three files to tell it what to do. "RemixSEQ" tells it to sequence a set of four folders (CBCACDC for example, if folder "C" contained popular music and "B" not so much); and "BGMINDEX" may act like a TOC, that tells the player where each song is within the folders in the MUSIC suitcase. "PATH_TBL" may be for defining paths. I have a feeling the disc mastering program would dump the song info plus raw music into the MUSIC suitcase, then generate the other 3 files based on what was in there.
I don't remember seeing the REMIXSEQ file, I speculate that that might be a specific feature for the program that's on your disc. It's possible that the producer of your disc added special features that weren't required by the standard BGM format.
Jac, do you recall any names of the mastering or creation programs? I would reeeeallly love to create CD-BGMs if only for the novelty!
As far as I know, there were no public programs to master CD-i's specifically for BGM. At Codim, we just used the standard OptImage mastering tools with an input file that was probably either the same for each disc, or was automatically modified to adapt to the differences between discs. I think BGM required certain files (presumably the BGMINDEX.PRO file and the music file) to start at a certain location on the disc, and that was easy to accomplish with the OptImage tools.

Hope this helps!

===Jac

Post Reply