cmictl - direct CMI8338/8738 controller About cmictl ============ The program `cmictl` sets some internal parameters of CMI 8338/8738 based soundcard. You may be able to use S/PDIF out of your card. (This program is only availablke on Linux.) Parameters that cmictl can treat are the following: * S/PDIF-in * S/PDIF-out * S/PDIF-loop * S/PDIF-monitor (SPDIF-in to Analog-out) * S/PDIF-out voltage (5V / 0.5V) * S/PDIF frequency (48kHz / 44kHz) * surround (untested) * 4 speaker mode (untested) * exchange front / rear speaker (untested) * change S/PDIF-in phase state: normal, inverse Some parameters are only available on CMI8738 based cards. About gcmictl ============= gcmictl is a tiny GUI frontend of cmictl. You can control all of above parameters with GUI interface. It requires GTK+ library ( >= 1.2.0 ). *** WARNING *** =============== This program controlles PCI card's register directly. So if the wrong parameter is specified, it will causes serious situation on your Linux box. Of course, it may contains some bugs (I can't figure out yet). So it will be a serious security issue of your box. This programs is developed by a user of CMI8738 based card. C-Media electronics (developper of CMI chips) has no responsibility of thie program, so please do not send any questions about it to C-Media. Installation ============ First, you "MUST" set your CMI8338/8738 based card on your PC :) and compile your Linux kernel with cmpci driver. # The latest version of cmpci driver is available at C-Media's page. # http://www.cmedia.com.tw/ To build the cmictl, please refer `INSTALL` file to install program. Typically you can enter the following: # ./configure --with-cmibase=(CMI BASE ADDRESS) --{enable,disable}-cmi8738 # make # make install You can specify base address of CMI cards by `--with-cmibase`. The base address will available /proc/ioports. You can see it with: # cat /proc/ioports : 6800-68ff : cmpci : In this case, the base address is 0x6800. So you can specify configure option as `--with-cmibase=0x6800`. The address will differ in every machines and environment. IF THE ADDRESS IS WRONG, `cmictl` MAY ABLE TO DESTROY YOUR MACHINE. If '--with-cmibase' not specified, configure scripts attempt to guess the correct value of base address from /proc/ioports. If your card is based on CMI8338 chip, specify `--disable-cmi8738`. If you don't need to create `gcmictl`, specify `--disable-gcmictl`. The installation process installs program (`cmictl`, `gcmictl`) and NLS messages. Usage of cmictl ================ To use `cmictl`, you should be root. (Please do not setuid root to cmictl. It will causes security issue.) `# cmictl` shows usage messages. usage: cmictl [options] Options: -d, --show Display current status of CMI8338/8738. -V, --version Show version information. -i, --spdif-in Enable / Disable S/PDIF-in. -o, --spdif-out Enable / Disable S/PDIF-out. -l, --spdif-loop Enable / Disable S/PDIF-loop. -f, --legacy-to-spdif Enable / Disable legacy sound to S/PDIF-out. -m, --spdif-monitor Enable / Disable S/PDIF-in to analog-out. -5, --spdif-5v S/PDIF out voltage. on:5V off:0.5V -8, --spdif-48 S/PDIF frequency. on:48kHz off:44kHz -s, --surround Enable / Disable surround. -p, --4speaker Enable / Disable 4 speaker mode. -r, --rear-to-front Enable / Disable exchange front / rear speaker. -a, --phase-reverse Change input signal phase of S/PDIF. -h, --help Show this help message. is ON/OFF, TRUE/FALSE, YES/NO For example, if you want to enable S/PDIF-out, enter # cmictl --spdif-out on To see the current status of chip, # cmictl --show Usage of gcmictl ================ To use gcmictl, execute it as root or setuid root to cmictl. Many of options of cmictl are covered by gcmictl. To enable S/PDIF-out, click the checkbutton of "SPDIF OUT". The actions (check, select) are NOT reflected immediately. To apply all changes you've done, press "Apply" button. If you want to cancel your choice, press "Cancel" button. Ofcource, once you pressed "Apply" button, all changes cannot be undone any more. MEMO ==== If S/PDIF-out is enabled, the sampling frequency of your card is restricted only to 44.1kHz (or 48kHz if `--spdif-48 on`). Any output to cmi's dsp device will be pronounced with fixed rate even if the output is 22.05kHz. With `EsounD`, you can avoid such situation. First you execute `esd` daemon, and use every PCM player with esddsp (or esdcat). ex.) % esd /dev/dsp % mpg123 -s -r 22050 lowquarity.mp3 | esdcat -r 22050 % esddsp mtv lowsound.mpg (But it will make asynchronous of video and sound frame) To change S/PDIF frequency rate with `--spdif-48`, you may have to enter `# cmictl --spdif-48 on` 2 or 3 time. I don't know the problem caused whether by my code or by hardware specification. COPYING ======== This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Availability ============ The latest version of cmictl will be available at: http://member.nifty.ne.jp/Breeze/softwares/unix/index-e.html Author ====== Daisuke Nagano