1712 .asoundrc
From the ALSA wiki
Contents |
[edit] 2002-05-31
I finally managed to capture sound from spdif-in using my Terratec EWX24/96 (ICE1712). Doing it this way: arecord -D cards.pcm.iec958 -c 12 -r 44100 -f S32_LE test.wav, all other ways failed, as you can only record from spdif when using S32_LE and 12 channels. My problem now: This is a twelve track, 44 Hz 32bit Little Endian Wave ? I have no idea what to do next. I would like to record a single stereo signal from spdif-in. How can I accomplish that ?
AFAIK, the iec958 pcm device for ice1712 is not correctly set up in /usr/share/alsa/cards/IEC1712.conf. This is because ice1712 always needs 10 channels, and only the last two are used for spdif. In the config file above, it's defined using "route" pcm type, but it seems not working well. An easy solution is to define a pcm device by yourself, for example, by adding the following to ~/.asoundrc...
pcm.ice_spdif {
type plug
ttable.0.8 1
ttable.1.9 1
slave.pcm {
type hw
card 0
device 0
}
}
Where the card number depends on your hardware setting. Then you can play/record via -Dice_spdif option. This is always covered by "plug" device, so all formats/rates are possible. This is not feasible in all cases, because sometime you might want to access the hardware without any conversion in software, but the application cannot know whether it's really supported.
[edit] 2003-09-18
Here's another /etc/asound.conf (or ~/.asounrdc for individual users), expanded from the one found at alsa-project.org's soundcard matrix. This one is specifically for the Delta 1010, but may work well with other Delta cards. The key additions are...
- the ability to access the Monitor Mix or Digital Mix (labeled "pcm.mon_mix"), in particular to record from this device (`arecord -D -f cd mon_mix filename.wav`).
- an example multi_send device ("pcm.multi_send"), where I have simply combined ttable info from other channels to create a master send for my own studio. In this case, doing aplay -D muli_send filename.wav will play the file out channels 1,2,5,6,7,8 of my 1010. 1 and 2 are my monitors left and right, 5 and 6 are going to an oscilloscope (!) and 7 and 8 are going to two headphones.
pcm.ice1712 {
type hw
card 0
device 0
}
pcm.channel1 {
type plug
ttable.0.0 1 # studio monitor front left...Delta 1
ttable.0.1 1 # studio monitor front right...Delta 2
slave.pcm ice1712
}
pcm.channel2 {
type plug
ttable.0.2 1 # studio monitor rear left...Delta 3
ttable.0.3 1 # studio monitor rear right...Delta 4
slave.pcm ice1712
}
pcm.channel3 {
type plug
ttable.0.4 1 # oscilloscope 1...Delta 5
ttable.0.5 1 # oscilloscope 2...Delta 6
slave.pcm ice1712
}
pcm.channel4 {
type plug
ttable.0.6 1 # headphone 1...Delta 7
ttable.0.7 1 # headphone 2...Delta 8
slave.pcm ice1712
}
pcm.ice1712_spdif {
type plug
ttable.0.8 1 # S/PDIF left...Delta 9
ttable.1.9 1 # S/PDIF right...Delta 10
slave.pcm ice1712
}
pcm.mon_mix {
type plug
ttable.0.10 1 # digital mix left
ttable.1.11 1 # digital mix right
slave.pcm ice1712
}
pcm.multi_send {
type plug
ttable.0.0 1 # studio monitor front left...Delta 1
ttable.0.1 1 # studio monitor front right...Delta 2
ttable.0.4 1 # oscilloscope 1...Delta 5
ttable.0.5 1 # oscilloscope 2...Delta 6
ttable.0.6 1 # headphone 1...Delta 7
ttable.0.7 1 # headphone 2...Delta 8
slave.pcm ice1712
}
pcm.hwout {
type plug
slave.pcm ice1712
}
So, to play out the front monitors (1 and 2), pcm.channel1, I would do:
aplay -D channel1 filename.wav
To play to the rear speakers, 3 and 4:
aplay -D channel2 filename.wav
And to record (at cd quality) anything routed to the digital mix (by raising the levels in the envy24control panel):
arecord -D -f cd -D mon_mix filename.wav
One could easily make their pcm definition by pasting together the ttable specs from the other pcms, say to create a quad send.
pcm.quad {
type plug
ttable.0.0 1 # studio monitor front left...Delta 1
ttable.0.1 1 # studio monitor front right...Delta 2
ttable.0.2 1 # studio monitor rear left...Delta 3
ttable.0.3 1 # studio monitor rear right...Delta 4
slave.pcm ice1712
}
Kevin Ernste
[edit] 2003-11-23
For Audiophile 24/96 users:
pcm.ice1712 {
type hw
card 0
device 0
}
ctl.ice1712 {
type hw
card 0
}
pcm.analogout {
type plug
ttable.0.0 1 # (Out Left)
ttable.0.1 1 # (Out Right)
slave.pcm ice1712
}
pcm.ice_spdif {
type plug
ttable.0.2 1 # (Out Left, 2)
ttable.0.3 1 # (Out Right, 2)
slave.pcm ice1712
}
If you're like me you had trouble getting xmms to work natively with alsa. Use the above asound.rc, then set the xmms plugin to user defined, pcm.analogout. This card doesn't seem to like buffers greater than 148ms. Set that accordingly.
sparked at iglou dot com
[edit] 2004-02-25
From Jaroslav Kysela to the alsa-user mailing-list: Here is the most optimized way to create three devices without mixing of all 10 channels which your hardware (ICE1712) has:
pcm.dmixer12 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100 # set to your source rate
}
bindings.0 0
bindings.1 1
}
pcm.dmixer34 {
type dmix
ipc_key 1024 # must be same as for dmixer12
slave { # all parameters in this section
# must be same as for dmixer12
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
}
bindings.0 2
bindings.1 3
}
pcm.channel12 {
type plug
slave.pcm "dmixer12"
}
pcm.channel34 {
type plug
slave.pcm "dmixer34"
}
The channel56 and dmixer56 is identical with channel34/dmixer34 (simply replace appropriate numbers). Explanation: The specified bindings also REDUCES the used channels (only destination channels are mixed). It's great speedup for your hardware.Also, note that if you don't want mix sources, you may replace 'plug dmix' with 'plug dshare'. It is also very good optimization.
Followup comments from questions: The plug plugin figured that you have hardware with 10 channels so it sent all 10 channels to dmix plugin. The "auto" way may not be the "desired" way.
And it seems that 'dshare' just allows the two channels to be used as a pair and that is all? I can't play more than one stream to the same...
It's not limited to pair. You can divide your card to one stereo, and two surround streams with four channels for example.
output device using dshare, which I guess is why I use dmix! :)
Yes, the dshare plugin creates exclusive devices routed to different channels (you can separate the device with many channels to devices with less number of channels). The difference between dmix and dshare plugin is that dmix does sample mixing and dshare does sample copying which is far more faster.
[edit] 2004-11-17
JulianCable and TakashiIwai found out: Due to peculiarities of the ICE1712 chip there is a problem using the kernel OSS support. OSS applications can only use one stereo channel, which for most cards would not be the IEC958 channel.
If you want to use OSS and have access to all the channels then the aoss user level OSS emulation is more flexible as it lets the libasound stuff do its thing. This needs normal dynamically linked applications and will not work on closed source statically linked applications. The aoss "trick" works by defining pcm.dsp<n> alsa devices and then calling the program with the following:
% aoss your-own-app
For example, for a VX442 (2 stereo analog and 1 stereo IEC958), define the following in ~/.asoundrc or /etc/asound.conf:
pcm.dsp0 {
type plug
slave.pcm "front"
}
pcm.dsp1 {
type route
ttable.0.2 1
ttable.1.3 1
slave.pcm {
type hw
card 0
}
}
pcm.dsp2 {
type plug
slave.pcm "iec958"
}
[edit] 2005-01-02
To get SPDIF-IN working on the MAudio Audiophile 2496 with ALSA-0.9.6 (eg Suse 9.0) you need an .asoundrc file in your home directory. It needs just one entry named spdif_cap. According to Jaroslav Kysela this should look as follows:
pcm.spdif_cap {
... copy contents of ICE1712.pcm.iec958.0 {} from the file /usr/share/alsa/cards/ICE1712.conf here, and replace the entry (for capture, if there are more than one)
slave.channels 10
by
slave.channels 12
}
Afterwards you can record from SPDIF-IN with
# ':0' only if it is the first sound card arecord -D spdif_cap:0 xxx.wav
Newer ALSA distributions (I tried 1.0.6) already contain two different pcm entries for playback and capture. If capture.pcm still contains slave.channels 10 try to replace this by slave.channels 12. Then recording is done with
# ':0' only if it is the first sound card) arecord -D spdif:0 xxx.wav
Attention: The master clock on the Audiophile 2496 should be set to SPDIF-IN during record to get correct synchronisation of the incoming data. You can do this using
envy24control -> Hardware Settings -> Master Clock
or by calling:
amixer cset iface=MIXER,name='Multi Track Internal Clock' 13
After the recording is finished you should set the master clock to one of the internal clocks, e.g. to 44100 Hz. Otherwise the playback speed may be wrong if data that are coming in via SPDIF-IN have a different samplerate. Or the playback speed may be erratic if no data are coming in via SPDIF-IN. Again You can do this using envy24control or by calling:
amixer cset iface=MIXER,name='Multi Track Internal Clock' 8"
[edit] 2005-03-03
From a posting to the LAU mailing-list by JulienClaassen: Attached to this mail is a file called test, which is infact a .asoundrc for the delta 1010. One of you looking for it has two of those cards, as I remember. Just copy and edit the file. Excahnge every card 0 for card 1 (or what else) and hw:0,0 for hw:1,0 and so on. NOTE: Don't forget to rename the new devices for your second card and don't forget to invent a diferent ipc_key, between 0 and 32768 (I think). To the devices described in this file: pcm.mics1 and pcm.mics2 are microphone input 1 and 2. The output is stereo with the same soundmaterial on both channels. Kill the second ttable statment to get mono output. That's what your mic would produce. The devices io1 to io4 mark the following input pairs. All pairs are stereo (so in1 and in2, in3 and in4...). Those you can use with ecasound:
ecasound -i alsa,io1 -o (whatever output)
pcm.o1, pcm.o2... Those are output devices (again in stereo pairs.) CAREFUL: Those only worked with aplay! For ecasound, mplayer and the like there are other devices.
pcm.p1,... pcm.p4 Those are plug devices, which work fine with mplayer and ecasound and all the others I tried.
ecasound -i (some input) -o alsa,p1
pcm.!default Should be the default device. I only included it for purposes of experimentation.
pcm.hw0 {
type hw
card 0
}
pcm.mics1 {
type plug
slave.pcm hw0
ttable.0.0 1
ttable.1.0 1
}
pcm.mics2 {
type plug
slave.pcm hw0
ttable.0.1 1
ttable.1.1 1
}
pcm.io1 {
type plug
slave.pcm hw0
ttable.0.2 1
ttable.1.3 1
}
pcm.io2 {
type plug
slave.pcm {
type hw
card 0
}
ttable.0.4 1
ttable.1.5 1
}
pcm.io12 {
type plug
slave.pcm {
type hw
card 0
}
ttable.0.4 1
ttable.0.2 1
ttable.1.3 1
ttable.1.5 1
}
pcm.io3 {
type plug
slave.pcm {
type hw
card 0
}
ttable.0.6 1
ttable.1.7 1
}
pcm.o1 {
type dshare
ipc_key 888
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
format S16_LE
channels 2
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.o1 {
type hw;
card 0;
}
pcm.p1 {
type plug
slave.pcm o1
}
ctl.p1 {
type hw;
card 0;
}
pcm.o2 {
type dshare
ipc_key 888
slave {
pcm "hw:0,0"
rate 44100
}
bindings {
0 2
1 3
}
}
ctl.o2 {
type hw;
card 0;
}
pcm.p2 {
type plug
slave.pcm o2
}
pcm.o3 {
type dshare
ipc_key 888
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 4
1 5
}
}
ctl.o3 {
type hw;
card 0;
}
pcm.p3 {
type plug
slave.pcm o3
}
pcm.o4 {
type dshare
ipc_key 888
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 6
1 7
}
}
ctl.o4 {
type hw;
card 0;
}
pcm.p4 {
type plug
slave.pcm o4
}
pcm.fluid {
type dshare
ipc_key 888
slave {
pcm "hw:0,0"
period_time 0
period_size 64
buffer_size 256
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.fluid {
type hw;
card 0;
}
pcm.eca {
type plug
slave.pcm fluid
}
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
[edit] 2005-03-22
could someone please add a .asoundrc (for 6Fire) showing how to create a working microphone-in? trying desperately to record from my headset but nothing helps. i'm pretty sure my .asoundrc is not sufficient. my .asoundrc:
pcm.ice1712 {
type hw
card 0
}
ctl.ice1712 {
type hw
card 0
}
[edit] 2005-09-18
I finally figured out how to use dshare with the ice1712. With this I can play linuxsampler out of channels 1-4 and fluidsynth out of channels 5-6 simultaneously, with very low latency, and very low cpu load. -Garett
pcm_slave.66_slave {
pcm "hw:1,0"
channels 8
rate 44100
buffer_size 256
period_size 128
}
pcm.66ch1234_dshare {
type dshare
ipc_key 18273645
slave 66_slave
bindings.0 0
bindings.1 1
bindings.2 2
gindings.3 3
}
pcm.66ch1234 {
type plug
slave.pcm "66ch1234_dshare"
}
pcm.66ch56_dshare {
type dshare
ipc_key 18273645
slave 66_slave
bindings.0 4
bindings.1 5
}
pcm.66ch56
type plug
slave.pcm "66ch56_dshare"
}
[edit] 2007-01-29
Anybody wondering about how to easily enable sort of "Sensaura" for DMX 6fire 24/96 like in the Windows driver (to enable stereo ==> 5.1 upmix) may try this:
pcm.ice1712 {
type hw
card 0
device 0
}
pcm.!default {
type plug
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
slave.pcm ice1712
}
And if you want to use dmix and duplex:
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm {
@func concat
strings [ "dmix:0,FORMAT=S32_LE" ] #card number 0
}
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
capture.pcm {
type plug
slave.pcm {
@func concat
strings [ "dsnoop:0,FORMAT=S32_LE" ]#card number 0
}
}
}
[edit] 2007-06-30
I recently bought the M-Audio Audiophile 2496 and was struggling to get the same output both to the analog out and to the digital out without resampling to any fixed frequency. I have not seen any example how to do this, so here's mine current configuration:
pcm.!default {
type plug
slave audiophile
ttable.0.0 1 # H/W 1
ttable.1.1 1 # H/W 2
ttable.0.8 1 # S/PDIF L
ttable.1.9 1 # S/PDIF R
}
pcm_slave.audiophile {
pcm "hw:0,0"
}
pcm.analog {
type plug
slave audiophile
ttable.0.0 1 # H/W 1
ttable.1.1 1 # H/W 2
}
pcm.digital {
type plug
slave audiophile
ttable.0.8 1 # S/PDIF L
ttable.1.9 1 # S/PDIF R
}
pcm.mixer {
type plug
slave audiophile
ttable.0.10 1 # Digital Mixer L
ttable.1.11 1 # Digital Mixer R
}
Oh and mixer is for recording....
[edit] 2007-07-06
Here's configuration for outputting signal simultaneously to the analog and to the digital out with software mixing:
pcm.!default {
type plug
slave.pcm audiophile_dmix
ttable.0.0 1 # H/W 1
ttable.1.1 1 # H/W 2
ttable.0.8 1 # S/PDIF L
ttable.1.9 1 # S/PDIF R
}
pcm.analog {
type plug
slave.pcm audiophile
ttable.0.0 1 # H/W 1
ttable.1.1 1 # H/W 2
}
pcm.analog_dmix {
type plug
slave.pcm audiophile_dmix
ttable.0.0 1 # H/W 1
ttable.1.1 1 # H/W 2
}
pcm.digital {
type plug
slave.pcm audiophile
ttable.0.8 1 # S/PDIF L
ttable.1.9 1 # S/PDIF R
}
pcm.digital_dmix {
type plug
slave.pcm audiophile_dmix
ttable.0.8 1 # S/PDIF L
ttable.1.9 1 # S/PDIF R
}
pcm.audiophile_dmix {
type dmix
ipc_key 1024
slave {
pcm "audiophile"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
format S32_LE
}
}
pcm.audiophile {
type hw
card 0
device 0
}
By default signal is software mixed and outputted both to the analog and to the digital out:
mplayer -ao alsa:device=default test1.mp3
You can also mix different signals to the digital and the analog out:
mplayer -ao alsa:device=default test1.mp3
mplayer -ao alsa:device=analog_dmix test2.mp3
mplayer -ao alsa:device=digital_dmix test3.mp3
True audiophile playback without software mixing is also available (of course then you can use only one signal source):
mplayer -ao alsa:device=analog test1.mp3
or
mplayer -ao alsa:device=digital test1.mp3
For mmap using OSS applications (Quake, Enemy Territory) I found that artsdsp is the way to go (aoss, pulseaudio and esd did not work for me):
artsd -a alsa &
artsdsp -m et.x86
And it still is software mixing!

