mirror of
				https://github.com/alsa-project/alsa-tools.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Dirk Kalis <dirk.kalis@rs2.de>
In the patch is the adc volume rate only set to max if ipga volume is set.
This commit is contained in:
		
							parent
							
								
									7882d219a2
								
							
						
					
					
						commit
						3343a6b188
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -144,7 +144,7 @@ void adc_volume_update(int idx)
 | 
			
		|||
void ipga_volume_update(int idx)
 | 
			
		||||
{
 | 
			
		||||
	snd_ctl_elem_value_t *val;
 | 
			
		||||
	int err;
 | 
			
		||||
	int err, ipga_vol;
 | 
			
		||||
	snd_ctl_elem_value_alloca(&val);
 | 
			
		||||
	snd_ctl_elem_value_set_interface(val, SND_CTL_ELEM_IFACE_MIXER);
 | 
			
		||||
	snd_ctl_elem_value_set_name(val, IPGA_VOLUME_NAME);
 | 
			
		||||
| 
						 | 
				
			
			@ -154,15 +154,17 @@ void ipga_volume_update(int idx)
 | 
			
		|||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	gtk_adjustment_set_value(GTK_ADJUSTMENT(av_ipga_volume_adj[idx]),
 | 
			
		||||
				 -snd_ctl_elem_value_get_integer(val, 0));
 | 
			
		||||
				 -(ipga_vol = snd_ctl_elem_value_get_integer(val, 0)));
 | 
			
		||||
	snd_ctl_elem_value_set_name(val, ADC_VOLUME_NAME);
 | 
			
		||||
	snd_ctl_elem_value_set_index(val, idx);
 | 
			
		||||
	if ((err = snd_ctl_elem_read(ctl, val)) < 0) {
 | 
			
		||||
		g_print("Unable to read adc volume: %s\n", snd_strerror(err));
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	gtk_adjustment_set_value(GTK_ADJUSTMENT(av_adc_volume_adj[idx]),
 | 
			
		||||
				 -127);
 | 
			
		||||
	// set ADC volume to max if IPGA volume greater 0
 | 
			
		||||
	if (ipga_vol)
 | 
			
		||||
		gtk_adjustment_set_value(GTK_ADJUSTMENT(av_adc_volume_adj[idx]),
 | 
			
		||||
					 -127);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void dac_sense_update(int idx)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue