VOGONS


Reply 81 of 89, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie
Kamerat wrote:

Got OPL passthrough working on my Philips PSC605 under Windows XP, but unlike my Zoltrix Nightingale it can't mix OPL to the SPDIF output. I think the whole PSC60x series uses rebranded CMI8738 chips and on the HP OEM PSC1602 you can actually find both rebranded and non rebranded CMI chips.

Using the same card behind a PCI to PCIe bridge under Windows 98 right now, accessing the FM synth through port C850h. I initialize the card with "SETAUDIO.COM U" before I boot Windows. Haven't tried it under NT based Windows yet.

cmi8738pcie.png
Filename
cmi8738pcie.png
File size
93.96 KiB
Views
2372 views
File license
Fair use/fair dealing exception

Edit: Tried with Adlib Tracker II under pure DOS, also working when set to port C850h (C800h is the PCI base address of the card revealed by SETAUDIO).
Edit 2: Seems like it's unnecessary to initialize the sound card at all, the FM synth is always aviable at port C850h.
Edit 3: Using DOSMid it seems like the MPU interface are located at xx40h, C840h in my case.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 82 of 89, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie

Tried with the Pericom PI7C9X111SL bridge (same as Windows 98) under Windows 7 with DosBox. FM works fine but sampled sound playback of the card disappears after a short while, not sure if it happens because of the FM synth.

Another use of the PCI base adress FM synth is within a virtualized environment using PCI passthrough as shown in this video.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 83 of 89, by kodi

User metadata
Rank Newbie
Rank
Newbie
nukeykt wrote:
I've got the OPL3 synth working by modifying CMI8738 driver. I used this driver : http://code.google.com/p/cmediadrivers/. […]
Show full quote

I've got the OPL3 synth working by modifying CMI8738 driver. I used this driver : http://code.google.com/p/cmediadrivers/.

The attachment archive is containing modified drivers(You must install this driver before),opl3 midi synth and other helpful tools.

cmiopl.zip

OPL3 MIDI synth based on WDK sample.

x64 drivers must be signed by "driver signature enforcement overrider"(Only Windows vista and seven)

Tools:
HBA.bat - enables OPL3 mode(write 0x01 to 0x105)
HBDA.bat - disables OPL3 mode(write 0x00 to 0x105)
TVFIX.bat - enables OPL3 mode, disables 4op mode, sets Tremolo and Vibrato to high and disables percussion mode(fixing some issues of midi synth)
P.S : you must launch these tools repeatedly, because these tools some times don't working.

@nukeykt : I hope you will see this (because as new member I am not allowed to send private messages) and be so kind to help me.

So, I want to use your "cmiopl.zip" on WinXP, but what's inside your "cmiopl.zip" fails (I get "yellow exclamation marks" in Control Panel-->Device Manager). My best guess is because you built it with Windows Drivers Kit (WDK) for Windows7.

So, I installed WDK for WinXP and I can build Microsoft "fmsynth" sample - in WDK for XP, it's located in:

"\WinDDK\6000\src\audio\fmsynth"

but I have several questions:

1) Did you make any changes in "fmsynth" or it's the original Microsoft code? Please, if you made some changes provide patch file (or details what to patch/change manually) and so I can build it for XP. My understanding is that you used WDK7600 for Win7. I can compare if there are any differences between "fmsynth" from WDK6000 (WinXP) and from WDK7600(Win7), but still I need to know if you made any additional changes.

2) Same for the "cmediadrivers" - it's the original code or you made changes? Please, if you made changes provide patch file (or details what to patch/change manually) and so I can build it for XP.

Thank you!

Reply 84 of 89, by nukeykt

User metadata
Rank Member
Rank
Member
kodi wrote:
@nukeykt : I hope you will see this (because as new member I am not allowed to send private messages) and be so kind to help me. […]
Show full quote

@nukeykt : I hope you will see this (because as new member I am not allowed to send private messages) and be so kind to help me.

So, I want to use your "cmiopl.zip" on WinXP, but what's inside your "cmiopl.zip" fails (I get "yellow exclamation marks" in Control Panel-->Device Manager). My best guess is because you built it with Windows Drivers Kit (WDK) for Windows7.

So, I installed WDK for WinXP and I can build Microsoft "fmsynth" sample - in WDK for XP, it's located in:

"\WinDDK\6000\src\audio\fmsynth"

but I have several questions:

1) Did you make any changes in "fmsynth" or it's the original Microsoft code? Please, if you made some changes provide patch file (or details what to patch/change manually) and so I can build it for XP. My understanding is that you used WDK7600 for Win7. I can compare if there are any differences between "fmsynth" from WDK6000 (WinXP) and from WDK7600(Win7), but still I need to know if you made any additional changes.

2) Same for the "cmediadrivers" - it's the original code or you made changes? Please, if you made changes provide patch file (or details what to patch/change manually) and so I can build it for XP.

Thank you!

Sorry, but i don't remember much about these drivers anymore. IIRC only modification i did for CMI driver itself was enabling FM_EN register bit by default. For OPL3 driver i've made various tweaks to mimic Windows 98 SB16 driver. Not sure i still have source code for it though. i recommend you try this fork of my emulated OPL3 driver instead, which supports hardware OPL3 passthough instead of software OPL3 emulation(OPL3 emulation is actually perfect btw 😁).

Reply 85 of 89, by kodi

User metadata
Rank Newbie
Rank
Newbie
nukeykt wrote:

Sorry, but i don't remember much about these drivers anymore. IIRC only modification i did for CMI driver itself was enabling FM_EN register bit by default. For OPL3 driver i've made various tweaks to mimic Windows 98 SB16 driver. Not sure i still have source code for it though. i recommend you try this fork of my emulated OPL3 driver instead, which supports hardware OPL3 passthough instead of software OPL3 emulation(OPL3 emulation is actually perfect btw 😁).

many thanks for your reply, i am going to try your suggestion.

Reply 86 of 89, by DragonSlayer

User metadata
Rank Newbie
Rank
Newbie

@nukeykt: Thanks for the link to OPL3EMU. That's very cool what they've been able to do with your awesome OPL3 driver. This will keep me entertained for hours! 🤣.

BTW, I'm a huge fan of your work. Thank you for freely sharing your work with the world. 😀

"There are only 10 types of people in the world; those who understand binary, and those who don't."

Reply 87 of 89, by yawetaG

User metadata
Rank Oldbie
Rank
Oldbie

Just FWIW, the official CMI8738 DOS driver (all drivers are still available from Asus' website for the Cusi-M motherboard) has this in the readme:

PCI audio DOS utilities instructions […]
Show full quote

PCI audio DOS utilities instructions

* SETAUDIO.COM

DOS initial program

The following are the parameters format:
/Gx : x=0 disable game port, x=1 enable (default)
/Mx : x=0 disable MPU-401 MIDI port, x=1 enable (default)
/IOxxx : Set SB I/O port to 220(default),240,260 or 280.
/FMxxx : Set FM I/O port to 388(default),3C8,3E0 or 3E8.
/MPUxxx : Set MPU-401 MIDI port to 330(default),320,310,300.

* FIXEPIC.EXE

EPIC DOS games patch program

We found that there are some EPIC DOS games can not detect PCI
audio. This is due to these games using instruction loop as time
counter not a real constant period. In high speed CPU PC, the loop
time become shorter. That is reason that games can not detect PCI
audio. If you meet this problem, please run patch program to fix.
All of fixed files will backup to *.old.

More interestingly, the readmes for the various Windows versions give information on the different chip revisions and also imply that it's possible to detect which revision is used by a CMI8738-based card via software. Unfortunately none of those mention the FM synth (unless I missed it).

Reply 88 of 89, by kodi

User metadata
Rank Newbie
Rank
Newbie

@yawetaG:

there is FM synth block inside most (if not even all) revisions of CMI8738, but there is not much research from the community and the information is very confusing and even contradictory.

you can see the post from the great and real expert "nukeykt" that I quoted few posts ago:

I've got the OPL3 synth from a CMI8738 working in Windows 7 x64

as you can see he even did some improvements of the FM synth on CMI8738 with software settings:

"TVFIX.bat - enables OPL3 mode, disables 4op mode, sets Tremolo and Vibrato to high and disables percussion mode(fixing some issues of midi synth)"

but again not much information with those fixes what is the actual quality.

My understanding is that the previous C-Media chipset CMI8330 that's found on ISA cards has acceptable FM quality - that's why cards with CMI8330 are now very expensive. Also, as CMI8330, the CMI8738 has digital output, which you can use to bypass low-quality DAC and that's a big plus. In fact the reason why in this forum thread "opl3 hardware pass-thought" with CMI8738 is the main discussion.

Anyway, I already put some time in research, but need to find time and mood to write some long post here 😀

BTW, just to make one last note for the time being - to determine the revision is very easy not just in software, but with visual inspection of the markings on the chip - that gives addition information as well. maybe, I should start with writing some small guide about it...

Reply 89 of 89, by foxbat

User metadata
Rank Newbie
Rank
Newbie

I have few cmi8738 based cards. Three models of the chip CMI8738-SX, CMI8738-LX and CMI8738-MX. Used them under modern Linux so far (Fedora 38).

CMI8738SX advertises itself as:

$ cat /proc/asound/card0/cmipci 
C-Media CMI8738 (model 37) at 0xd000, irq 17

and does not list OPL3:

$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0

CMI8738LX:

$ cat /proc/asound/card0/cmipci 
C-Media CMI8738 (model 55) at 0xd000, irq 17

lists OPL3 and plays midi files with use of it:

$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
16:0 C-Media CMI8738 C-Media CMI8738 MIDI
17:0 OPL3 FM synth OPL3 FM Port

CMI8738MX:

$ cat /proc/asound/card0/cmipci 
C-Media CMI8738 (model 55) at 0xd000, irq 17

lists OPL3 and plays midi files with use of it:

$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
16:0 C-Media CMI8738 C-Media CMI8738 MIDI
17:0 OPL3 FM synth OPL3 FM Port

CMI8738-SX chip is labeled with 'HRTF Audio Com' when CMI8738-LX and CMI8738-MX as 'HRTF 3D Audio'.

Before being able to play midi with use of aplaymidi fake samples must be loaded with:

sbiload -v 1

alsamixer offers '3D Control' for those cards but enabling it does nothing. They all work out of the box under Linux.
The biggest problem I have with them is annoying hum/noise when nothing is playing at the moment.
Also for some time midi files are being played 'slower'. I found information that it is because different sample rate of the card and aplaymidi (44 vs 48kHz) but haven't found out how to try to synchronized it back.