Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Porsche Monty

Chocolate Doom and OPL Passthrough for CMI8738 sound cards

Recommended Posts

I just can't seem to get this working on XP Pro SP3. No problems in DOS, though, even with the oldest drivers.

Here's the relevant lines from stdout.txt:

"S_Init: Setting up sound.
IOperm_InstallDriver: ioperm driver installed.
OPL_Init: No OPL detected using 'Win32' driver.
IOperm_UnInstallDriver: ioperm driver uninstalled.
OPL_Init: Using driver 'SDL'"

Here's the instructions I followed: http://chocolate-doom.svn.sourceforge.net/svnroot/chocolate-doom/branches/opl-branch/README.OPL

Any help would be greatly appreciated.

Share this post


Link to post
Porsche Monty said:

I just can't seem to get this working on XP Pro SP3. No problems in DOS, though, even with the oldest drivers.

Here's the relevant lines from stdout.txt:

"S_Init: Setting up sound.
IOperm_InstallDriver: ioperm driver installed.
OPL_Init: No OPL detected using 'Win32' driver.
IOperm_UnInstallDriver: ioperm driver uninstalled.
OPL_Init: Using driver 'SDL'"

Here's the instructions I followed: http://chocolate-doom.svn.sourceforge.net/svnroot/chocolate-doom/branches/opl-branch/README.OPL

Any help would be greatly appreciated.


"For the cards listed above with (*) next to them, OPL support is
disabled by default and must be explictly enabled in software."

You made sure that it is enabled?

Share this post


Link to post
GhostlyDeath said:

"For the cards listed above with (*) next to them, OPL support is
disabled by default and must be explictly enabled in software."

You made sure that it is enabled?


Ain't that what ioperm is supposed to do?

Share this post


Link to post

Mine sounds just great and has none of the problems plaguing the emulated alternative, so even just for that it's totally worth it. Unfortunately Chocolate Doom freezes when emulated OPL is used jointly with 11khz, thus it's either this (assuming it wouldn't freeze to begin with) or a much suboptimal 22khz + post-DAC lowpass workaround.

Anyways, I don't think I should be seeing anything in the device manager as the XP drivers don't support OPL, besides: "To do hardware OPL, Chocolate Doom must access the chip directly"

Share this post


Link to post
Porsche Monty said:

Mine sounds just great and has none of the problems plaguing the emulated alternative, so even just for that it's totally worth it. Unfortunately Chocolate Doom freezes when emulated OPL is used jointly with 11khz, thus it's either this (assuming it wouldn't freeze to begin with) or a much suboptimal 22khz + post-DAC lowpass workaround.

Anyways, I don't think I should be seeing anything in the device manager as the XP drivers don't support OPL, besides: "To do hardware OPL, Chocolate Doom must access the chip directly"

The CMI8738 has hardware OPL, but it isn't enabled on the chip by default. Under Linux there's a driver option to turn it on but I don't know how it's done under Windows. There might be something you can set in the driver properties pane. Search for options named something like "Legacy FM" or similar.

I think I actually have a CMI8738 at home, so if I get the time maybe I'll try to get hardware OPL working on it under Windows.

Share this post


Link to post

Tried my card. I get the same options, and there's no sign of anything obvious that would enable OPL support.

I also tried under Linux but that doesn't detect an OPL card either. After looking through the kernel source it looks like later CMI cards don't support hardware OPL. From what I get, it looks like that is the case for my card, at least.

Share this post


Link to post

What driver are you using in Windows?

What model 8738 chipset do guys you have?

I looked through some old boxes and dug out a "CMI8738/PCI-SX", it's a big old ugly green one, not a trim angular cut-down card like you see on eBay these days. According to the C-Media Driver page there are 8738-SX, -MX, and -LX chips available.

I wonder if there's some way to read that chip_version string from the Windows driver info? (or even how one would go about reading it from the Linux kernel module?)

Share this post


Link to post

Looking through the XP SB16 driver (C:\Windows\inf\wdma_ctl.inf) you can see it creates ports for a device "FMSynth", whereas the new CMI driver doesn't create this at all (grepping for "ynth" in the directory with the inf files returns nothing). I am guessing to enable OPL in Windows with an 8738 you need an old driver that still has FM Synth support in it?

This driver I found dated 2006 has references to "FMSynth" in the inf file, perhaps give that a go?

Share this post


Link to post

I just went back to the driver you provided but I'm not seeing any new potentially useful options. OPL works perfectly in DOS and FMSynth is in wdma_ctl.inf, but that's about it.

Guess we just don't know how to actually enable it on XP.

-SX, -MX, and -LX must be the newer models. I remember the official driver downloads from a year ago only listed "cmi-8738" For whatever reason, each of the 3 drivers offered today work just fine with my ancient standalone card.

Share this post


Link to post

With the 2006 XP driver, if you run Chocolate with ioperm does it open the synth port when it does OPL_Init, or does it still not detect?

I found model differences here:
http://www.cmedia.com.tw/ProductsDetail.aspx?page=p&C1Serno=25&C2Serno=28&PSerno=30

# 8738-SX supports 4CH DAC surround output for movies and 3D games.
# 8738-MX provides additional digital interface S/PDIF IN/OUT (44.1K and 48KHz).
# 8738-LX/MX supports 6CH DAC 5.1 surround output for movies and 3D games.

wdma_ctl.inf is the XP Creative Labs driver, don't use that for your 8738.

I will have a play around with this as well, you've got me curious. I'm gonna try find one of those Yamaha PCI cards too.

fraggle, should OPL-branch output correctly on an 8738 under Linux with OPL enabled in modprobe? If so, I assume it will work correctly with a true SB16 as well?

Share this post


Link to post

After testing every single driver in existence I can safely conclude that OPL never really worked in XP. Older CMAUDIO.INF's contain many references to "WDM Interface FMSynth", but since these generic drivers were supposed to work in Win9X as well, that's probably why they're there.

One could also speculate about the possibilities of bogus drivers not installing properly, which wouldn't be surprising considering the record.

For all I know there's no way to "enable" OPL in XP, drivers plainly and simply have to support it, which doesn't seem to be the case here so all there's left is figure out a way to talk directly to the hardware, like a driver would, and quite honestly I don't see anybody signing up for it.

What a shame :(

Share this post


Link to post

You mean there is no way to use the OPL chips in a direct register-banging mode? Wouldn't surprise me under XP/2000/Vista. I recall there was an utility called PortTalk that should allow for that, but I never got it to work right with an AWE64.

It is however possible to use the OPL chips as a regular MIDI device if you're happy with the stock drivers- but then you'll have almost zero control on the timbres used, unless you find where they're defined, usually inside some obscure .dll

Share this post


Link to post
Super Jamie said:

I will have a play around with this as well, you've got me curious. I'm gonna try find one of those Yamaha PCI cards too.

fraggle, should OPL-branch output correctly on an 8738 under Linux with OPL enabled in modprobe? If so, I assume it will work correctly with a true SB16 as well?

Yes and yes. My normal card is a YMF724.

This whole CMI card thing is interesting though. From the driver source it seems pretty clear that older revisions support OPL and newer ones don't. Porsche Monty's card obviously supports it because it works under DOS. So it looks like you need both the right card AND the right driver to get it to work.

Maes said:

You mean there is no way to use the OPL chips in a direct register-banging mode? Wouldn't surprise me under XP/2000/Vista. I recall there was an utility called PortTalk that should allow for that, but I never got it to work right with an AWE64.

No, it's more complicated than that. The C-Media CMI8738 and Yamaha YMF724 both support OPL in hardware, but it has to be enabled by turning on a configuration flag in a specific PCI register on the card. You need to configure the driver to do that, and once you have, you can write to port 0x388 just like there's a real adlib/SB there.

Under Linux you can enable it by setting options to the driver modules in your modprobe.conf file. The Windows XP driver for the YMF724 seems to turn it on by default. The Windows XP driver for the CMI8738 doesn't, and there doesn't seem to be any way to tell it to.

The I/O port permissions issue is a completely separate issue and one that I'm aware of. Chocolate Doom on NT-based systems (XP etc) will load a driver called ioperm.sys that can enable access to the OPL I/O port. It essentially does the same thing as PortTalk. I didn't use PortTalk because the license was offensively draconian.

Porsche Monty said:

For all I know there's no way to "enable" OPL in XP, drivers plainly and simply have to support it, which doesn't seem to be the case here so all there's left is figure out a way to talk directly to the hardware, like a driver would, and quite honestly I don't see anybody signing up for it.

What a shame :(

The really frustrating part is that it's literally just a few bits that need to be turned on - bit 3 (VOICE_EN) in function control register 1 and bit 19 (FM_EN) in the miscellaneous control register. If my card had OPL on it, I might have tried reverse engineering the driver to see if it could be patched to turn the appropriate bits on. As it stands, I don't have any way to test it though.

Share this post


Link to post
Porsche Monty said:

If it's not prohibitively inconvenient for you, I'd be willing to test it and provide the necessary feedback.

I've found from experience that debugging by proxy is very tedious and frustrating so I don't really want to try that. If you can provide the manufacturer and exact model number of your card, and ideally a photo of the board, I might be able to get an identical card off eBay to test with.

Share this post


Link to post

Alrighty. I tried my best to identify this sound card but to no avail. No visual clue beyond the manufacturer of the chip and all hardware identification software reports is "CMI8738". Too many generic CMI8738-based cards out there and not a single tineye match, it's a waste of time, but here's the good news; I found an alternative, another CMI8738 with hardware OPL.

http://www.genius-europe.com/en/produktdetail.php?ID2=40&ID=30&ID3=80

It arrived yesterday and I spent most of the day experimenting with it. Results? different-sounding (if not bad) but fully functional hardware OPL/Adlib support for at least DOS (haven't tried it on 9x-based systems) While worthless for regular sound in DOS, OPL/Adlib works fine and that's what actually matters (the fact that it exists) Also, and just as I was expecting, the XP drivers have been completely stripped of OPL support.

The card is dirt cheap, still in production and apparently compatible with pretty much every Microsoft OS ranging from DOS to Win7.

Share this post


Link to post

I did some further investigation and it seems like the chip version number corresponds to the last two digits of its name, so CMI8738 = version 38, etc. I think my card might actually be a CMI8768, but I need to confirm. If I'm right then I just need to buy any card that has a real CMI8738 chip on it.

Thanks for the link though!

Share this post


Link to post

Here's an update. I was recently googling for a second opinion on the OPL dilemma and came across this nice little open-source CMI8738 driver: http://code.google.com/p/cmediadrivers/downloads/list

It works flawlessly here and the download is barely a few kb's big.

I then spent some time trying to get it to compile (the source assumes an older version of WinDDK so it wasn't as straightforward as I had envisioned) and when I finally succeeded, I proceeded to modify the source as an attempt to integrate the register bit tweak you spoke about, just to realize I had absolutely no idea what I was doing.

This thing literally compiles in 3 seconds and the driver installs in about 10, and most of those 10 secs account for the time WinXP takes to pop up the warning message telling you they're not Microsoft-approved drivers.

Anyways, do you think I could get a hand over here? cmireg.hpp sounds like a good place where to start but I wouldn't even know what to do with those 0x numbers.

Regards.

Share this post


Link to post
fraggle said:

I did some further investigation and it seems like the chip version number corresponds to the last two digits of its name, so CMI8738 = version 38, etc. I think my card might actually be a CMI8768, but I need to confirm. If I'm right then I just need to buy any card that has a real CMI8738 chip on it.

Thanks for the link though!


Only CMI8738 cards upto Model 55 Support the OPL, Model 68, aka the 7.1 Channel version of the card (8768) had it removed for some reason.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×