Add ld10k1 tool

Added ld10k1 tool by Peter Zubaj.
This commit is contained in:
Takashi Iwai 2005-03-18 13:40:44 +00:00
parent 37104ebf62
commit 2df1aa7c20
98 changed files with 19970 additions and 1 deletions

345
ld10k1/doc/Audigy-mixer.txt Normal file
View file

@ -0,0 +1,345 @@
Sound Blaster Audigy mixer / default DSP code
===========================================
This is based on SB-Live-mixer.txt.
The EMU10K2 chips have a DSP part which can be programmed to support
various ways of sample processing, which is described here.
(This acticle does not deal with the overall functionality of the
EMU10K2 chips. See the manuals section for further details.)
The ALSA driver programs this portion of chip by default code
(can be altered later) which offers the following functionality:
1) Digital mixer controls
-------------------------
These controls are built using the DSP instructions. They offer extended
functionality. Only the default build-in code in the ALSA driver is described
here. Note that the controls work as attenuators: the maximum value is the
neutral position leaving the signal unchanged. Note that if the same destination
is mentioned in multiple controls, the signal is accumulated and can be wrapped
(set to maximal or minimal value without checking of overflow).
Explanation of used abbreviations:
DAC - digital to analog converter
ADC - analog to digital converter
I2S - one-way three wire serial bus for digital sound by Philips Semiconductors
(this standard is used for connecting standalone DAC and ADC converters)
LFE - low frequency effects (subwoofer signal)
AC97 - a chip containing an analog mixer, DAC and ADC converters
IEC958 - S/PDIF
FX-bus - the EMU10K2 chip has an effect bus containing 64 accumulators.
Each of the synthesizer voices can feed its output to these accumulators
and the DSP microcontroller can operate with the resulting sum.
name='PCM Front Playback Volume',index=0
This control is used to attenuate samples for left and right front PCM FX-bus
accumulators. ALSA uses accumulators 8 and 9 for left and right front PCM
samples for 5.1 playback. The result samples are forwarded to the front DAC PCM
slots of the Philips DAC.
name='PCM Surround Playback Volume',index=0
This control is used to attenuate samples for left and right surround PCM FX-bus
accumulators. ALSA uses accumulators 2 and 3 for left and right surround PCM
samples for 5.1 playback. The result samples are forwarded to the surround DAC PCM
slots of the Philips DAC.
name='PCM Center Playback Volume',index=0
This control is used to attenuate samples for center PCM FX-bus accumulator.
ALSA uses accumulator 6 for center PCM sample for 5.1 playback. The result sample
is forwarded to the center DAC PCM slot of the Philips DAC.
name='PCM LFE Playback Volume',index=0
This control is used to attenuate sample for LFE PCM FX-bus accumulator.
ALSA uses accumulator 7 for LFE PCM sample for 5.1 playback. The result sample
is forwarded to the LFE DAC PCM slot of the Philips DAC.
name='PCM Playback Volume',index=0
This control is used to attenuate samples for left and right PCM FX-bus
accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples for
stereo playback. The result samples are forwarded to the front DAC PCM slots
of the Philips DAC.
name='PCM Capture Volume',index=0
This control is used to attenuate samples for left and right PCM FX-bus
accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.
The result is forwarded to the ADC capture FIFO (thus to the standard capture
PCM device).
name='Music Playback Volume',index=0
This control is used to attenuate samples for left and right MIDI FX-bus
accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
name='Music Capture Volume',index=0
These controls are used to attenuate samples for left and right MIDI FX-bus
accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
The result is forwarded to the ADC capture FIFO (thus to the standard capture
PCM device).
name='Mic Playback Volume',index=0
This control is used to attenuate samples for left and right Mic input.
For Mic input is used AC97 codec. The result samples are forwarded to
the front DAC PCM slots of the Philips DAC. Samples are forwarded to Mic
capture FIFO (device 1 - 16bit/8KHz mono) too without volume control.
name='Mic Capture Volume',index=0
This control is used to attenuate samples for left and right Mic input.
The result is forwarded to the ADC capture FIFO (thus to the standard capture
PCM device).
name='Audigy CD Playback Volume',index=0
This control is used to attenuate samples from left and right IEC958 TTL
digital inputs (usually used by a CDROM drive). The result samples are
forwarded to the front DAC PCM slots of the Philips DAC.
name='Audigy CD Capture Volume',index=0
This control is used to attenuate samples from left and right IEC958 TTL
digital inputs (usually used by a CDROM drive). The result samples are
forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
name='IEC958 Optical Playback Volume',index=0
This control is used to attenuate samples from left and right IEC958 optical
digital input. The result samples are forwarded to the front DAC PCM slots
of the Philips DAC.
name='IEC958 Optical Capture Volume',index=0
This control is used to attenuate samples from left and right IEC958 optical
digital inputs. The result samples are forwarded to the ADC capture FIFO
(thus to the standard capture PCM device).
name='Line2 Playback Volume',index=0
This control is used to attenuate samples from left and right I2S ADC
inputs (on the AudigyDrive). The result samples are forwarded to the front
DAC PCM slots of the Philips DAC.
name='Line2 Capture Volume',index=1
This control is used to attenuate samples from left and right I2S ADC
inputs (on the AudigyDrive). The result samples are forwarded to the ADC
capture FIFO (thus to the standard capture PCM device).
name='Analog Mix Playback Volume',index=0
This control is used to attenuate samples from left and right I2S ADC
inputs from Philips ADC. The result samples are forwarded to the front
DAC PCM slots of the Philips DAC. This contains mix from analog sources
like CD, Line In, Aux, ....
name='Analog Mix Capture Volume',index=1
This control is used to attenuate samples from left and right I2S ADC
inputs Philips ADC. The result samples are forwarded to the ADC
capture FIFO (thus to the standard capture PCM device).
name='Aux2 Playback Volume',index=0
This control is used to attenuate samples from left and right I2S ADC
inputs (on the AudigyDrive). The result samples are forwarded to the front
DAC PCM slots of the Philips DAC.
name='Aux2 Capture Volume',index=1
This control is used to attenuate samples from left and right I2S ADC
inputs (on the AudigyDrive). The result samples are forwarded to the ADC
capture FIFO (thus to the standard capture PCM device).
name='Front Playback Volume',index=0
All stereo signals are mixed together and mirrored to surround, center and LFE.
This control is used to attenuate samples for left and right front speakers of
this mix.
name='Surround Playback Volume',index=0
All stereo signals are mixed together and mirrored to surround, center and LFE.
This control is used to attenuate samples for left and right surround speakers of
this mix.
name='Center Playback Volume',index=0
All stereo signals are mixed together and mirrored to surround, center and LFE.
This control is used to attenuate sample for center speaker of this mix.
name='LFE Playback Volume',index=0
All stereo signals are mixed together and mirrored to surround, center and LFE.
This control is used to attenuate sample for LFE speaker of this mix.
name='Tone Control - Switch',index=0
This control turns the tone control on or off. The samples for front, rear
and center / LFE outputs are affected.
name='Tone Control - Bass',index=0
This control sets the bass intensity. There is no neutral value!!
When the tone control code is activated, the samples are always modified.
The closest value to pure signal is 20.
name='Tone Control - Treble',index=0
This control sets the treble intensity. There is no neutral value!!
When the tone control code is activated, the samples are always modified.
The closest value to pure signal is 20.
name='Master Playback Volume',index=0
This control is used to attenuate samples for front, surround, center and
LFE outputs.
name='IEC958 Optical Raw Playback Switch',index=0
If this switch is on, then the samples for the IEC958 (S/PDIF) digital
output are taken only from the raw FX8010 PCM, otherwise standard front
PCM samples are taken.
2) PCM stream related controls
------------------------------
name='EMU10K1 PCM Volume',index 0-31
Channel volume attenuation in range 0-0xffff. The maximum value (no
attenuation) is default. The channel mapping for three values is
as follows:
0 - mono, default 0xffff (no attenuation)
1 - left, default 0xffff (no attenuation)
2 - right, default 0xffff (no attenuation)
name='EMU10K1 PCM Send Routing',index 0-31
This control specifies the destination - FX-bus accumulators. There 24
values with this mapping:
0 - mono, A destination (FX-bus 0-63), default 0
1 - mono, B destination (FX-bus 0-63), default 1
2 - mono, C destination (FX-bus 0-63), default 2
3 - mono, D destination (FX-bus 0-63), default 3
4 - mono, E destination (FX-bus 0-63), default 0
5 - mono, F destination (FX-bus 0-63), default 0
6 - mono, G destination (FX-bus 0-63), default 0
7 - mono, H destination (FX-bus 0-63), default 0
8 - left, A destination (FX-bus 0-63), default 0
9 - left, B destination (FX-bus 0-63), default 1
10 - left, C destination (FX-bus 0-63), default 2
11 - left, D destination (FX-bus 0-63), default 3
12 - left, E destination (FX-bus 0-63), default 0
13 - left, F destination (FX-bus 0-63), default 0
14 - left, G destination (FX-bus 0-63), default 0
15 - left, H destination (FX-bus 0-63), default 0
16 - right, A destination (FX-bus 0-63), default 0
17 - right, B destination (FX-bus 0-63), default 1
18 - right, C destination (FX-bus 0-63), default 2
19 - right, D destination (FX-bus 0-63), default 3
20 - right, E destination (FX-bus 0-63), default 0
21 - right, F destination (FX-bus 0-63), default 0
22 - right, G destination (FX-bus 0-63), default 0
23 - right, H destination (FX-bus 0-63), default 0
Don't forget that it's illegal to assign a channel to the same FX-bus accumulator
more than once (it means 0=0 && 1=0 is an invalid combination).
name='EMU10K1 PCM Send Volume',index 0-31
It specifies the attenuation (amount) for given destination in range 0-255.
The channel mapping is following:
0 - mono, A destination attn, default 255 (no attenuation)
1 - mono, B destination attn, default 255 (no attenuation)
2 - mono, C destination attn, default 0 (mute)
3 - mono, D destination attn, default 0 (mute)
4 - mono, E destination attn, default 0 (mute)
5 - mono, F destination attn, default 0 (mute)
6 - mono, G destination attn, default 0 (mute)
7 - mono, H destination attn, default 0 (mute)
8 - left, A destination attn, default 255 (no attenuation)
9 - left, B destination attn, default 0 (mute)
10 - left, C destination attn, default 0 (mute)
11 - left, D destination attn, default 0 (mute)
12 - left, E destination attn, default 0 (mute)
13 - left, F destination attn, default 0 (mute)
14 - left, G destination attn, default 0 (mute)
15 - left, H destination attn, default 0 (mute)
16 - right, A destination attn, default 0 (mute)
17 - right, B destination attn, default 255 (no attenuation)
18 - right, C destination attn, default 0 (mute)
19 - right, D destination attn, default 0 (mute)
20 - right, E destination attn, default 0 (mute)
21 - right, F destination attn, default 0 (mute)
22 - right, G destination attn, default 0 (mute)
23 - right, H destination attn, default 0 (mute)
4) MANUALS/PATENTS:
-------------------
ftp://opensource.creative.com/pub/doc
-------------------------------------
Files:
LM4545.pdf AC97 Codec
m2049.pdf The EMU10K1 Digital Audio Processor
hog63.ps FX8010 - A DSP Chip Architecture for Audio Effects
WIPO Patents
------------
Patent numbers:
WO 9901813 (A1) Audio Effects Processor with multiple asynchronous (Jan. 14, 1999)
streams
WO 9901814 (A1) Processor with Instruction Set for Audio Effects (Jan. 14, 1999)
WO 9901953 (A1) Audio Effects Processor having Decoupled Instruction
Execution and Audio Data Sequencing (Jan. 14, 1999)
US Patents (http://www.uspto.gov/)
----------------------------------
US 5925841 Digital Sampling Instrument employing cache memory (Jul. 20, 1999)
US 5928342 Audio Effects Processor integrated on a single chip (Jul. 27, 1999)
with a multiport memory onto which multiple asynchronous
digital sound samples can be concurrently loaded
US 5930158 Processor with Instruction Set for Audio Effects (Jul. 27, 1999)
US 6032235 Memory initialization circuit (Tram) (Feb. 29, 2000)
US 6138207 Interpolation looping of audio samples in cache connected to (Oct. 24, 2000)
system bus with prioritization and modification of bus transfers
in accordance with loop ends and minimum block sizes
US 6151670 Method for conserving memory storage using a (Nov. 21, 2000)
pool of short term memory registers
US 6195715 Interrupt control for multiple programs communicating with (Feb. 27, 2001)
a common interrupt by associating programs to GP registers,
defining interrupt register, polling GP registers, and invoking
callback routine associated with defined interrupt register

39
ld10k1/doc/AudigyTRAM.txt Normal file
View file

@ -0,0 +1,39 @@
TRAM setup:
TCBS (0x44) and TCB (0x41) has same meaning as on SB Live
Internal TRAM size is 0x4000
Max external TRAM size is 0x100000 - as on SB Live
Register description:
0xdb - Internal TRAM Delay Base Address Counter
0xde - External TRAM Delay Base Address Counter
0x100 - 0x1ff - tram access control registers (?)
- only 5 bit valid
bit : 4 - 0 - use log. compresion on write and read
1 - use raw access - data from/to tram are read/wrote
as 16 bit samples
bits : 321 - ???
001 - read from tram
010 - read from tram
011 - write to tram + 0111, 1001
100 - read from tram
101 - read from tram
110 - read from tram
others - ?????
bit: 0 - 0 - normal mode
1 - clear tram - set to data register valid address
until TRAM counter reaches this address, reads from
tram will return 0, then this flag is zeroed and
tram is working in normal mode, working for read
0x200 - 0x2ff - tram access data registers
- same as on SB Live
0x300 - 0x3ff - tram access address registers
- address format - host: 32 bit offset 20 bit integer part + 12 bit fractional part
to set offset to 0x123(SB Live) - 0x123 << 11 (Audigy)
- address format - DSP: same as SB Live ???
internal TRAM has index 0x00 - 0xbf
external TRAM has index 0xc0 - 0xff

1
ld10k1/doc/Makefile.am Normal file
View file

@ -0,0 +1 @@
EXTRA_DIST = ld10k1_usage lo10k1_usage dl10k1_usage AudigyTRAM.txt README Audigy-mixer.txt

5
ld10k1/doc/README Normal file
View file

@ -0,0 +1,5 @@
ld10k1_usage - short command line help for ld10k1
lo10k1_usage - short command line help for lo10k1
dl10k1_usage - short command line help for dl10k1
AudigyTRAM.txt - everythink what I know about TRAM on Audigy
Audigy-mixer.txt - some info on audigy 1,2 mixer

19
ld10k1/doc/dl10k1_usage Normal file
View file

@ -0,0 +1,19 @@
dl10k1 is dump loader
You can load config with ld10k1, lo10k1 and then make dump. This dum can be loaded without usage
of ld10k1
Parameters:
-h or --help
Prints short help message
-c num or --card num
Use card number num - dl10k1 will use device with name hw:0
example:
dl10k1 -c 1
Use card 1
-d or --dump
File with dump

36
ld10k1/doc/ld10k1_usage Normal file
View file

@ -0,0 +1,36 @@
ld10k1 is server part - linker - it must run to use loader
There must be exactly one instance for one emu10k1 based card wich you want use.
Parameters:
-h or --help
Prints short help message
-c num or --card num
Use card number num - ld10k1 will use device with name hw:0
example:
ld10k1 -c 1
Use card 1
-p name or --pipe_name name
ld10k1 will listen on named socked name. This socket is used for communication with lo10k1.
Default is /tmp/.ld10k1_port
-t size or --tram_size size
Initialize initial TRAM size to size size. Size is rounded up to next valid value. Size is in samples and
can be one of 0 - external tram is disabled, 1 - 16384, 2 - 32768, 3 - 65536, 4 - 131072, 5 - 262144,
6 -524288, 7 - 1048576, 8 - 1048576. For Audigy 1, Audigy 2 you need patch from patch directory,
because current ALSA version doesn't supports TRAM on these cards.
example:
ld10k1 -t 7
-n or --network
ld10k1 default uses named socket, this switch to use network socket. You can use --port options to
define port to listen
--port portnum
listen on port portnum.
-d or --daemon
ld10k1 runs as daemon.

245
ld10k1/doc/lo10k1_usage Normal file
View file

@ -0,0 +1,245 @@
lo10k1 is loader.
Parameters:
-h or --help
Prints short help message
-l patch_name or --list path_name
List some usefull informations about patch in file patch_name. lo10k1 uses patch produced by as10k1 from
alsatools package.
-p name or --pipe_name name
lo10k1 will use local named pipe with name name to communication with linker. Default is /tmp/.ld10k1_port
-i or --info
Prints some info about card - not wery usefull
-a patch_name or --add patch_name
Loads patch from file patch_name to DSP
-d num or --del num
Unloads patch with number num from DSP. Use option --debug 4 to obtain patch numbers.
--conadd conn_string
Connects patches between each others or to inputs or outputs.
Format of conn_string:
FX buses:
FX(f1, ...) - specify fx bus register f1 can be number or fx bus register name
Names can be optained by lo10k1 --debug 7
FX(1)
FX(1,2)
FX(FX_PCM_Left,FX_PCM_Right)
Inputs:
IN(i1, ...) - specify input register i1 can be number or input register name
Names can be optained by lo10k1 --debug 8
IN(1)
IN(1,2)
IN(IN_AC97_Left,IN_AC97_Right)
Outputs:
OUT(o1, ...) - specify input register o1 can be number or input register name
Names can be optained by lo10k1 --debug 9
OUT(1)
OUT(1,2)
OUT(OUT_AC97_Front_Left,OUT_AC97_Front_Right)
Patch inputs:
PIN(p, i1, ...) - p is patch number or patch name, i1 is input register i1 can be number or input register name
Patch numbers and names can be optained by lo10k1 --debug 5
Names can be optained by lo10k1 --debug patch_num
PIN(1) - all patch inputs for patch 1
PIN(Volume,IL,IL) - inputs IL and IR for patch Volume
PIN(2,0,1,2,3,4,5) - inputs 0,1,2,3,4,5 patch 2
Patch outputs:
POUT(p, o1, ...) - p is patch number or patch name, o1 is output register o1 can be number or outpur register name
Patch numbers and names can be optained by lo10k1 --debug 5
Names can be optained by lo10k1 --debug patch_num
POUT(1) - all patch outputs for patch 1
POUT(Volume,OL,OL) - outputs OL and OR for patch Volume
POUT(2,0,1,2,3,4,5) - outputs 0,1,2,3,4,5 patch 2
- connecting two patches:
something1=something2
or
something1:something2
or
something1>something2
something1,something2 - strings specify fx bus, input, output, patch input or patch output
something1 - must be patch input or output
Difference between = and > is that = connect only two patches > enables connecting more
patches together. If you have three patches p1,p2,p3 - p1 with output o1, p2 with input i2,
and p3 with input i3.
PIN(p2,i2)=POUT(p1,o1) - will connect p1 with p2
then next connect
PIN(p3,i3)=POUT(p1,o1) - will disconnect p1 and p2 and connect p1 with p2
but
PIN(p3,i3)>POUT(p1,o1) - will connect p1 and p2 - p2 input i2 and p3 input i3 will be connected
to p1 output o1
Diffrence between = and : is that = allocate extra instructions and register to properly add
sources. : uses same register for all sources and patches must care about this register.
Counts of connected inputs and outputs must be same.
FX busses, inputs and outputs can have multiple patches connected to them.
Examples:
lo10k1 --conadd "PIN(1)=FX(0,1)"
- connect to patch 1 input to fx bus 0 and 1
lo10k1 --conadd "PIN(2)=POUT(PCM)"
- connect to all patch 2 inputs all outputs from patch PCM
--condel conndel_string
Disconnects patch register.
Format of conndel_string:
something
something - strings specify patch input or patch output
Examples:
lo10k1 --condel "PIN(1)"
- disconnect all inputs of patch 1
lo10k1 --condel "POUT(PCM1,1,Center))"
- disconnect output 1 and Center from patch PCM
--debug num
Prints on console some debug information.
mum = 1 - prints registers information
mum = 2 - prints consts information
mum = 3 - prints instruction information
mum = 4 - prints information about TRAM
mum = 5 - prints loaded patch names and numbers
mum = 6 - prints patch order in DSP instruction memory
mum = 7 - prints fx information
mum = 8 - prints input information
mum = 9 - prints output information
mum = 100 and more - prints informations about loaded patches (--debug 100 - about patch number 0,
-- debug 101 about patch number 1, and so on)
--defionames
When patch is loaded, this assign default names for patch input and output registers.
Input/Output count:
1/1 - In/Out
2/2 - IL,IR/OL,OR
4/4 - IL,IR,IRL,IRR/OL,OR,ORL,ORR
6/6 - IL,IR,IRL,IRR,IC,ILFE/OL,OR,ORL,ORR,OC,OLFE
where:
In = Input
On = Output
IL = Input Left
OL = Output Left
IR = Input Right
OR = Output Right
IRL = Input Rear Left
ORL = Output Rear Left
IRR = Input Rear Right
ORR = Output Rear Right
IC = Input Center
OC = Output Center
ILFE = Input LFE
OLFE = Output LFE
--ctrl string
This options is used to concate, rename controls and sets various parameters for controls
String format:
c-name1,name2,...namen:outname
This concate controls with names name1, name2, ..namen to one control with name outname
Input controls must have same range and are single channel (this is limitation of as10k1).
Output control has n channes. This can be used only for as10k1 file format.
example:
c-masterl,masterr:master,t-master:1
Concate two controls masterl and masterr into one stereo control master with translaton table100
t-name:type
This sets translate function whitch translate range and current value from mixer value to gpr
value for control with name name. This can be used only for as10k1 file format.
Type can be:
0 - no translation is used
1 - table 100 - range 0-100 in mixer is translated to range 0-2^31
2 - bass - range 0-40 in mixer is translated to range 0-2^31 - used for bass control
3 - treble - range 0-40 in mixer is translated to range 0-2^31 - used for treble control
4 - on/off - control uses range 0-1
v-name:count
This sets number off visible channel in mixer. This can be used only for as10k1 file format.
example:
v-bass:1
for bass control which has 5 channels is in mixer visible only one
s-name:value1#value2# ...
This sets initial value for control.
i-name:value
Sets control index value to control
r-name:outname
This rename control with name name to control with name outname. This can be used only for native file format.
example:
r-master:PCM Master
Rename control master to control PCM Master
--patch_name name
Sets name for actualy loaded patch (it is used with -a option). Dafault name comes from patch file.
--where num
Used with -a option. Actualy loaded path will by loaded before patch with order num.
You can get patch order with --debug 5
--setup
When this option is used DSP on card is cleared.
--renam something=new_name
Same string as in connection add and plus PATCH(p) - specify patch with name p or number p
Examples:
lo10k1 --renam "IN(5)=CD Left"
- renames input 5 to CD Left
lo10k1 --renam "PATCH(Volume)=Mic Volume"
- renames patch Volume to Mic Volume
lo10k1 --renam "PIN(Volume,IC)=Center IN"
- renames patch Volume input IL to Center IN
--dump file
This will dump dsp instructions and register to file. This file can be loaded with dl10k1 without
ld10k1.
--host machine:port
ld10k1 default uses named socket, this switch to use network socket.
-P or --path add effect search paths (default will lo10k1 search in effects dir)
--store file.ld10k1
Stores DSP config to native ld10k1 file file.ld10k1
--restore file.ld10k1
Restores DSP config from native ld10k1 file file.ld10k1
--save_patch file.ld10k1
Saves patch specified with --where option to file file.ld10k1
--load_patch file.ld10k1
Loads patch to dsp on position specified with --where option from file file.ld10k1
--wait msec
Wait for ld10k1 for msec mili second.