From d6b2526254ea71302b4a243c2d74f89208a3a2fd Mon Sep 17 00:00:00 2001
From: Arno Schuring <aelschuring@hotmail.com>
Date: Fri, 21 Aug 2009 03:15:48 +0200
Subject: [PATCH 1/2] Add a profile set for the Terratec EWS88 MT.

The Terratec EWS88 is a professional audio card supporting full 24bit/96kHz
sampling on 8 separate input/output channels (4 stereo pairs). It also has a
digital SPDIF input/output channel and a simple "monitor" stereo output.

This card identifies as PCI ID 1412:1712, which is the generic VIA ICE1712
chip, so udev rules must target the Terratec subsystem ID. There are two of
them, :1115 for regular use and :1125 for the Master card when multiple cards
are linked together.
---
 .../alsa/mixer/profile-sets/90-pulseaudio.rules    |    4 +
 .../alsa/mixer/profile-sets/terratec-ews88-mt.conf |  167 +++++++++++++++++++
 .../alsa/mixer/profile-sets/via-ice1712.conf       |  128 ++++++++++++++
 3 files changed, 306 insertions(+), 0 deletions(-)
 create mode 100644 src/modules/alsa/mixer/profile-sets/terratec-ews88-mt.conf
 create mode 100644 src/modules/alsa/mixer/profile-sets/via-ice1712.conf

diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
index ea1a2fe..ced202e 100644
--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
+++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
@@ -23,4 +23,8 @@ KERNEL!="card*", GOTO="pulseaudio_end"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="1978", ENV{PULSE_PROFILE_SET}="native-instruments-audio8dj.conf"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="0839", ENV{PULSE_PROFILE_SET}="native-instruments-audio4dj.conf"
 
+SUBSYSTEMS=="pci", ATTRS{vendor}=="0x1412", ATTRS{device}=="0x1712", ATTRS{subsystem_vendor}=="0x153b", ATTRS{subsystem_device}=="0x1115", ENV{PULSE_PROFILE_SET}="terratec-ews88-mt.conf"
+SUBSYSTEMS=="pci", ATTRS{vendor}=="0x1412", ATTRS{device}=="0x1712", ATTRS{subsystem_vendor}=="0x153b", ATTRS{subsystem_device}=="0x1125", ENV{PULSE_PROFILE_SET}="terratec-ews88-mt.conf"
+
+
 LABEL="pulseaudio_end"
diff --git a/src/modules/alsa/mixer/profile-sets/terratec-ews88-mt.conf b/src/modules/alsa/mixer/profile-sets/terratec-ews88-mt.conf
new file mode 100644
index 0000000..05d1395
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/terratec-ews88-mt.conf
@@ -0,0 +1,167 @@
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# PulseAudio 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 Lesser General Public License
+# along with PulseAudio; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+; Terratec EWS88 MT
+;
+; This card has four stereo pairs of input and four stereo pairs of
+; output, named channels 1 to 8. Also available are separate S/PDIF stereo
+; channels (input and output), and a separate "system-out" stereo jack that
+; supports 6-channel hardware mixing.
+;
+; We knowingly only define a subset of the theoretically possible
+; mapping combinations as profiles here.
+;
+; See default.conf for an explanation on the directives used here.
+
+[General]
+auto-profiles = no
+
+[Mapping analog-stereo-in]
+description = Analog Stereo Main Input
+device-strings = hw:%f,0
+channel-map = front-left,front-right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
+direction = input
+
+[Mapping analog-8ch-in]
+description = Analog 8-Channel Main Input
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right,aux0,aux1,aux2,aux3
+direction = input
+
+[Mapping analog-stereo-out]
+description = Analog Stereo Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
+direction = output
+
+[Mapping analog-40-out]
+description = Analog 4.0 Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,aux0,aux1,aux2,aux3,aux4,aux5
+direction = output
+
+[Mapping analog-41-out]
+description = Analog 4.1 Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,aux0,lfe,aux1,aux2,aux3,aux4
+direction = output
+
+[Mapping analog-51-out]
+description = Analog 5.1 Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,aux0,aux1,aux2,aux3
+direction = output
+
+[Mapping analog-71-out]
+description = Analog 7.1 Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right,aux0,aux1
+direction = output
+
+[Mapping analog-digital-stereo-out]
+description = Analog+Digital 2-Channel Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,aux0,aux1,aux2,aux3,aux4,aux5,front-left,front-right
+direction = output
+
+[Mapping digital-stereo-in]
+description = Digital Stereo Input
+device-strings = hw:%f,0
+channel-map = aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,front-left,front-right,aux8,aux9
+direction = input
+
+[Mapping digital-stereo-out]
+description = Digital Stereo Output
+device-strings = hw:%f,0
+channel-map = aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,front-left,front-right
+direction = output
+
+[Mapping digital-mixer-in]
+description = Virtual Mixer Input
+device-strings = hw:%f,0
+channel-map = aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,front-left,front-right
+direction = input
+
+# purpose of hw:,1 isn't clear
+#[Mapping digital-mixer]
+#description = Virtual Mixer Input
+#device-strings = hw:%f,1
+#channel-map = left,right
+#direction = input
+
+[Mapping analog-system-out]
+description = Analog Stereo System-Out
+device-strings = hw:%f,2
+channel-map = front-left,front-right
+direction = output
+
+
+[Profile output:stereo]
+description = Analog Stereo Output (Digital Output Disabled)
+output-mappings = analog-stereo-out analog-system-out
+input-mappings = 
+priority = 45
+skip-probe = yes
+
+[Profile output:stereo_all+input:stereo]
+description = Analog/Digital Stereo Output, Analog Stereo Input
+output-mappings = analog-digital-stereo-out analog-system-out
+input-mappings = analog-stereo-in
+priority = 95
+skip-probe = yes
+
+[Profile output:stereo_all+input:digital]
+description = Analog/Digital Stereo Output, Digital Stereo Input
+output-mappings = analog-digital-stereo-out analog-system-out
+input-mappings = digital-stereo-in
+priority = 75
+skip-probe = yes
+
+[Profile output:stereo_all+input:virtual]
+description = Analog/Digital Stereo Output, Virtual Mixer Input
+output-mappings = analog-digital-stereo-out analog-system-out
+input-mappings = digital-mixer-in
+priority = 90
+skip-probe = yes
+
+[Profile output:8ch+input:8ch]
+description = Analog 7.1 Output, Analog 8-Channel Input
+output-mappings = analog-71-out analog-system-out
+input-mappings = analog-8ch-in
+priority = 100
+skip-probe = yes
+
+[Profile output:spdif]
+description = Digital Output (Analog Output Disabled)
+output-mappings = digital-stereo-out analog-system-out
+input-mappings = 
+priority = 40
+skip-probe = yes
+
+[Profile output:spdif+input:spdif]
+description = Digital Input/Output (Analog Output Disabled)
+output-mappings = digital-stereo-out analog-system-out
+input-mappings = digital-stereo-in
+priority = 50
+skip-probe = yes
+
+[Profile output:system]
+description = System Output Only
+output-mappings = analog-system-out
+input-mappings = 
+priority = 10
+skip-probe = yes
+
diff --git a/src/modules/alsa/mixer/profile-sets/via-ice1712.conf b/src/modules/alsa/mixer/profile-sets/via-ice1712.conf
new file mode 100644
index 0000000..e08747a
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/via-ice1712.conf
@@ -0,0 +1,128 @@
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# PulseAudio 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 Lesser General Public License
+# along with PulseAudio; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+; Via ICE1712 multi-channel audio chipset
+;
+; This chipset has up to four stereo pairs of input and four stereo pairs of
+; output, named channels 1 to 8. Also available are separate S/PDIF stereo
+; channels (input and output), and a separate "system-out" stereo jack that
+; supports 6-channel hardware mixing.
+;
+; The S/PDIF stereo channels can be controlled via the mixer for hw:0, and
+; additionally, the 8 main outputs can be loop-routed to a separate stereo
+; input pair, available as channels 11 and 12.
+;
+; Many cards available from vendors do not expose all channels from this chip
+; to an external port, which effectively reduces the number of channels that
+; are useful to the user. However, the ALSA driver still exposes all channels
+; even if they are not connected.
+;
+; This file only serves as a reference file for those wanting to create and/or
+; test a profile for their card. Although this profile-set will work for
+; every ICE1712-based card, it will either expose features not available on
+; a particular card or expose less features than the card supports.
+;
+;
+; See default.conf for an explanation on the directives used here.
+
+[General]
+auto-profiles = no
+
+[Mapping analog-mch-in]
+description = Analog Multi-Channel Main Input
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right,aux0,aux1,aux2,aux3
+direction = input
+
+[Mapping analog-stereo-in]
+description = Analog Stereo Input
+device-strings = hw:%f,0
+channel-map = front-left,front-right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
+direction = input
+
+[Mapping analog-mch-out]
+description = Analog Multi-Channel Main Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right,aux0,aux1
+direction = output
+
+[Mapping analog-digital-stereo-out]
+description = Analog/Digital Stereo Output
+device-strings = hw:%f,0
+channel-map = front-left,front-right,aux0,aux1,aux2,aux3,aux4,aux5,front-left,front-right
+direction = output
+
+[Mapping digital-stereo-out]
+description = Digital Stereo Output
+device-strings = hw:%f,0
+channel-map = aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,front-left,front-right
+direction = output
+
+[Mapping digital-stereo-in]
+description = Digital Stereo Input
+device-strings = hw:%f,0
+channel-map = aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,front-left,front-right,aux8,aux9
+direction = input
+
+[Mapping analog-system-out]
+description = Analog Stereo System-Out
+device-strings = hw:%f,2
+channel-map = left,right
+direction = output
+
+
+[Profile output:mch]
+description = Analog Multi-Channel Output (Digital Disabled)
+output-mappings = analog-mch-out analog-system-out
+input-mappings = 
+priority = 60
+skip-probe = yes
+
+[Profile output:mch+input:mch]
+description = Analog Multi-Channel Input/Output (Digital Disabled)
+output-mappings = analog-mch-out analog-system-out
+input-mappings = analog-mch-in
+priority = 100
+skip-probe = yes
+
+[Profile output:stereo-da+input:stereo-analog]
+description = Analog Stereo Input/Output, Digital Stereo Output
+output-mappings = analog-digital-stereo-out analog-system-out
+input-mappings = analog-stereo-in
+priority = 90
+skip-probe = yes
+
+[Profile output:spdif]
+description = Digital Stereo Output (Multi-Channel Disabled)
+output-mappings = digital-stereo-out analog-system-out
+input-mappings = 
+priority = 70
+skip-probe = yes
+
+[Profile output:spdif+input:spdif]
+description = Digital Stereo Input/Output (Multi-Channel Disabled)
+output-mappings = digital-stereo-out analog-system-out
+input-mappings = digital-stereo-in
+priority = 80
+skip-probe = yes
+
+[Profile output:system]
+description = System Output Only
+output-mappings = analog-system-out
+input-mappings = 
+priority = 50
+skip-probe = yes
+
-- 
1.6.3.3


