VOGONS


Cmedia CMI8738 - maybe its Biggest Secret

Topic actions

First post, by kodi

User metadata
Rank Newbie
Rank
Newbie

hi All, I am not sure from where to start this, but let's start from somewhere and without flooding you with too much information for the time being, but only with the essentials ...

So, in CMI8738 datasheet "CMI8738_spec_v06_reg.doc" that is floating around Internet, there seems to be 2 very curious entries:

A)

DMA Slave Configuration Register(R/W) PCI Configuration address 40H
Bit(s) Function
15:4 Slave Base Address 15-4. INTEL VX chipset seleted if Base Address 15:4=000h

B)

Micellaneous Control Register Address 18H Bit(s) R/W Name Description 27 TX/VX Which motherboard to work with 0 VX chi […]
Show full quote

Micellaneous Control Register Address 18H
Bit(s) R/W Name Description
27 TX/VX Which motherboard to work with
0 VX chip sets.
1 TX chip sets.

Why PCI audio chip needs to have setting for selecting between Intel 430VX and 430TX chipset? What was the biggest change regarding PCI (audio) between those 2 chipsets?

the answer of course is "Distributed DMA" (DDMA) - 430VX doesn't have support for it (430VX is the last 430 series chipset without DDMA support) and 430TX was the first Intel 430 series chipset that has DDMA support.

That makes me believe, even it's not advertised anywhere (with one small exception - see below), that CMI8738 most likely (secretly) has DDMA support and it's just matter of setting correctly the above bits to enable it.

The only place I found where CMI8738 and DDMA are mentioned together is "Cobra AW850 Deluxe" sound card PDF - it's CMI8738-based card and AOpen wrote there:

C)

Audio Chip:
C-Media CMI8738
Support Distributed DMA for legacy DMAC (8237) emulation

Honestly, when I saw that first, I thought it's just "copy and paste" leftover from all Yamaha sound cards AOpen made, which support DDMA and its just a mistake. Now, I am not that sure and I am almost convinced CMI8738 supports DDMA, it's just their DOS tool ("setaudio.com") doesn't include the proper support for it, i.e. enable it via the above bits.

Stay tuned... I will try to write small tool that enables DDMA on CMI8738 - hopefully it really supports DDMA and it will work, greatly improving compatibility of CMI8738 in DOS. However, I want to encourage everyone in the mean time to comment and even do such tool before I do it based on the information in the datasheet.

P.S. if you read CMI8738 datasheet, it has both SBPro and SB16 (selectable via configuration bit) plus as it was discussed many times before, old CMI8738 revisions can mix OPL3 with the sound and output it via Digital SPDIF/Coax Output, which bypass low-quality (and old) analog part of the card, which are all quite good features.

Last edited by kodi on 2019-11-12, 13:05. Edited 10 times in total.

Reply 3 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

Let's Dig deeper:

ok, a little more specific and technical information (for the more technically advanced users here).

So, in the datasheets of other audio chipmakers of that time period, always the setting is called "DDMA base Address" (you can google for that and see datasheets for ALS300, Solo-1, etc) pop up. However, maybe to translate from CMedia language "DMA Slave" needs to be replaced by "DDMA base". Also, it makes sense for 430VX as Cmedia datasheet says that address to be 0, because there is no DDMA support and there is no DDMA base address.

Further more "setaudio.com" is pretty easy to reverse-engineer for other none DDMA, but Legacy Audio related settings. So, "setaudio.com" does very few things (in that order):

* write 0x0e to (base address + 0x04)

Translation (based on the datasheet) - in binary 0x0e is 1110 and that is:

Function Control Register 1 Address 04H Bit(s) R/W Name Description 3 VOICE_EN This bit enables Legacy Voice device(SB16,FM) […]
Show full quote

Function Control Register 1 Address 04H
Bit(s) R/W Name Description
3 VOICE_EN This bit enables Legacy Voice device(SB16,FM).
1 Legacy Voice enabled on channel 0.

2 UART_EN This bit enables Legacy UART device.
1 UART enabled

1 JYSTK_EN This bit enables Legacy Joystick device.
1 Joystick enabled

all other operations done by "setaudio.com" (i leave to the reader to translate what they mean based on the datasheet) in that order are:


write 0x08 to (base address + 0x1a)
write 0x03 to (base address + 0x18)
write 0x10 to (base address + 0x16)
write 0x05 to (base address + 0x21)
write 0x01 to (base address + 0x27)

Pretty straight-forward and even gives good idea how to make improved tool which is able to select SB DSP version and SBPro or SB16 mode, because "setaudio.com" does only SB16 mode.

OK, that's it guys, when find some spare time, I will do my attempt of making DDMA-capable tool for "setaudio.com" replacement, but one more time - there are people here more than capable to do the same using the above information.

Reply 4 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

first (and maybe last, i.e. if we assume the datasheet is wrong) obstacle hit - it doesn't allow me to write to "PCI Configuration address 40H", at least on my CMI8738 revision 037D chip. so, anyone, any idea?

Reply 5 of 61, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++

What is the exact card you have? Pics?

I just bought a new Cobra AW-850 Deluxe (with digital in/out board).

The chip on mine reads:

C3DX 6CH
CMI8738/PCI-6ch-MX
HRTF 3D Audio
MM964-0617-GS
UGG1DH

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 6 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

the card I have is not branded, but it has "CMI8738 037D" chip on it - basically the chip looks exactly as the picture I am attaching (found that picture on Internet, it's not from my card, but the chip is the same).

so, what I did on my test - set B) from my initial post to "1", i.e. set CMI8738 operation for TX chipset, which under my assumption for what CMedia datasheet means by that should mean "DDMA enabled", then try to set A) from the initial post and it cannot be written - no matter what I try it stays all 0s. I am stuck, but I really cannot believe it - I mean the datasheet could not be so much wrong. i have to be missing something.

Attachments

  • cmi8738.jpg
    Filename
    cmi8738.jpg
    File size
    82.24 KiB
    Views
    5757 views
    File comment
    cmi8738 rev 037D
    File license
    Fair use/fair dealing exception
Last edited by kodi on 2019-11-12, 18:55. Edited 2 times in total.

Reply 7 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

hmm, I don't know, at least I see no other option for interpretation than:

1) Cmedia words "0 VX chip sets" and "1 TX chip sets", I read respectively as "DDMA disabled" and "DDMA Enabled"

2) Cmedia words "Slave Base Address 15-4. INTEL VX chipset seleted if Base Address 15:4=000h", I read as if TX is set, i.e. DDMA is enabled, then allow to changes the DDMA Base Address from 0 to the correct one

but after I did 1), then 2) cannot be changed from 0 and it stays 0. So, either in my CMI8738 chip revision 037D, DDMA support is removed or I am missing something, i.e. something more than 1) is needed to allow perform 2).

Any ideas are appreciated, including that my assumption is wrong and by VX and TX selection Cmedia means something else than DDMA disable/enable (what else it could be? i cannot find any other change between those chipsets that relates to PCI Audio).

Reply 8 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

the only other source of information I found is Linux ALSA driver, where we have the following:

#define CM_TXVX			0x08000000	/* model 037? */

/* Assume TX and compatible chip set (Autodetection required for VX chip sets) */
switch (pci->device) {
case PCI_DEVICE_ID_CMEDIA_CM8738:
case PCI_DEVICE_ID_CMEDIA_CM8738B:
if (!pci_dev_present(intel_82437vx))
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX)

i guess "model 037?" maybe means they are not sure that revision "037" supports that. It's really investigative work, but I run out of sources of information. In any way, CM_TXVX bit I have no problem to set, what I have problem with is setting " PCI Configuration address 40" - maybe the datasheet is wrong and it's not "40H" but some other address?!

Reply 9 of 61, by dionb

User metadata
Rank l33t++
Rank
l33t++

This is seriously interesting stuff. Too late this evening to get started, but I have at least one and possibly two or three CMI8738 cards. I'll dig them up tomorrow and see about the chip revision. Would be very willing to help test, but complete novice on the software hacking side, so will need a bit of hand-holding.

Reply 10 of 61, by Stretch

User metadata
Rank Member
Rank
Member

Kodi, are you able to hear FM music in MS-DOS with your CMI8738? If I remember correctly, after a certain revision, the FM block was removed.

I think your best bet is to find a CMI8738 card that does not have the SX/LX label on the chip.

To modify the soundcard registers, search Vogons for PeriTool.

I can try to play with the registers too, as I have some CMI8738 cards, but won't be able to test until the weekend.

Win 11 - Intel i7-1360p - 32 GB - Intel Iris Xe - Sound BlasterX G5

Reply 12 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie
Stretch wrote:

Kodi, are you able to hear FM music in MS-DOS with your CMI8738? If I remember correctly, after a certain revision, the FM block was removed.

I think your best bet is to find a CMI8738 card that does not have the SX/LX label on the chip.

i cannot recall in which exact revision the FM was removed, but the card I am using has FM. so, better look on the chip to have "033" or "037C", "037D", etc instead other parts of the label. Revisions 33 and 37 have FM and can output FM via the digital outs.

Anyway, back to the main topic. So, "PCI Configuration address 40H" is not working for me - I don't know why. I don't exclude the possibility that the address in the datasheet is wrong and the real one is not "40H", but something else. However, there is no any doubt that if there is CMI8738 revision that has that it's the DDMA register, because what is in Cmedia datasheet is 1:1 mapping to Yamaha DDMA register, but just using different words and Cmedia has not only 8bit (SBPro), but 16bit (SB16) as well. Here is what I mean in better details:

CMedia Datasheet wrote:
DMA Slave Configuration Register(R/W) PCI Configuration address 40H Bit(s) Function 31:16 Reserved 15:4 Slave Base Address […]
Show full quote

DMA Slave Configuration Register(R/W) PCI Configuration address 40H
Bit(s) Function
31:16 Reserved
15:4 Slave Base Address 15-4. INTEL VX chipset seleted if Base Address 15:4=000h
3 Non legacy Extended Addressing
0 = disabled
1 = enabled
2:1 Transfer Size
00 = 8 bit transfer
1 = 16 bit transfer
10 = 32 bit transfer, non legacy
11 = Reserved
0 Channel Enable
0 = disabled
1 = enabled

Yamaha Datasheet wrote:
D-DMA Slave Configuration 0 Channel Enable This bit enables the Distributed DMA function. 0: Disable Distributed DMA (default) 1 […]
Show full quote

D-DMA Slave Configuration
0 Channel Enable
This bit enables the Distributed DMA function.
0: Disable Distributed DMA (default)
1: Enable Distributed DMA
2:1 Transfer Size
These bits indicate the size of the DMA transfer.
Since DS-1 supports only 8-bit DMA transfer, the bits
are hardwired to 00b.
3 Extended Address
DS-1 does not support extended address mode. This bit is hardwired to 0b.
15:4 Base Address : D-DMA Slave Base Address
These bits indicate the D-DMA slave base address.

it's very obvious - they are the same only using different words and Cmedia choose instead to talk about DDMA Enable and DDMA Disable to use TX and VX (respectively DDMA support, i.e. Enable and no DDMA support, i.e. Disable).

So, there is no doubt what Cmedia datasheet means is DDMA support, but either the address of the setting is wrong (and not 40H), mine CMI8738 revision doesn't have that or something special needs to be done in order to be able to write to 40H. As mentioned in previous posts - I cannot find way to write to that address.

Reply 13 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie

found something interesting and that can be very helpful - "Trident 4D Wave DX" use the exact same 40H address as Cmedia for DDMA activation:

Trident 4D Wave DX Datasheet wrote:
4.1.2.1 Distributed DMA Configuration (Offset = 40h) DDMA Base Address 3 Non Legacy Extended Addressing Control (Fully 32 bit Ad […]
Show full quote

4.1.2.1 Distributed DMA Configuration (Offset = 40h)
DDMA Base Address
3 Non Legacy Extended Addressing Control (Fully 32 bit Addressing)
0 = disabled
1 = enabled
2:1 Legacy DMA Transfer Size Control
00 8 bit transfer, legacy
0 DDMA Slave Channel Access Enable Control
0 = disabled
1 = enabled

I have such card in my collection, but it will take me ages to find the box where it's stored (i moved recently). However, that can help me test my code, i.e. if I can write that address on Trident, but it fails on CMI, then obviously it's not the code. Anyway, it's very interesting Trident use the same address!

[EDIT] Actually that means that basically DDMA tool for Trident 4DWave-DX is the same as for CMedia - the setting is exactly the same. So, it seems, best next step is find my Trident 4DWave-DX and test enabling DDMA there. if it works, but fails on Cmedia, then maybe I have bad CMI8738 revision or something.

Reply 14 of 61, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Fascinating thread! If you encounter trouble with the CMIs, please have a look at :
Re: Sound Blaster 16 Clones
Re: PCI sound cards and Chipsets from various manufacturers...

From what I did find out, not all CMIs were the same, despite having the same model number.
So it shouldn't hurt to redo the same experiments on several cards.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 15 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie
Jo22 wrote:

From what I did find out, not all CMIs were the same, despite having the same model number.

i agree - in many cases with Cmedia chips, the marking is deceitful or misleading, but the chip revision doesn't lie (otherwise even the software will be confused). So, in some cases (in my experience mostly when there is "033" or "037" on the chip) it can be deducted by the marking, in other - you can 100% reliably detect the chip revision in software - for example I use Linux driver to check if the chip has OPL3 and if it has OPL3 to digital out feature. So, that software check is 100% reliable so far for me. In fact "cmipci.txt" from Linux ALSA driver gives good idea about what changed between version - for example search for "033" and "037" in that file and you very easily realize the changes between those 2 revisions. Unfortunately, Linux doesn't need DDMA and nothing about those differences there. I don't exclude that DDMA support was removed in "037", because the datasheet is from the times of "033".

So, even (for the time being and at least with my Cmedia revision "037D" card DDMA is not possible to set), revisions "033" and "037" (maybe others) are still quite useful, because they have OPL3 and can output that via Digital outs.

Reply 16 of 61, by dionb

User metadata
Rank l33t++
Rank
l33t++

Right, as promised I have some cards:

- Terratech Aureon 5.1 Fun - CMI8378/PCI-6ch-MX HRTF 3D Audio MKJW6.01-0515 UYD1DH
- Trust SC-5100 5.1 - CMI8378/PCI-6ch-LX HRTF 3D Audio MN64F-0719-GS UGGIDH

I might have another one in a system stashed away, but can't easily get at that.

Also re the Trident avenue:
- Aztech PCI288 - 4DWave-NX A CCC02 M5630 9944/39110277

I have various PCI systems here to stick them in. Does the Via ApolloPro133A (694X) support DDMA? If so my regular test system would be perfect. If not I can rig up a BX-based setup.

Reply 17 of 61, by Stretch

User metadata
Rank Member
Rank
Member

Kodi, I found an interesting tidbit related to CMI8738's DMA that you may find interesting and which you may need to patch. From the comments section by user dosfan at OS/2 Museum - The Wave Blaster II Does Talk!

-dosfan
...The CMI8738 is Sound Blaster Pro compatible without any special TSRs or device drivers and only needs to be initialized properly via the SETAUDIO utility though I had to patch it so that a configuration register is set to update the DMA address and count registers during DMA transfers since some games actually check them...

Win 11 - Intel i7-1360p - 32 GB - Intel Iris Xe - Sound BlasterX G5

Reply 18 of 61, by kodi

User metadata
Rank Newbie
Rank
Newbie
dionb wrote:

- Aztech PCI288 - 4DWave-NX A CCC02 M5630 9944/39110277

that's what I am looking at the moment, because I also found my "NX", but the "DX", for which there is more information available in form of datasheet, I still cannot find. however, at the moment this project transformed to make tool for DDMA to work on Trident, then test that tool on Cmedia, because it's the same address. However, on my Cmedia chip revisions I know I cannot write that address and so I doubt it will work, but at least test with Trident will leave only few options - some bit needs to be set for Cmedia to allow writing to the address in question or the address in the datasheet it wrong, i.e. they made a typo. last option of course is the Cmedia datasheet is totally wrong, but that I really don't believe - could it be that much wrong? However, the datasheet covers 8338 (which I've never ever even seen) and initial 8738. So, it's possible in revision like 037 (the oldest I have and yours are even newer revision), they just removed the setting.

dionb wrote:

Does the Via ApolloPro133A (694X) support DDMA? If so my regular test system would be perfect. If not I can rig up a BX-based setup.

that's the eternal question, you need to check your South Bridge - if it's VT823x or newer, then you're out of luck. In fact there are so much rumors and misinformation spreading on Internet about which chipsets support DDMA and which don't, that I think to make separate forum thread with details taken out from the actual datasheets (as well as most of them tested by me in practice).

@Stretch

any technical information is useful, i also want to make a note on the other post by the same user in that discussion:

dosfan says wrote:

... The CMI8738 is Sound Blaster Pro compatible ...

old 8738 revisions support both SB16 and SBPro - I can confirm that personally with my 8738 rev 037D card (also in the datasheet that is clearly documented, i.e. the bit that flips the card between SB16 and SBpro or how you can switch it). I have another 8738 i haven't checked its revision (presume newer revision), but it can do only SBPro, i.e. 8bit.

Reply 19 of 61, by yawetaG

User metadata
Rank Oldbie
Rank
Oldbie

I have here a Asus CUSI-M motherboard with a CMI 8738/PCI-SX HRTF Audio Com M2M08-037D 0111UGGD. Driver CD includes DOS drivers.

Last edited by yawetaG on 2019-11-14, 19:22. Edited 1 time in total.