mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	alsa-mixer: make the mono mapping a fallback only
If a sound card doesn't have the "front" device defined for it, we have
to use the "hw" device for stereo. Not so long ago, the analog-stereo
mapping had "hw:%f" in its device-strings and everything worked great,
except that it caused trouble with the Intel HDMI LPE driver that uses
the first "hw" device for HDMI, and we were incorrectly detecting it as
an analog device. That problem was fixed in commit ea3ebd09, which
removed "hw:%f" from analog-stereo and added a new stereo fallback
mapping for "hw".
Now the problem is that if a sound card doesn't have the "front" device
defined for it, and it supports both mono and stereo, only the mono
mapping is used, because the stereo mapping is only a fallback. This
patch makes the mono mapping a fallback too, so the mono mapping is used
only if there's absolutely nothing else that works.
This can cause trouble at least in theory. Maybe someone actually wants
to use mono output on a card that supports both mono and stereo. But
that seems quite unlikely.
			
			
This commit is contained in:
		
							parent
							
								
									5c2d28f6df
								
							
						
					
					
						commit
						3455d62e49
					
				
					 2 changed files with 11 additions and 8 deletions
				
			
		| 
						 | 
					@ -4060,6 +4060,7 @@ static int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) {
 | 
				
			||||||
    static const struct description_map well_known_descriptions[] = {
 | 
					    static const struct description_map well_known_descriptions[] = {
 | 
				
			||||||
        { "analog-mono",            N_("Analog Mono") },
 | 
					        { "analog-mono",            N_("Analog Mono") },
 | 
				
			||||||
        { "analog-stereo",          N_("Analog Stereo") },
 | 
					        { "analog-stereo",          N_("Analog Stereo") },
 | 
				
			||||||
 | 
					        { "mono-fallback",          N_("Mono") },
 | 
				
			||||||
        { "stereo-fallback",        N_("Stereo") },
 | 
					        { "stereo-fallback",        N_("Stereo") },
 | 
				
			||||||
        /* Note: Not translated to "Analog Stereo Input", because the source
 | 
					        /* Note: Not translated to "Analog Stereo Input", because the source
 | 
				
			||||||
         * name gets "Input" appended to it automatically, so adding "Input"
 | 
					         * name gets "Input" appended to it automatically, so adding "Input"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -101,13 +101,6 @@
 | 
				
			||||||
[General]
 | 
					[General]
 | 
				
			||||||
auto-profiles = yes
 | 
					auto-profiles = yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Mapping analog-mono]
 | 
					 | 
				
			||||||
device-strings = hw:%f
 | 
					 | 
				
			||||||
channel-map = mono
 | 
					 | 
				
			||||||
paths-output = analog-output analog-output-lineout analog-output-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 = 7
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[Mapping analog-stereo]
 | 
					[Mapping analog-stereo]
 | 
				
			||||||
device-strings = front:%f
 | 
					device-strings = front:%f
 | 
				
			||||||
channel-map = left,right
 | 
					channel-map = left,right
 | 
				
			||||||
| 
						 | 
					@ -115,7 +108,7 @@ paths-output = analog-output analog-output-lineout analog-output-speaker analog-
 | 
				
			||||||
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
 | 
					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 = 15
 | 
					priority = 15
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# If everything else fails, try to use hw:0 as a stereo device.
 | 
					# If everything else fails, try to use hw:0 as a stereo device...
 | 
				
			||||||
[Mapping stereo-fallback]
 | 
					[Mapping stereo-fallback]
 | 
				
			||||||
device-strings = hw:%f
 | 
					device-strings = hw:%f
 | 
				
			||||||
fallback = yes
 | 
					fallback = yes
 | 
				
			||||||
| 
						 | 
					@ -124,6 +117,15 @@ paths-output = analog-output analog-output-lineout analog-output-speaker analog-
 | 
				
			||||||
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
 | 
					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 = 1
 | 
					priority = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# ...and if even that fails, try to use hw:0 as a mono device.
 | 
				
			||||||
 | 
					[Mapping mono-fallback]
 | 
				
			||||||
 | 
					device-strings = hw:%f
 | 
				
			||||||
 | 
					fallback = yes
 | 
				
			||||||
 | 
					channel-map = mono
 | 
				
			||||||
 | 
					paths-output = analog-output analog-output-lineout analog-output-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-surround-21]
 | 
					[Mapping analog-surround-21]
 | 
				
			||||||
device-strings = surround21:%f
 | 
					device-strings = surround21:%f
 | 
				
			||||||
channel-map = front-left,front-right,lfe
 | 
					channel-map = front-left,front-right,lfe
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue