Since 2004/01/11 02:30:56 PST FreeBSD 5.x has Audigy (and Audigy2) support in kernel in emu10k1 driver. It is based on patch by Orlando Bassotto and does not support complex mixer settings and MIDI I/O. You can use it if you do not use MIDI or other features of emu10kx driver.
For Linux driver please visit ALSA Project
For Windows driver you can look at KX Project if you
don't like Creative driver
emuctrl rset mix0 XX:YY
to set recording volume to
XX:YY, because 'rec' level is not available through the
mixer
on recent FreeBSD versions. Recording is
tested on Audigy 2 Value at 48kHz / 16bit / stereo.
emuctrl
command: save
. Also
add emuctrl
rc.d script (not connected to install)
that should save / restore emu10kx settings much like
mixer
rc.d.
make clean
, make
, make install
.
/sbin/mknod /dev/emu10kx0 c <major> <minor>command to create device file.
#snd_pcm_load="YES" # Digital sound subsystem , FreeBSD 4 and 5 before # snd_pcm -> sound change sound_load="YES" # FreeBSD 5 with new sound naming midi_load="NO" # Do not load midi2 - read Known Bugs section. snd_emu10k1_load="NO" # do not load Creative Sound Blaster Live snd_emu10kx_load="YES" # Creative Sound Blaster Live / Audigyto your loader.conf. You should disable emu10k1 driver (they are for the same hardware).
# Add if you use midi2. /sbin/kldload midi # Creative Sound Blaster Live / Audigy /sbin/kldload snd_emu10kxto your /etc/rc.local.
emu10kx0: <Creative EMU10K2 (Audigy)> port 0xd000-0xd01f irq 12 at device 10.0 on pci0 midi0: <EMU10Kx MIDI Interface (midi2)> on emu10kx0 midi0: midi interrupt 00000080 without interrupt handler, force mread! midi0: midi interrupt 00000080 without interrupt handler, force mread! midi1: <EMU10Kx MIDI Interface (midi2)> on emu10kx0 midi1: midi interrupt 08000000 without interrupt handler, force mread! midi1: midi interrupt 08000000 without interrupt handler, force mread! pcm0: <EMU10Kx PCM Interface> on emu10kx0 pcm0: <TriTech TR28602 AC97 Codec>on your console, if you use midi2, or
emu10kx0: <Creative EMU10K2 (Audigy)> port 0xd000-0xd01f irq 12 at device 10.0 on pci0 midi0: <EMU10Kx MIDI Interface (NEWMIDI)> on emu10kx0 midi1: <EMU10Kx MIDI Interface (NEWMIDI)> on emu10kx0 pcm0: <EMU10Kx PCM Interface> on emu10kx0 pcm0: <TriTech TR28602 AC97 Codec>if you use NEWMIDI.
# Set card in analog mode /usr/sbin/emuctrl mode analog # Set AudigyDrive Headphones (out3) to full volume /usr/sbin/emuctrl set out3 100 # Enable MIDI IR events /usr/sbin/emuctrl ir enableto your /etc/rc.local. Use
emuctrl list
to list
available connectors. You may find that PCM volume in emu10kx
driver is lower than if you use emu10k1 driver. This happens
because emu10k1 driver has additional amplification in DSP code
(all pcm samples are multipled by 4).
This driver can be compiled with MIDI I/O support. It provides only basic MPU UART interface and can't be used to play MIDI files without external synthesizer. On Live! cards you will get one MIDI device, on Audigy - two devices, one for on-card DB15 (joystick) connector and one for MIDI ports on AudigyDrive.
Makefile variable vs FreeBSD version | FreeBSD 4.x, no MIDI |
FreeBSD 5.x, -CURRENT with NEWMIDI |
FreeBSD 5.x, -CURRENT without NEWMIDI |
FreeBSD 5.x, -CURRENT with midi2 (*) |
EMU10KX_WITH_MIDI=yes (NEWMIDI MIDI I/O) |
No | Yes, should have device midi . Driver cannot be unloaded. |
No | No |
EMU10KX_WITH_MIDI2=yes (midi2 MIDI I/O) |
No | Yes(**), should install midi2 |
Yes(**), should install midi2 |
Yes(**) |
Without MIDI I/O | Yes | Yes | Yes | Yes |
IR receiver on Live!Drive and AudigyDrive is an internal MIDI controller.
If you have an AudigyDrive, you can use rcenter
and xmmspipe
by
Bejamin Lynn to control your xmms
(or any other
software) from remote control.
You may need to replace -lpthread with -lthr in rcenter Makefile, if
you run FreeBSD version that does not have libpthread.
IR receiver MIDI device for Audigy Platinum is /dev/midi1 with NEWMIDI MIDI and
/dev/midi1.0 with midi2 MIDI code.
You can enable LiveDrive! or AudigyDrive IR receiver
by running emuctrl ir enable
.
IR events cannot be disabled.
EMU10K-based sound cards from Creative have two operating modes:
analog and digital-only. When you load emu10kx
driver, it
puts Audigy card into 'digital-only' mode unless your card is reported to be
broken in digital mode. In later case card will be set to analog mode. SB Live!
cards are initialized in analog mode. You can check
current operating mode using emuctrl mode
command and switch
between them using emuctrl mode [analog|digital]
command.
On both Live! and Audigy cards, operating mode controls use of 'Analog/Digital Out' connector. On Live! cards it also controls sound on 'Rear Out' connector.
emuctrl output name | analog mode | digital-only mode |
AC97 (Front Speakers) | Line Out | Line Out, Analog/Digital Out(?) |
TOS Link | D/K | D/K |
DIGITAL: Center | Silent | Analog/Digital Out |
DIGITAL: Subwoofer | Silent | Analog/Digital Out |
Headphones | Live!Drive Headphones(?) | D/K |
Rear Speakers | Rear Out | Analog/Digital Out |
Center | Analog/Digital Out | Silent |
Subwoofer | Analog/Digital Out | Silent |
Where 'D/K' means 'Don't Know', 'Silent' means that signal, controlled by this volume control, does not appear on card connectors. Other names are connector names from my Audigy 'Getting Started' manual
emuctrl output name | analog mode | digital-only mode |
DIGITAL: Front | D/K | Analog/Digital Out |
DIGITAL: Center | D/K | Analog/Digital Out |
DIGITAL: Subwoofer | D/K | Analog/Digital Out |
Headphones | AudigyDrive Headphones | AudigyDrive Headphones |
DIGITAL: Rear | D/K | Analog/Digital Out |
Front | Line Out | Line Out |
Center | Analog/Digital Out | Silent |
Subwoofer | Analog/Digital Out | Silent |
Rear | Rear Out | Rear Out |
AC97 ?? | D/K | D/K |
Where 'D/K' means 'Don't Know', 'Silent' means that signal, controlled by this volume control, does not appear on card connectors. Other names are connector names from my Audigy 'Getting Started' manual
It seems that in both 'analog' and 'digital-only' modes you will get some sound on S/PDIF connectors on AudigyDrive.
I'm not an ASCII-art master, but I hope this will help you understand all volume controls and sound flow in emu10kx driver.
All volume controls except "Master Vol" and "Master Rec Vol" are controlled
from emuctrl
.
On Audigy "Master Vol" and "Master Rec Vol" are controlled from
mixer
by it's "vol" and "rec" controls. Fx0 volume
can be controlled from both emuctrl
("FX BUS 0") and
mixer
("pcm").
On SBLive! and Audigy "Master Vol" and "Master Rec Vol" can be changed from
emuctrl
. On Audigy, if you change "fx0" playback and "mix0"
playback or recording volume you will not see this changes in "vol", "rec" and
"pcm" mixer
values. This cannot be fixed (ac97.c
FreeBSD AC97 driver does not query AC97 codec when it asked about volume values.
Playback:
[InVolume0] | V [OutVol0] [input0]---->[*]-----\ | . | V . [InVolumeN] . [Master Vol] /---[*]---->[output0] . | | | / . V V V / [inputN]---->[*]--->[+]====>[*]======------>[*]---->[outputP] ^ ^ | | [fx0]------->[*]--->[+] [OutVolP] . ^ ^ . | | . [FxVolume0] | [fxM]------->[*]----/ ^ | [FxVolumeM]
where output0..P are non-recording STEREO and MONO outputs (on-card or on-Drive connectors).
If you want to listen to sound coming from AC97 codec (like analog CD Audio) on Audigy you should set "AC97 Codec" volume (usually in0) to non-zero (I like 75).
Mono outputs, like Center and Subwoofer, are just (Left + Right)/2.
Recording:
[InRecVolume0] | V [input0]---->[*]-----\ . | . [InRecVolumeN] . [Master Rec Vol] . | | | . V V V [inputN]---->[*]--->[+]====>[*]======------>[*]---->[outputX] ^ ^ | | [fx0]------->[*]----[+] [OutRecVolX] . ^ | . | | . [FxRecVolume0] | [fxM]------->[*]----/ ^ | [FxRecVolumeM]
where outputX is a STEREO DSP recording output (usually named
"A/D converter (REC)"). Recording on MONO DSP recording output
("Mic (REC)") does not supported.
If you want to record sound you must set both "A/D converter" volume in
emuctrl
and "rec" volume in mixer
(that controls
"Master Rec Vol" on Audigy and AC97 recording level on SBLive!) to non-zero.
This card is capable of recording of up to 16 different streams (locked to 48Khz/16bit/Stereo) in addition to "A/D converter" (not locked to 48Khz/16Bit/Stereo). This driver does not support it.
Sound inside AC97 codec:
<input_i volume> <ac97 sample> = SUM(---------------- * <input_i sample>) i 100where <input_i volume>s are labeled "speaker", "line", "cd", "line1", "phin", "video", "mic" (this list depends on AC97 codec features) in mixer. There is no separate "recording" and "playback" AC97 connections to Audigy DSP, therefore setting rec input is useless. AC97 codec should be set to always record sound from all inputs (so-called 'stereo mix').
In DSP <ac97 sample> will be sent to both recording an playback bus, with amp, "rec" and AC97 input vol/recvol volume controls applied. For recording bus:
rec <DSP input_i recvol> <DSP recB sample> = --- * SUM(-------------------- * <DSP input_i sample>) 100 i 100 <DSP recB sample> = <DSP recB sample> * amp
After that it will go into all outputs that are marked as 'recording output' in driver (there are two inputs, but only one used because another one ('mic rec') is limited to 8Khz/8bit/mono):
<DSP rec output_j vol> <DSP rec output_j sample> = --------------------- * <DSP recB sample> 100after that <DSP rec output sample> will be sent to FreeBSD driver in up to 8k blocks.
For playback bus:
vol <DSP input_i vol> <DSP playB sample> = --- * SUM(----------------- * <DSP input_i sample>) 100 i 100 <DSP playB sample> = <DSP playB sample> * amp
And for each non-recording output (with mono downmix for mono outputs)
<DSP play output_k vol> <DSP play output_k sample> = ----------------------- * <DSP playB sample> 100
After that it will be sent to on-card DAC, AudigyDrive or S/PDIF connector.
AudigyDrive's 'SPDIF IN' is marked 'Optical S/PDIF' in emuctrl
.
I don't know, is 'Coaxial S/PDIF' connected to 'OPTICAL IN' (and labels in
emuctrl
just need to be swapped) or 'Connected S/PDIF'is connected
to something else (or not connected at all).
S/PDIF input is 24bit/96kHz, PCM only (there is no DolbyDigital&tm; compatible decoder in driver and no way to get full stream to userland decoder).
You should set amplification to '1' to avoid clipping.
You need to make (at least) this steps to record sound:
mixer rec <level>
command (mixer rec 100
is a good starting point). On SBLive! cards master
recording level is always 100%
mixer rec <level>
command (mixer rec 100
is a good starting point). On Audigy cards AC97
recording level is always 0% - you record AC97 playback signal.
emuctrl set outX <level>
, where X is 6
on SBLive! and 13 on Audigy. 100% is good number to start with.
mixer
command. Please note that on Audigy you always
record a mix of all AC97 inputs, not 'recording source'!
emuctrl rset inX <level>
.
Example: recording from AUX2 (on AudigyDrive) on Audigy
mixer rec 100 ## set record bus volume emuctrl amp 4 ## amplify every input four times emuctrl set out13 100 ## set recording volume for DSP output emuctrl rset in6 100 ## set recording volume for DSP input wavrec test.wav ## record 10s using wavrec from ports/audio/wavplay port.
I hope that following checklist help you troubleshoot basic problems (like 'driver fails to load').
Look for /dev/emu10kx0
If you have it:
Look inside this file ( cat /dev/emu10kx0
). You should see
something like this:
FreeBSD EMU10Kx Audio Driver Hardware resource usage: DSP General Purpose Registers: 154 used, 512 total DSP Instruction Registers: 168 used, 1024 total Card supports AC97 codec and 5.1 output, Audigy DSP code Installed devices: EMU10Kx Mixer Interface on emu10kx0 FX BUSes Inputs Outputs Playback 1 8 18 Recording 1 8 0 EMU10Kx PCM Interface on pcm0 Digital mode, S/PDIF output is PCM stereo
If you see this message than driver is loaded. You may need to adjust volume
or set analog / digital card mode using emuctrl
program.
Use emuctrl debug on
to unhide some mixer controls. If you have mixer control that was hidden,
but this control changes volume on your card outputs, or can't get any
sound from your card with all controls at 100%, please send me
information described in If above steps fails
section.
If you see message on console 'Device not configured' than driver is not loaded.
Check for PCM sound subsystem - look for /dev/sndstat file
If you don't have it:
Your system cannot load sound subsystem module. Make shure that
you have sound.ko
or snd_pcm.ko
module
in your kernel modules directory. If you use MODULES_OVERRIDE option
in your kernel configuration file, add "sound/sound" or "sound/pcm",
depending on your OS version.
If you have that module, try to load it (kldload sound
or kldload snd_pcm
) and watch for message on system console.
For FreeBSD 5.3 and later you can include "device sound" in your kernel
configuration.
You have it:
Look inside it (cat /dev/sndstat
). You should see a list
of installed devices. If you have any of the following lines
pcmX: <Creative EMU10K1> on pciX .... pcmX: <Creative Audigy (EMU10K2)> on pciX .... pcmX: <Creative Audigy 2 (EMU10K2)> on pciX ....than you have emu10k1 driver loaded and your card is supported by that driver. You need to disable emu10k1 driver.
You don't have anything related to EMU10K1 or EMU10K2 in /dev/sndstat.
Check that your card is listed in pciconf -l -v
output. If you can't find your card there, than something wrong with your
hardware...
I'll need some information about your system:
dmesg
output.
pciconf -v -l
output.
kldstat
output.
cat /dev/sndstat
output.
cat /dev/emu10kx0
output.
Device configuration finished. procfs registered Timecounter "TSC" frequency 400910787 Hz quality 800 Timecounters tick every 10.000 msec Linux ELF exec handler installedon my computer.
Links to archive and other versions are removed. Latest version should work for all versions of FreeBSD 4.x and 5.x. Driver by Orlando Bassotto is committed to FreeBSD 5.
my e-mail: chibis @ gfk . ru .
please add "[AUDIGY]" or "[SBLIVE]", in Subject
to help me filter your mail out of tons of SPAM.
You can discuss this driver with other users (_not_ me) on Audigy drivers Forums
I don't have time to track all posts on this forum.
Yuriy Tsibizov,
GfK RUS network admin
$Id: readme-en.htm,v 1.39 2005/10/15 19:53:23 chibis Exp $