[PATCH] alsa-mixer: Add "Line Out" path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If there is a "Line Out" jack present, then add this path. The fallback
analog-output will be a subset of this path and removed.

I only use the "Line Out Jack" or "Line Out Front Jack" for actual jack
detection - without anything connected to the front jack, it makes little
sense to enable the port.
(Another option could perhaps be to use different paths for stereo line out
and surround line outs, but that could be a possible future improvement.)
---
 src/Makefile.am                                    |    1 +
 .../alsa/mixer/paths/analog-output-lineout.conf    |  147 ++++++++++++++++++++
 src/modules/alsa/mixer/profile-sets/default.conf   |   14 +-
 .../alsa/mixer/profile-sets/extra-hdmi.conf        |   14 +-
 .../profile-sets/force-speaker-and-int-mic.conf    |   14 +-
 .../alsa/mixer/profile-sets/force-speaker.conf     |   14 +-
 6 files changed, 176 insertions(+), 28 deletions(-)
 create mode 100644 src/modules/alsa/mixer/paths/analog-output-lineout.conf

diff --git a/src/Makefile.am b/src/Makefile.am
index 44c191d..2521670 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1229,6 +1229,7 @@ dist_alsapaths_DATA = \
 		modules/alsa/mixer/paths/analog-output-desktop-speaker.conf \
 		modules/alsa/mixer/paths/analog-output-headphones.conf \
 		modules/alsa/mixer/paths/analog-output-headphones-2.conf \
+		modules/alsa/mixer/paths/analog-output-lineout.conf \
 		modules/alsa/mixer/paths/analog-output-mono.conf \
 		modules/alsa/mixer/paths/iec958-stereo-output.conf \
 		modules/alsa/mixer/paths/hdmi-output-0.conf \
diff --git a/src/modules/alsa/mixer/paths/analog-output-lineout.conf b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
new file mode 100644
index 0000000..b8595f7
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
@@ -0,0 +1,147 @@
+# 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.
+
+[General]
+priority = 99
+description-key = analog-output-lineout
+
+[Jack Line Out]
+required-any = any
+
+[Jack Line Out Phantom]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out Front]
+required-any = any
+
+[Jack Line Out Front Phantom]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out CLFE]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out CLFE Phantom]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out Surround]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out Surround Phantom]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out Side]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Jack Line Out Side Phantom]
+state.plugged = unknown
+state.unplugged = unknown
+required-any = any
+
+[Element Hardware Master]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
+[Element Master]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
+[Element Master Mono]
+switch = off
+volume = off
+
+[Element Line HP Swap]
+switch = off
+
+; This profile path is intended to control the default output, not the
+; headphones. But it should not hurt if we leave the headphone jack
+; enabled nonetheless.
+[Element Headphone]
+switch = mute
+volume = zero
+
+[Element Headphone2]
+switch = mute
+volume = zero
+
+[Element Speaker]
+switch = mute
+volume = off
+
+[Element Desktop Speaker]
+switch = mute
+volume = off
+
+[Element Front]
+switch = mute
+volume = merge
+override-map.1 = all-front
+override-map.2 = front-left,front-right
+
+[Element Rear]
+switch = mute
+volume = merge
+override-map.1 = all-rear
+override-map.2 = rear-left,rear-right
+
+[Element Surround]
+switch = mute
+volume = merge
+override-map.1 = all-rear
+override-map.2 = rear-left,rear-right
+
+[Element Side]
+switch = mute
+volume = merge
+override-map.1 = all-side
+override-map.2 = side-left,side-right
+
+[Element Center]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,all-center
+
+[Element LFE]
+switch = mute
+volume = merge
+override-map.1 = lfe
+override-map.2 = lfe,lfe
+
+[Element CLFE]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,lfe
+
+.include analog-output.conf.common
diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf
index 3599535..9326245 100644
--- a/src/modules/alsa/mixer/profile-sets/default.conf
+++ b/src/modules/alsa/mixer/profile-sets/default.conf
@@ -101,42 +101,42 @@ auto-profiles = yes
 [Mapping analog-mono]
 device-strings = hw:%f
 channel-map = mono
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
 priority = 1
 
 [Mapping analog-stereo]
 device-strings = front:%f hw:%f
 channel-map = left,right
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic
 priority = 10
 
 [Mapping analog-surround-40]
 device-strings = surround40:%f
 channel-map = front-left,front-right,rear-left,rear-right
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-41]
 device-strings = surround41:%f
 channel-map = front-left,front-right,rear-left,rear-right,lfe
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 8
 direction = output
 
 [Mapping analog-surround-50]
 device-strings = surround50:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-51]
 device-strings = surround51:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 8
 direction = output
 
@@ -144,7 +144,7 @@ direction = output
 device-strings = surround71:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
 description = Analog Surround 7.1
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
diff --git a/src/modules/alsa/mixer/profile-sets/extra-hdmi.conf b/src/modules/alsa/mixer/profile-sets/extra-hdmi.conf
index 098de03..96652f8 100644
--- a/src/modules/alsa/mixer/profile-sets/extra-hdmi.conf
+++ b/src/modules/alsa/mixer/profile-sets/extra-hdmi.conf
@@ -27,42 +27,42 @@ auto-profiles = yes
 [Mapping analog-mono]
 device-strings = hw:%f
 channel-map = mono
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
 priority = 1
 
 [Mapping analog-stereo]
 device-strings = front:%f hw:%f
 channel-map = left,right
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic
 priority = 10
 
 [Mapping analog-surround-40]
 device-strings = surround40:%f
 channel-map = front-left,front-right,rear-left,rear-right
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-41]
 device-strings = surround41:%f
 channel-map = front-left,front-right,rear-left,rear-right,lfe
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 8
 direction = output
 
 [Mapping analog-surround-50]
 device-strings = surround50:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-51]
 device-strings = surround51:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 8
 direction = output
 
@@ -70,7 +70,7 @@ direction = output
 device-strings = surround71:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
 description = Analog Surround 7.1
-paths-output = analog-output analog-output-speaker analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-desktop-speaker
 priority = 7
 direction = output
 
diff --git a/src/modules/alsa/mixer/profile-sets/force-speaker-and-int-mic.conf b/src/modules/alsa/mixer/profile-sets/force-speaker-and-int-mic.conf
index 2095cf9..66b18b3 100644
--- a/src/modules/alsa/mixer/profile-sets/force-speaker-and-int-mic.conf
+++ b/src/modules/alsa/mixer/profile-sets/force-speaker-and-int-mic.conf
@@ -24,42 +24,42 @@ auto-profiles = yes
 [Mapping analog-mono]
 device-strings = hw:%f
 channel-map = mono
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic-always analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
 priority = 1
 
 [Mapping analog-stereo]
 device-strings = front:%f hw:%f
 channel-map = left,right
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic-always analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
 priority = 10
 
 [Mapping analog-surround-40]
 device-strings = surround40:%f
 channel-map = front-left,front-right,rear-left,rear-right
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-41]
 device-strings = surround41:%f
 channel-map = front-left,front-right,rear-left,rear-right,lfe
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 8
 direction = output
 
 [Mapping analog-surround-50]
 device-strings = surround50:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-51]
 device-strings = surround51:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 8
 direction = output
 
@@ -67,7 +67,7 @@ direction = output
 device-strings = surround71:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
 description = Analog Surround 7.1
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
diff --git a/src/modules/alsa/mixer/profile-sets/force-speaker.conf b/src/modules/alsa/mixer/profile-sets/force-speaker.conf
index f03ada6..7c5c1b8 100644
--- a/src/modules/alsa/mixer/profile-sets/force-speaker.conf
+++ b/src/modules/alsa/mixer/profile-sets/force-speaker.conf
@@ -23,42 +23,42 @@ auto-profiles = yes
 [Mapping analog-mono]
 device-strings = hw:%f
 channel-map = mono
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
 priority = 1
 
 [Mapping analog-stereo]
 device-strings = front:%f hw:%f
 channel-map = left,right
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
 priority = 10
 
 [Mapping analog-surround-40]
 device-strings = surround40:%f
 channel-map = front-left,front-right,rear-left,rear-right
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-41]
 device-strings = surround41:%f
 channel-map = front-left,front-right,rear-left,rear-right,lfe
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 8
 direction = output
 
 [Mapping analog-surround-50]
 device-strings = surround50:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
 [Mapping analog-surround-51]
 device-strings = surround51:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 8
 direction = output
 
@@ -66,7 +66,7 @@ direction = output
 device-strings = surround71:%f
 channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
 description = Analog Surround 7.1
-paths-output = analog-output analog-output-speaker-always analog-output-desktop-speaker
+paths-output = analog-output analog-output-lineout analog-output-speaker-always analog-output-desktop-speaker
 priority = 7
 direction = output
 
-- 
1.7.9.5



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux