Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Homebrew CMI 8738 drivers (Read 525145 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Homebrew CMI 8738 drivers

Hi everyone!

I'm currently working on WDM drivers for soundcards based on the C-Media 8738/8768 chip. I plan to release the entire source code under a BSD-like license sometime in the future.  I'm mainly interested in the S/PDIF connectivity because the DAC of the card sucks.

For testing, you need:
- a CMI 8738-MX/8768 based soundcard with S/PDIF (which are available for around 10-15 USD)
- Windows 2000/XP

Some of the features are:
- bitperfect S/PDIF output for 16bit 44.1/48/88.2/96kHz stereo signals through kernel streaming / dsound / waveout
- bitperfect AC3/DTS passthrough
- multi-channel output (that disables the S/PDIF output port unfortunately)
- recording support
- basic mixer support
- UART support (but disabled for now)

Apparently, the C-Media chip supports only 16 bit contrary to the claims in their specs. I haven't been able to get 24bit output even with the official drivers. But 96kHz output seems to work fine on the newer 8738 chips.

You can help me by posting your chip version and configuration, and testing whether 16bit/96kHz and 24bit/48kHz output through kernel streaming works (foobar2000, winamp have the necessary plugins). I'm specifically looking for people who have means to tell a 16bit S/PDIF stream from a 24bit stream.
When the driver loads, it prints the version of your chip to the kernel debugger. You need a running instance of DebugView (http://www.sysinternals.com/Utilities/DebugView.html) to catch the strings. In other words: open DebugView before updating the drivers.

Note that the drivers aren't signed, so you have to install them manually (Update Driver => Install from a list or specific location => Don't search. I will choose the driver to install => Continue anyway).
A 64-bit build has been successfully tested, and I'll probably release a build sometime soon.

Here are the download links for the latest version:
http://code.google.com/p/cmediadrivers

So long,

dogbert

Homebrew CMI 8738 drivers

Reply #1
Awesome! 

I'll try these drivers out today.  I tried some M Audio DIO drivers before which gave bit -perfect wav output as long as you manually selected the right # of bits and frequency, but couldn't automatically change to what was needed when playing DTS or AC3.

Homebrew CMI 8738 drivers

Reply #2
The only thing debugview shows is:
[2692] Exiting because c:\windows\system32\runonce.exe is in the Windows directory.
then
[XXXX] Exiting because c:\windows\system32\rundll32.exe is in the Windows directory.

a bunch of times, where XXXX is a 4 digit number.

This is Windows XP Pro, sp2.

Homebrew CMI 8738 drivers

Reply #3
My system is a Soltek QBic 3801 with a built-in CMI 8768.

Bit perfect worked great, able to automatically switch to the correct freq unlike the DIO drivers I tried.

My stereo showed 44.1, 48, 96khz all worked great.  88.2 I think also worked but my stereo didn't know what to display when it was playing it, the display got a bit confused.

24-bit also didn't seem to work for me.  It would continue to come out 16 bit with directsound selected.  With kernel-streaming used in FB2K 24-bit wouldn't do anything at all, nothing would come out.

The major problem for me is that it seems to have disabled all the headphone outputs.


Homebrew CMI 8738 drivers

Reply #5

The major problem for me is that it seems to have disabled all the headphone outputs.

Try this version: http://mitglied.tripod.de/atproc2/CMI-091-release.zip

Works great!

Thanks!

It seems that the volume is now much louder than with the regular drivers, but it's not such a big deal.  Just gotta remember to keep the volume slider down.  Or it could be I'm just imagining it.

Sorry I can't seem to get the debugging information to get captured properly to give you any further information about my setup.

Homebrew CMI 8738 drivers

Reply #6
new release 0.92:
- built with the latest WDK (version 5728)
- first AMD64/EM64T release - this driver should work on your Windows XP x64 installation and on Vista x64. To install the driver on x64 version of Vista, you must disable the driver signature enforcement during boot-up with the F8 key
- stupid fix for a nasty bug which rendered large parts of the mixer useless

I'm keen to know whether the driver actually works on Vista. So if you have a card lying around and some time, please test and report .

Homebrew CMI 8738 drivers

Reply #7
Thanks.

Homebrew CMI 8738 drivers

Reply #8
When do you think you'll start releasing the source?  And when you do, what will be necessary to compile it?  I'm interested in taking a look.

Homebrew CMI 8738 drivers

Reply #9
When do you think you'll start releasing the source?

released under BSD license, check the site.

Quote
And when you do, what will be necessary to compile it?  I'm interested in taking a look.


You need the Windows Driver Development Kit (WinDDK/WDK, http://www.microsoft.com/whdc/driver/found.../WhichDDK.mspx). I've used build 2600 and 5728 so far.
Unpack the stuff to <DDK>\src[\wdm]\audio, set the paths in paths.bat and you're ready to go. There's a bunch of batch files for building the binaries / updating the driver.


Homebrew CMI 8738 drivers

Reply #11
I wonder...how hard would be to modify drivers for 9738 (integrated on many motherboardsl and BTW: http://www.hydrogenaudio.org/forums/index....c=38113&hl= )


The 9738 is a regular AC97 codec, meaning that there are lots of limitations like fixed sample rate (48kHz) etc - a generic AC97 driver should support most of the features of the codec, maybe even bitperfect output for that particular sample rate.
In contrast, the 8738 is a regular and pretty simple PCI codec, so they require completely different drivers and have only very few things in common, namely the C-Media logo on top of the chip  .

Homebrew CMI 8738 drivers

Reply #12
it sounds awesome! but could I have the following request in the next update:

- software AC3 decode from SPDIF-in

The reason is that I have a XBOX and would like to use the computer as an audio decoder so that I can feed the surround audio into my 5.1 computer speaker setup.

Thank you.

Homebrew CMI 8738 drivers

Reply #13
it sounds awesome! but could I have the following request in the next update:

- software AC3 decode from SPDIF-in

The reason is that I have a XBOX and would like to use the computer as an audio decoder so that I can feed the surround audio into my 5.1 computer speaker setup.

Thank you.


Mhh, no, sorry. I think that's a bad idea because running digital signal processing code in kernel space proves to be difficult due to timing constraints (keyword glitches), and the AC3 stuff is mined with patents. The main motivation behind the driver is to provide a bitperfect transceiver for digital audio signals rather than a DSP.

You could run an AC3 decoder as an application which decodes the S/PDIF In signal to your speakers, but you'd experience a nasty lag (10-20ms and more) due to the limitations of the windows driver model. This particular design flaw has been fixed in Vista, but it requires modifications to the driver and limits it to Vista, of course. I'll probably implement the stuff when Vista is final and I'll have some free time.

Homebrew CMI 8738 drivers

Reply #14
Mind if I ask how you got into Windows driver developement?  It always struck me as an interesting topic.

Homebrew CMI 8738 drivers

Reply #15
thank you d0gbert.
referring to your reply, could you please suggest me which AC3 decoder can do my required work? How can i manage the settings?

Cheers~




it sounds awesome! but could I have the following request in the next update:

- software AC3 decode from SPDIF-in

The reason is that I have a XBOX and would like to use the computer as an audio decoder so that I can feed the surround audio into my 5.1 computer speaker setup.

Thank you.


Mhh, no, sorry. I think that's a bad idea because running digital signal processing code in kernel space proves to be difficult due to timing constraints (keyword glitches), and the AC3 stuff is mined with patents. The main motivation behind the driver is to provide a bitperfect transceiver for digital audio signals rather than a DSP.

You could run an AC3 decoder as an application which decodes the S/PDIF In signal to your speakers, but you'd experience a nasty lag (10-20ms and more) due to the limitations of the windows driver model. This particular design flaw has been fixed in Vista, but it requires modifications to the driver and limits it to Vista, of course. I'll probably implement the stuff when Vista is final and I'll have some free time.

Homebrew CMI 8738 drivers

Reply #16
Mind if I ask how you got into Windows driver developement?  It always struck me as an interesting topic.

Uhm.. more or less by accident. I'm generally interested in the architecture of operating system kernels, and driver development goes along with it.

Quote
referring to your reply, could you please suggest me which AC3 decoder can do my required work? How can i manage the settings?

graphedt.exe in conjunction with a proper AC3 codec. I haven't tested the SPDIF input capabilities yet, so I might try the stuff later on.

Homebrew CMI 8738 drivers

Reply #17
I'm keen to know whether the driver actually works on Vista. So if you have a card lying around and some time, please test and report .


Hi there!

Thanks for spending time on a driver for the CMI chip, the native driver really sucks.

Anyway, I have tried the driver both in XP and Vista, and it works well. I had some problems during installation in Vista (BSOD), but I think it relates to uninstalling the old driver (if I just uninstall the old driver I get the same BSOD). Using safe mode I had no problems installing the driver.

The driver works fine but I cannot turn off the digital output. I don't need to, but when the option to do so is present, it should work.

I can't choose multichannel output. I don't need it either, but I can see in the release note that it should be possible, so at least I should be able to.

Is the selection of sample rate on the output automatic and dependent on the input signal? Contrary to the native driver, your driver doesn't have any option to change the sample rate.

Anyway, thanks for a nice driver. Now I am able to get digital out in Vista. Thanks a bunch!

BR,
René

HW config:
Soltek 75FRN2-L
Athlon XP2500+
Terratec 5.1 Fun
Radeon 9600

Homebrew CMI 8738 drivers

Reply #18
Hi again,

Just another thing - the mute function doesn't work, at least not for the main volume control.

BR,
René

Homebrew CMI 8738 drivers

Reply #19
Quote
I had some problems during installation in Vista (BSOD), but I think it relates to uninstalling the old driver (if I just uninstall the old driver I get the same BSOD).

Yep, that's a bug in the old official cmedia driver - I had the same problem with version 0639 I think.

Quote
The driver works fine but I cannot turn off the digital output. I don't need to, but when the option to do so is present, it should work.

The analog part of the card is a nice extra, and the main aim of the driver is to provide a bitperfect spdif interface, but...

Quote
I can't choose multichannel output. I don't need it either, but I can see in the release note that it should be possible, so at least I should be able to.

... u can turn off the digital interface by selecting a multi channel configuration in your "sounds and audio devices" control panel applet (number of channels >=4).
The problem you will run into is that the driver "forgets" the channel configuration after each restart.

Quote
Is the selection of sample rate on the output automatic and dependent on the input signal?

Uhm, yes, the sample rate is selected by the kmixer, the way it's supposed to be in every WDM implementation. That means that if you start playing a 48kHz 16bit wave PCM stream and nothing else is pushing stuff through the kmixer, the driver sets the card to 48kHz 16bit. If you start playing another wave stream, let's say 96 kHz 16bit, the kmixer queries the driver whether the stream can be played simultaneously, which isn't possible due to obvious constraints (no support for hardware mixing), so the kmixer downsamples the stream to the format of the current stream, mixes them together and sends the resulting stream to the driver / card.
This is obviously a pretty bad design flaw, and Windows Vista has the ability to somewhere define a default sample rate and resolution. I might add a control application some time in the future though which would implement similiar functionality and some more stuff.

Quote
Just another thing - the mute function doesn't work, at least not for the main volume control.

Yeah, and the DAC volume doesn't work on 8768 devices etc etc. There are plenty of hardware revisions out there, and the specifications from C-Media have absolutely no information about the changes and capabilities of each of those revisions.

Homebrew CMI 8738 drivers

Reply #20
Yeah, and the DAC volume doesn't work on 8768 devices etc etc. There are plenty of hardware revisions out there, and the specifications from C-Media have absolutely no information about the changes and capabilities of each of those revisions.


Actually the DAC volume has been working since 0.9.2.  At least it has for me on my 8768.

Homebrew CMI 8738 drivers

Reply #21

Yeah, and the DAC volume doesn't work on 8768 devices etc etc. There are plenty of hardware revisions out there, and the specifications from C-Media have absolutely no information about the changes and capabilities of each of those revisions.


Actually the DAC volume has been working since 0.9.2.  At least it has for me on my 8768.


I should probably be more specific.  The DAC slider doesn't do anything but the main volume slider works fine -- and it only changes the volume of the DAC output, since the digital out can't change when it's bit-perfect.

Homebrew CMI 8738 drivers

Reply #22
This is fantastic.  I have a soyo sy-k7v dragon plus MB with onboard CMI8738 and optical/coax in/out. 

I have noticed that my drivers (c-media 5.12.1.639) don't support simultaneous digital in and out.

Do yours? 

And..  does the clock of the input need to be synced with the clock of the output in this mode?  Or does the chip have an asynchronous PLL for receive clocking?


I will try your version soon,
thanks!


EDIT:
OK, they installed fine, and work!  A few issues, though: at first no digital out, only digital in worked.  then I was playing an MP3 and changed the 's/pdif 5V signal level' switch (what does that do anyway?) and winamp crashed, and the digital output was brought to life (toslink glowing red).  However, since then there is no way to revive the digital input without a reboot.  no amount of switching and fiddling worked.  Also, there is no way to turn the digital output off.

Also, what is the DAC level slider adjusting, exactly?  it doesn't change the wav output volume, but that must go through the DAC, right?

Chip version markings:
CMI8738/PCI-6ch-MX
HRTF 3D Audio
M8Y31-0140
UGG1DB

Homebrew CMI 8738 drivers

Reply #23
AFAIK the DAC level slider isn't adjusting anything.  See previous posts.

Homebrew CMI 8738 drivers

Reply #24
Hello,

I am using an onboard C-Media-Chip CIM8738 with coaxial S/PDIF in and out. AC3 output works fine.

Is it possible record an AC3 stream via S/PDIF-in and decode it ?