Skip to contentSkip to conversation

Add support for gain in softvol plugin

PATCH In review Steve Longerbeam 3 participants 12 messages May 3, 2007 – May 18, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for gain in softvol plugin

Hi all,

What do you think of this patch? I tested this using a stac9205 HDA codec with all sample formats supported by softvol (s32, s16, s24, big and little endian).

The potential drawback I see is that softvol now has to use a intermediate long long multiply and add when computing amplified 32-bit samples. This wasn't an issue with the system I tested on, but possibly could be on slower machines. Also, are their any portability issues with using a long long datatype in alsa-lib? What is the list of embedded architectures that alsa-lib is targeted to build on? I see long long used in many other places in alsa-lib, so I'm hoping this isn't an issue.

Steve

searching for changes

changeset:   2284:b5cecd5c8e13
tag:         tip
user:        [email protected]
date:        Thu May 03 11:49:45 2007 -0700
summary:     Add support for gain in softvol plugin.

This patch allows for gain in the softvol plugin, in addition to attenuation. The plugin now has a "max_dB" parameter (up to 50 dB) as well as the original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so unless max_dB is specified in a device conf, the behavior of the plugin will be the same as before (attenuation only).

The patch also creates a new pcm device "dsnoop_softvol". It's a softvol device with min_dB set to -30 dB and max_dB set to 40 dB. I came up with those numbers sort of subjectively by experimenting with record levels using a digital mic on the stac9205 codec. The softvol plugin allows a range of -51 to +50 dB, so max_dB could be increased to 50. But eventually samples are going to get clipped. At 40 dB I was beginning to get clipping when recording a sample sound at a "reasonably soft" volume. The dsnoop_softvol device uses dsnoop as its slave device, and it contains a mixer volume control named "Capture Softvol".

HDA-Intel.conf is also modified to use dsnoop_softvol for its default capture. So now, capture is filtered through softvol (range -30 to +40 dB) before being passed on to dsnoop as before.

The motivation for this work is that some HDA codecs have no hardware gain control for some paths. For instance, the stac9205 has support for digital mics, but there is no gain control widget for this signal before it is placed on the Azalia link (only a mute). Therefore gain can only be accomplished via software.

src/conf/alsa.conf +3 -0
diff -r dd433d4613b4 -r b5cecd5c8e13 src/conf/alsa.conf
@@ -73,6 +73,8 @@ defaults.pcm.dmix.device defaults.pcm.de
 defaults.pcm.dmix.device defaults.pcm.device
 defaults.pcm.dsnoop.card defaults.pcm.card
 defaults.pcm.dsnoop.device defaults.pcm.device
+defaults.pcm.dsnoop_softvol.card defaults.pcm.card
+defaults.pcm.dsnoop_softvol.device defaults.pcm.device
 defaults.pcm.front.card defaults.pcm.card
 defaults.pcm.front.device defaults.pcm.device
 defaults.pcm.rear.card defaults.pcm.card
@@ -127,6 +129,7 @@ pcm.spdif iec958
 pcm.spdif iec958
 pcm.dmix cards.pcm.dmix
 pcm.dsnoop cards.pcm.dsnoop
+pcm.dsnoop_softvol cards.pcm.dsnoop_softvol
 pcm.modem cards.pcm.modem
 pcm.phoneline cards.pcm.phoneline
 
src/conf/cards/HDA-Intel.conf +3 -1
diff -r dd433d4613b4 -r b5cecd5c8e13 src/conf/cards/HDA-Intel.conf
@@ -19,6 +19,8 @@ HDA-Intel.pcm.front.0 {
 		card $CARD
 	}
 }	
+
+<confdir:pcm/dsnoop_softvol.conf>
 
 # default with dmix+softvol & dsnoop
 HDA-Intel.pcm.default {
@@ -45,7 +47,7 @@ HDA-Intel.pcm.default {
 		type plug
 		slave.pcm {
 			@func concat
-			strings [ "dsnoop:" $CARD ]
+			strings [ "dsnoop_softvol:" $CARD ]
 		}
 	}
 }
src/conf/pcm/Makefile.am +1 -1
diff -r dd433d4613b4 -r b5cecd5c8e13 src/conf/pcm/Makefile.am
@@ -2,7 +2,7 @@ cfg_files = default.conf front.conf rear
 	    surround40.conf surround41.conf \
 	    surround50.conf surround51.conf \
 	    surround71.conf iec958.conf modem.conf \
-	    dmix.conf dsnoop.conf \
+	    dmix.conf dsnoop.conf dsnoop_softvol.conf \
 	    dpl.conf
 
 EXTRA_DIST = $(cfg_files)
src/conf/pcm/dsnoop_softvol.conf new file +17 -0
diff -r dd433d4613b4 -r b5cecd5c8e13 src/conf/pcm/dsnoop_softvol.conf
@@ -0,0 +1,17 @@
+pcm.!dsnoop_softvol {
+        @args [ CARD ]
+        @args.CARD {
+                type string
+        }
+        type softvol
+	slave.pcm {
+		@func concat
+		strings [ "dsnoop:" $CARD ]
+	}
+        control {
+                name "Capture SoftVol"
+                card $CARD
+        }
+        min_dB -30.0
+        max_dB 40.0
+}
src/pcm/pcm_softvol.c +91 -34

265 lines not on this page · raw message

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw
Quoted 5 lines · Steve Longerbeam

Hi all,

What do you think of this patch? I tested this using a stac9205 HDA codec with all sample formats supported by softvol (s32, s16, s24, big and little endian).

I would not add extra defines to alsa.conf:

+defaults.pcm.dsnoop_softvol.card defaults.pcm.card +defaults.pcm.dsnoop_softvol.device defaults.pcm.device

Simply reuse pcm.dsnoop.card / device.

Otherwise - it looks good. Nice softvol extension.

Thanks,
Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

#2 lore raw
Quoted 15 lines · Jaroslav Kysela
Quoted 6 lines · Steve Longerbeam

Hi all,

What do you think of this patch? I tested this using a stac9205 HDA codec with all sample formats supported by softvol (s32, s16, s24, big and little endian).

I would not add extra defines to alsa.conf:

src/conf/alsa.conf +2 -0
+defaults.pcm.dsnoop_softvol.card defaults.pcm.card
+defaults.pcm.dsnoop_softvol.device defaults.pcm.device
Quoted 2 lines

Simply reuse pcm.dsnoop.card / device.

Hi Jaroslav,

How do I do this exactly? Should I add:

@args.CARD {
    type string
    default {
        @func refer
         name defaults.pcm.card
    }
}

to dsnoop_softvol.conf?

Quoted 3 lines

Otherwise - it looks good. Nice softvol extension.

thanks,
Steve

#3 lore raw
Quoted 20 lines · Steve Longerbeam
Quoted 15 lines · Jaroslav Kysela
Quoted 6 lines · Steve Longerbeam

Hi all,

What do you think of this patch? I tested this using a stac9205 HDA codec with all sample formats supported by softvol (s32, s16, s24, big and little endian).

I would not add extra defines to alsa.conf:

src/conf/alsa.conf +2 -0
+defaults.pcm.dsnoop_softvol.card defaults.pcm.card
+defaults.pcm.dsnoop_softvol.device defaults.pcm.device
Quoted 2 lines

Simply reuse pcm.dsnoop.card / device.

Hi Jaroslav,

Quoted 7 lines

How do I do this exactly? Should I add:

@args.CARD {
    type string
    default {
        @func refer
         name defaults.pcm.card

Replace with: name defaults.pcm.dsnoop.card

Please, resend your patch with this modification. Thanks.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

#4 lore raw
Quoted 35 lines · Jaroslav Kysela
Quoted 23 lines · Steve Longerbeam
Quoted 16 lines · Jaroslav Kysela
Quoted 7 lines · Steve Longerbeam

Hi all,

What do you think of this patch? I tested this using a stac9205 HDA codec with all sample formats supported by softvol (s32, s16, s24, big and little endian).

I would not add extra defines to alsa.conf:

(quoted diff) +2 -0
+defaults.pcm.dsnoop_softvol.card defaults.pcm.card
+defaults.pcm.dsnoop_softvol.device defaults.pcm.device
Quoted 3 lines

Simply reuse pcm.dsnoop.card / device.

Hi Jaroslav,

Quoted 8 lines

How do I do this exactly? Should I add:

@args.CARD {
    type string
    default {
        @func refer
         name defaults.pcm.card
Quoted 4 lines

Replace with: name defaults.pcm.dsnoop.card

Please, resend your patch with this modification. Thanks.

ok, here it is again, with CARD/DEV defaults moved out of alsa.conf and into dsnoop_softvol.conf.

Steve

searching for changes

changeset:   2285:2d9964bee8bb
tag:         tip
user:        [email protected]
date:        Fri May 04 09:22:49 2007 -0700
summary:     Add support for gain in softvol plugin.

This patch allows for gain in the softvol plugin, in addition to attenuation. The plugin now has a "max_dB" parameter (up to 50 dB) as well as the original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so unless max_dB is specified in a device conf, the behavior of the plugin will be the same as before (attenuation only).

The patch also creates a new pcm device "dsnoop_softvol". It's a softvol device with min_dB set to -30 dB and max_dB set to 40 dB. I came up with those numbers sort of subjectively by experimenting with record levels using a digital mic on the stac9205 codec. The softvol plugin allows a range of -51 to +50 dB, so max_dB could be increased to 50. But eventually samples are going to get clipped. At 40 dB I was beginning to get clipping when recording a sample sound at a "reasonably soft" volume. The dsnoop_softvol device uses dsnoop as its slave device, and it contains a mixer volume control named "Capture Softvol".

HDA-Intel.conf is also modified to use dsnoop_softvol for its default capture. So now, capture is filtered through softvol (range -30 to +40 dB) before being passed on to dsnoop as before.

The motivation for this work is that some HDA codecs have no hardware gain control for some paths. For instance, the stac9205 has support for digital mics, but there is no gain control widget for this signal before it is placed on the Azalia link (only a mute). Therefore gain can only be accomplished via software.

src/conf/alsa.conf +1 -0
diff -r ae8426a8928c -r 2d9964bee8bb src/conf/alsa.conf
@@ -127,6 +127,7 @@ pcm.spdif iec958
 pcm.spdif iec958
 pcm.dmix cards.pcm.dmix
 pcm.dsnoop cards.pcm.dsnoop
+pcm.dsnoop_softvol cards.pcm.dsnoop_softvol
 pcm.modem cards.pcm.modem
 pcm.phoneline cards.pcm.phoneline
 
src/conf/cards/HDA-Intel.conf +3 -1
diff -r ae8426a8928c -r 2d9964bee8bb src/conf/cards/HDA-Intel.conf
@@ -19,6 +19,8 @@ HDA-Intel.pcm.front.0 {
 		card $CARD
 	}
 }	
+
+<confdir:pcm/dsnoop_softvol.conf>
 
 # default with dmix+softvol & dsnoop
 HDA-Intel.pcm.default {
@@ -45,7 +47,7 @@ HDA-Intel.pcm.default {
 		type plug
 		slave.pcm {
 			@func concat
-			strings [ "dsnoop:" $CARD ]
+			strings [ "dsnoop_softvol:" $CARD ]
 		}
 	}
 }
src/conf/pcm/Makefile.am +1 -1
diff -r ae8426a8928c -r 2d9964bee8bb src/conf/pcm/Makefile.am
@@ -2,7 +2,7 @@ cfg_files = default.conf front.conf rear
 	    surround40.conf surround41.conf \
 	    surround50.conf surround51.conf \
 	    surround71.conf iec958.conf modem.conf \
-	    dmix.conf dsnoop.conf \
+	    dmix.conf dsnoop.conf dsnoop_softvol.conf \
 	    dpl.conf
 
 EXTRA_DIST = $(cfg_files)
src/conf/pcm/dsnoop_softvol.conf new file +28 -0
diff -r ae8426a8928c -r 2d9964bee8bb src/conf/pcm/dsnoop_softvol.conf
@@ -0,0 +1,28 @@
+pcm.!dsnoop_softvol {
+	@args [ CARD DEV ]
+	@args.CARD {
+		type string
+		default {
+			@func refer
+			name defaults.pcm.dsnoop.card
+		}
+	}
+	@args.DEV {
+		type integer
+		default {
+			@func refer
+			name defaults.pcm.dsnoop.device
+		}
+	}
+	type softvol
+	slave.pcm {
+		@func concat
+		strings [ "dsnoop:" $CARD ]
+	}
+	control {
+		name "Capture SoftVol"
+		card $CARD
+	}
+	min_dB -30.0
+	max_dB 40.0
+}
src/pcm/pcm_softvol.c +91 -34

265 lines not on this page · raw message

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#5 lore raw
Quoted 8 lines · Steve Longerbeam
Quoted 4 lines · Jaroslav Kysela

<snip>

Please, resend your patch with this modification. Thanks.

ok, here it is again, with CARD/DEV defaults moved out of alsa.conf and into dsnoop_softvol.conf.

I realized I wasn't handling max_dB < 0 (svol->zero_dB_val = 0) in all cases.

Patch attached again along with an interdiff from my last patch.

Steve

searching for changes

changeset:   2285:b328ce286286
tag:         tip
user:        [email protected]
date:        Fri May 04 10:25:39 2007 -0700
summary:     Add support for gain in softvol plugin.

This patch allows for gain in the softvol plugin, in addition to attenuation. The plugin now has a "max_dB" parameter (up to 50 dB) as well as the original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so unless max_dB is specified in a device conf, the behavior of the plugin will be the same as before (attenuation only).

The patch also creates a new pcm device "dsnoop_softvol". It's a softvol device with min_dB set to -30 dB and max_dB set to 40 dB. I came up with those numbers sort of subjectively by experimenting with record levels using a digital mic on the stac9205 codec. The softvol plugin allows a range of -51 to +50 dB, so max_dB could be increased to 50. But eventually samples are going to get clipped. At 40 dB I was beginning to get clipping when recording a sample sound at a "reasonably soft" volume. The dsnoop_softvol device uses dsnoop as its slave device, and it contains a mixer volume control named "Capture Softvol".

HDA-Intel.conf is also modified to use dsnoop_softvol for its default capture. So now, capture is filtered through softvol (range -30 to +40 dB) before being passed on to dsnoop as before.

The motivation for this work is that some HDA codecs have no hardware gain control for some paths. For instance, the stac9205 has support for digital mics, but there is no gain control widget for this signal before it is placed on the Azalia link (only a mute). Therefore gain can only be accomplished via software.

src/conf/alsa.conf +1 -0
diff -r ae8426a8928c -r b328ce286286 src/conf/alsa.conf
@@ -127,6 +127,7 @@ pcm.spdif iec958
 pcm.spdif iec958
 pcm.dmix cards.pcm.dmix
 pcm.dsnoop cards.pcm.dsnoop
+pcm.dsnoop_softvol cards.pcm.dsnoop_softvol
 pcm.modem cards.pcm.modem
 pcm.phoneline cards.pcm.phoneline
 
src/conf/cards/HDA-Intel.conf +3 -1
diff -r ae8426a8928c -r b328ce286286 src/conf/cards/HDA-Intel.conf
@@ -19,6 +19,8 @@ HDA-Intel.pcm.front.0 {
 		card $CARD
 	}
 }	
+
+<confdir:pcm/dsnoop_softvol.conf>
 
 # default with dmix+softvol & dsnoop
 HDA-Intel.pcm.default {
@@ -45,7 +47,7 @@ HDA-Intel.pcm.default {
 		type plug
 		slave.pcm {
 			@func concat
-			strings [ "dsnoop:" $CARD ]
+			strings [ "dsnoop_softvol:" $CARD ]
 		}
 	}
 }
src/conf/pcm/Makefile.am +1 -1
diff -r ae8426a8928c -r b328ce286286 src/conf/pcm/Makefile.am
@@ -2,7 +2,7 @@ cfg_files = default.conf front.conf rear
 	    surround40.conf surround41.conf \
 	    surround50.conf surround51.conf \
 	    surround71.conf iec958.conf modem.conf \
-	    dmix.conf dsnoop.conf \
+	    dmix.conf dsnoop.conf dsnoop_softvol.conf \
 	    dpl.conf
 
 EXTRA_DIST = $(cfg_files)
src/conf/pcm/dsnoop_softvol.conf new file +28 -0
diff -r ae8426a8928c -r b328ce286286 src/conf/pcm/dsnoop_softvol.conf
@@ -0,0 +1,28 @@
+pcm.!dsnoop_softvol {
+	@args [ CARD DEV ]
+	@args.CARD {
+		type string
+		default {
+			@func refer
+			name defaults.pcm.dsnoop.card
+		}
+	}
+	@args.DEV {
+		type integer
+		default {
+			@func refer
+			name defaults.pcm.dsnoop.device
+		}
+	}
+	type softvol
+	slave.pcm {
+		@func concat
+		strings [ "dsnoop:" $CARD ]
+	}
+	control {
+		name "Capture SoftVol"
+		card $CARD
+	}
+	min_dB -30.0
+	max_dB 40.0
+}
src/pcm/pcm_softvol.c +96 -35

275 lines not on this page · raw message

src/pcm/pcm_softvol.c +8 -4
diff -u b/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c
@@ -594,14 +594,17 @@
 {
 	int err;
 	int i;
-
+	unsigned int def_val;
+	
 	err = snd_ctl_elem_add_integer(svol->ctl, &cinfo->id, count, 0, svol->max_val, 0);
 	if (err < 0)
 		return err;
 	add_tlv_info(svol, cinfo);
-	/* set zero dB value as default */
+	/* set zero dB value as default, or max_val if
+	   there is no 0 dB setting */
+	def_val = svol->zero_dB_val ? svol->zero_dB_val : svol->max_val;
 	for (i = 0; i < count; i++)
-		svol->elem.value.integer.value[i] = svol->zero_dB_val;
+		svol->elem.value.integer.value[i] = def_val;
 	return snd_ctl_elem_write(svol->ctl, &svol->elem);
 }
 
@@ -706,7 +709,8 @@
 			double v = (pow(10.0, db / 20.0) * (double)(1 << VOL_SCALE_SHIFT));
 			svol->dB_value[i] = (unsigned int)v;
 		}
-		svol->dB_value[svol->zero_dB_val] = 65535;
+		if (svol->zero_dB_val)
+			svol->dB_value[svol->zero_dB_val] = 65535;
 #else
 		SNDERR("Cannot handle the given dB range and resolution");
 		return -EINVAL;

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#6 lore raw

At Fri, 04 May 2007 10:33:16 -0700,

Quoted 8 lines · Steve Longerbeam
Quoted 6 lines · Steve Longerbeam
Quoted 4 lines · Jaroslav Kysela

<snip>

Please, resend your patch with this modification. Thanks.

Quoted 8 lines
Quoted 3 lines

ok, here it is again, with CARD/DEV defaults moved out of alsa.conf and into dsnoop_softvol.conf.

I realized I wasn't handling max_dB < 0 (svol->zero_dB_val = 0) in all cases.

Patch attached again along with an interdiff from my last patch.

Thanks for the patch. Now I checked this thread.

Some suggestions:

- "Capture SoftVol" doesn't sound like a valid mixer name. "Digital Capture Volume" would be more suitable, IMO.

- The range from -30 to 40dB seems too big.

- We don't need a new definition of dsnoop_softvol PCM there as it's
specific to HDA-Intel right now. Let's define locally like:

# default with dmix+softvol & dsnoop
HDA-Intel.pcm.default {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type asym
	playback.pcm {
	...
	}
	capture.pcm {
		type plug
		slave.pcm {
		type softvol
			slave.pcm {
				@func concat
				strings [ "dsnoop:" $CARD ]
			}
			control {
				name "Digital Capture Volume"
				card $CARD
			}
			min_dB -30.0
			max_dB 40.0
		}
	}
}

Takashi

#7 lore raw
Quoted 61 lines · Takashi Iwai

At Fri, 04 May 2007 10:33:16 -0700,

Quoted 9 lines · Steve Longerbeam
Quoted 7 lines · Steve Longerbeam
Quoted 5 lines · Jaroslav Kysela

<snip>

Please, resend your patch with this modification. Thanks.

Quoted 7 lines
Quoted 3 lines

ok, here it is again, with CARD/DEV defaults moved out of alsa.conf and into dsnoop_softvol.conf.

I realized I wasn't handling max_dB < 0 (svol->zero_dB_val = 0) in all cases.

Patch attached again along with an interdiff from my last patch.

Thanks for the patch. Now I checked this thread.

Some suggestions:

- "Capture SoftVol" doesn't sound like a valid mixer name. "Digital Capture Volume" would be more suitable, IMO.

- The range from -30 to 40dB seems too big.

- We don't need a new definition of dsnoop_softvol PCM there as it's
specific to HDA-Intel right now. Let's define locally like:

# default with dmix+softvol & dsnoop
HDA-Intel.pcm.default {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type asym
	playback.pcm {
	...
	}
	capture.pcm {
		type plug
		slave.pcm {
		type softvol
			slave.pcm {
				@func concat
				strings [ "dsnoop:" $CARD ]
			}
			control {
				name "Digital Capture Volume"
				card $CARD
			}
			min_dB -30.0
			max_dB 40.0
		}
	}
}
Quoted 3 lines

Takashi

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I must have been doing something wrong because the capture device wasn't being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified files: pcm_softvol.c and HDA-Intel.conf.

I also reduced the gain range, it's now -30 to +30 dB.

Steve

searching for changes

changeset:   2285:43c8aebb3b03
tag:         tip
user:        [email protected]
date:        Thu May 10 12:36:13 2007 -0700
summary:     Add support for gain in softvol plugin.

This patch allows for gain in the softvol plugin, in addition to attenuation. The plugin now has a "max_dB" parameter (up to 50 dB) as well as the original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so unless max_dB is specified in a device conf, the behavior of the plugin will be the same as before (attenuation only).

HDA-Intel.conf is also modified to use softvol for its default capture. So now, capture is filtered through softvol (range -30 to +30 dB) before being passed on to dsnoop as before.

The softvol plugin allows a range of -51 to +50 dB, so max_dB could be increased to 50. But eventually samples are going to get clipped. At 40 dB I was beginning to get clipping when recording a sample sound at a "reasonably soft" volume using a digital mic on the stac9205 HDA codec.

The motivation for this work is that some HDA codecs have no hardware gain control for some paths. For instance, the stac9205 has support for digital mics, but there is no gain control widget for this signal before it is placed on the Azalia link (only a mute). Therefore gain can only be accomplished via software.

src/conf/cards/HDA-Intel.conf +11 -2
diff -r ae8426a8928c -r 43c8aebb3b03 src/conf/cards/HDA-Intel.conf
@@ -44,8 +44,17 @@ HDA-Intel.pcm.default {
 	capture.pcm {
 		type plug
 		slave.pcm {
-			@func concat
-			strings [ "dsnoop:" $CARD ]
+			type softvol
+			slave.pcm {
+				@func concat
+				strings [ "dsnoop:" $CARD ]
+			}
+			control {
+				name "Digital Capture Volume"
+				card $CARD
+			}
+			min_dB -30.0
+			max_dB 30.0
 		}
 	}
 }
src/pcm/pcm_softvol.c +96 -35

275 lines not on this page · raw message

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#8 lore raw

At Thu, 10 May 2007 12:57:10 -0700,

Quoted 11 lines · Steve Longerbeam

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I must have been doing something wrong because the capture device wasn't being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified
files: pcm_softvol.c and HDA-Intel.conf.

I also reduced the gain range, it's now -30 to +30 dB.

I'm afraid that this choice would be bad for the current TLV representation. The default resolution is 256, so -30/30 dB range doesn't match to this resolution. We should change either resolution (e.g. 120, corresponding to 0.5dB step), or the range.

Otherwise it looks fine to me.

Thanks,

Takashi

#9 lore raw
Quoted 12 lines · Takashi Iwai

At Thu, 10 May 2007 12:57:10 -0700,

Quoted 9 lines · Steve Longerbeam

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I must have been doing something wrong because the capture device wasn't being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified
files: pcm_softvol.c and HDA-Intel.conf.

Quoted 8 lines
Quoted 2 lines

I also reduced the gain range, it's now -30 to +30 dB.

I'm afraid that this choice would be bad for the current TLV representation. The default resolution is 256, so -30/30 dB range doesn't match to this resolution. We should change either resolution (e.g. 120, corresponding to 0.5dB step), or the range.

ok, that's no problem. How about we change the range to (in HDA-Intel.conf):

min_dB: -21.0
max_dB: 30.0

Steve

Quoted 8 lines

Otherwise it looks fine to me.

Thanks,

Takashi

#10 lore raw
Quoted 25 lines · Steve Longerbeam
Quoted 13 lines · Takashi Iwai

At Thu, 10 May 2007 12:57:10 -0700,

Quoted 9 lines · Steve Longerbeam

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I must have been doing something wrong because the capture device wasn't being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified
files: pcm_softvol.c and HDA-Intel.conf.

Quoted 9 lines
Quoted 3 lines

I also reduced the gain range, it's now -30 to +30 dB.

I'm afraid that this choice would be bad for the current TLV representation. The default resolution is 256, so -30/30 dB range doesn't match to this resolution. We should change either resolution (e.g. 120, corresponding to 0.5dB step), or the range.

Quoted 7 lines

ok, that's no problem. How about we change the range to (in HDA-Intel.conf):

min_dB: -21.0
max_dB: 30.0

Hi Takashi, should I send another patch with this change?

Steve

Quoted 16 lines
Quoted 9 lines

Otherwise it looks fine to me.

Thanks,

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#11 lore raw

At Thu, 17 May 2007 15:00:35 -0700,

Quoted 24 lines · Steve Longerbeam

Steve Longerbeam wrote:

Takashi Iwai wrote:

At Thu, 10 May 2007 12:57:10 -0700,
Steve Longerbeam wrote:

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I must have been doing something wrong because the capture device wasn't being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified
files: pcm_softvol.c and HDA-Intel.conf.

I also reduced the gain range, it's now -30 to +30 dB.

I'm afraid that this choice would be bad for the current TLV representation. The default resolution is 256, so -30/30 dB range doesn't match to this resolution. We should change either resolution (e.g. 120, corresponding to 0.5dB step), or the range.

Quoted 6 lines

ok, that's no problem. How about we change the range to (in HDA-Intel.conf):

min_dB: -21.0
max_dB: 30.0

Hi Takashi, should I send another patch with this change?

Well, -21/30 isn't better than -30/30 since it doesn't match with the default resolutions (= 256). So, I think -30/30 choice is good, but it just needs the adjustment of resolution.

I committed your last patch with this fix now to ALSA HG tree.

Thanks!

Takashi