scientificlinuxforum.org QR code
Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> C-Media 8738-MC6/C3DX Cards and getting them working.
lemonzest
 Posted: Jun 4 2011, 07:53 PM
Quote Post


SLF Member
***

Group: Members
Posts: 144
Member No.: 109
Joined: 29-April 11









Hi

During my research on such cards (I needed something cheep and Soundblaster compatable with OPL/3 on it on PCI) A Lot of people seem to be having trouble getting them working on Fedora/RHEL Distros, Only today I found a post on linuxquestions asking this same Question, So i thought I would write a quick guide

Basiciy its just a matter of adding the right options to the modules and loading them up, no idea why its not automatic in this day and age, though they are old cards.

This is what lspci throws up

CODE
03:06.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
       Subsystem: C-Media Electronics Inc CMI8738/C3DX PCI Audio Device
       Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
       Latency: 64 (500ns min, 6000ns max)
       Interrupt: pin A routed to IRQ 21
       Region 0: I/O ports at e400 [size=256]
       Capabilities: [c0] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
               Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
       Kernel driver in use: C-Media PCI
       Kernel modules: snd-cmipci


This is just from a generic card, the subsystem string can be from many manufacturers as its quite popular.

aplay -l lists it as follows

CODE
**** List of PLAYBACK Hardware Devices ****
card 0: CMI8738 [C-Media CMI8738], device 0: CMI8738-MC6 [C-Media PCI DAC/ADC]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 1: CMI8738-MC6 [C-Media PCI 2nd DAC]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 2: CMI8738-MC6 [C-Media PCI IEC958]
 Subdevices: 1/1
 Subdevice #0: subdevice #0


Now lets get things working. find dist-alsa.conf in /etc/modprobe.d and edit it as follows

CODE
# ALSA Sound Support
#
# We want to ensure that snd-seq is always loaded for those who want to use
# the sequencer interface, but we can't do this automatically through udev
# at the moment...so we have this rule (just for the moment).
#
# Remove the following line if you don't want the sequencer.

install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-seq
options snd-cmipci mpu_port=0x330 fm_port=0x388
install snd-mpu401-uart /sbin/modprobe --ignore-install snd-mpu401-uart
install snd-opl3-synth /sbin/modprobe --ignore-install snd-opl3-synth
options snd slots=snd-cmipci,snd-virtuoso,snd-hda-intel


the slots thing is useful in my case because I have 4 sound devices and they need the correct order when loaded, I this example I have, C-Media 8738, Asus Xonar D1, onboard Intel HDA, and HDMI output on my Radeon Video card.

Next we edit dist-oss.conf to look like this

CODE
# OSS Sound Support
# This has been disabled in F11 onwards because it can interfere with the
# PulseAudio sound service (a legacy OSS application can prevent PulseAudio
# applications from playing sound by preventing PulseAudio from (re-)opening
# the sound device). To re-enable support, uncomment the following line:
#
install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-pcm-oss && /sbin/modprobe snd-seq-device && /sbin/modprobe snd-seq-oss


That sets the Chip up, next is just Unmute the channels in alsamixer to get normal 6 Channel Audio working, you can stop here if you like, but if you're like me, you want the MIDI Synth.

Unfortunately Scientific Does not ship alsa-tools or sbiload, as all we need is the second package do a search on this very good site http://pkgs.org/ the latest version was from mandriva cooker and it installed and works fine for me.

once its installed make a file call it what ever you want, but it needs to go in /etc/profile.d and be chmod +x and be a .sh file, add the line /usr/bin/sbiload --opl3

and next time you reboot the instrument patches will be loaded (other wise you get silence)

aplaymidi -l
CODE
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


cat /proc/asound/oss/sndstat

CODE
Sound Driver:3.8.1a-980706 (ALSA v1.0.23 emulation code)
Kernel: Linux electronicbox 2.6.32-71.29.1.el6.x86_64 #1 SMP Tue May 10 17:35:18 CDT 2011 x86_64
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
C-Media CMI8738 (model 55) at 0xe400, irq 21
Asus Virtuoso 100 (rev 2) at 0xe800, irq 20
HDA ATI SB at 0xfe9f0000 irq 16
HDA ATI HDMI at 0xfeaec000 irq 30

Audio devices:
0: C-Media PCI DAC/ADC (DUPLEX)
1: Multichannel (DUPLEX)
2: ALC889 Analog (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices:
0: C-Media CMI8738 MIDI

Timers:
7: system timer

Mixers:
0: CMedia PCI
1: AV200
2: Realtek ALC889
3: ATI R6xx HDMI


cat /proc/asound/seq/clients

CODE
Client info
 cur  clients : 5
 peak clients : 7
 max  clients : 192

Client   0 : "System" [Kernel]
 Port   0 : "Timer" (Rwe-)
 Port   1 : "Announce" (R-e-)
   Connecting To: 15:0
Client  14 : "Midi Through" [Kernel]
 Port   0 : "Midi Through Port-0" (RWe-)
Client  15 : "OSS sequencer" [Kernel]
 Port   0 : "Receiver" (-we-)
   Connected From: 0:1
Client  16 : "C-Media CMI8738" [Kernel]
 Port   0 : "C-Media CMI8738 MIDI" (RWeX)
Client  17 : "OPL3 FM synth" [Kernel]
 Port   0 : "OPL3 FM Port" (-We-)
 Port   1 : "OPL3 OSS Port" (-we-)


so in this case, to play back MIDI music i'd use aplaymidi --port 17:0 filename.mid

Thats it all really, have fun

Lemonzest


--------------------
Desktop: Phenom II X6 1090T Hex-Core (Socket AM3), 16GB RAM, MSI 870-C45, 5x 1TB HDD, Radeon HD 6770 1GB, Mageia 2 x86_64

Test Box:Intel Pentium E2180 (Socket 775), 4GB DDR3, ASRock G41-VS3 2.0, 4x 1TB, 2x 500GB, Onboard GFX, Mageia 2 x86_64

Connection: Virgin Media XL 60Mb/s Down, 3Mb/s Up
PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll