HDA: Sound mutes when combination is below -48 dB
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes. Codec is attached.
"Master" is a "Virtual master" control, and both "Master" and "Speaker" control amp-out on nid 0x13. Nid 0x13 does not have amp-out caps, but the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.
There is some strange things here. First, in patch_sigmatel:create_controls_idx, there is this comment:
/* if dB scale is over -64dB, and finer enough, * let's reduce it to half */
Hmm? Removing half of the volume slider?
Second, assuming we actually buy this decision, wouldn't it make sense for people to be able to combine Master and Speaker to get the full -96 to 0 dB range? Instead, "Master" is just working over the range defined by "Speaker".
Third, there is an interesting condition in hda_codec.c:update_amp_value:
if (val > 0) val += ofs;
Now this is in practice turning all volume controls which have ofs (e g those being "reduced to half") to a minimum-is-mute error: I can set the amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). So it isn't really mute, it's -96 dB signal, but I can't hear that anyway.
So; I think I understand the problem, but I'm not sure of where I should try to patch it, to make the best solution.
Finally, is there right to exist for both "virtual masters" and the "PCM" softvol talked about a while ago? If I were to decide, I'd personally like them both removed (the additional complexity isn't motivated IMO), but wouldn't it at least make sense to name the virtual master "PCM", to avoid the PCM softvol?
Signature · 2 lines
David Henningsson, Canonical Ltd. http://launchpad.net/~diwic
Codec: IDT 92HD81B1X5
Address: 0
Function Id: 0x1
Vendor Id: 0x111d7605
Subsystem Id: 0x103c1413
Revision Id: 0x100402
No Modem Function Group found
Default PCM:
rates [0x5e0]: 44100 48000 88200 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCMDefault Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1
GPIO: io=3, o=0, i=0, unsolicited=1, wake=1
IO[0]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Power-Map: 0x00
Node 0x0a [Pin Complex] wcaps 0x400583: Stereo Amp-In
Control: name="Mic Jack Mode", index=0, device=0
ControlAmp: chs=0, dir=In, idx=0, ofs=0
Control: name="Mic Capture Volume", index=0, device=0
ControlAmp: chs=3, dir=In, idx=0, ofs=0
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Pincap 0x0001173c: IN OUT HP EAPD Detect
Vref caps: HIZ 50 GRD 80
EAPD 0x2: EAPD
Pin Default 0x03a19020: [Jack] Mic at Ext Left
Conn = 1/8, Color = Pink
DefAssociation = 0x2, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=02, enabled=1
Power: setting=D0, actual=D0
Connection: 3
0x13* 0x14 0x1cNode 0x0b [Pin Complex] wcaps 0x400581: Stereo
Pincap 0x0001001c: OUT HP EAPD Detect EAPD 0x2: EAPD
Pin Default 0x0321401f: [Jack] HP Out at Ext Left
Conn = 1/8, Color = Green DefAssociation = 0x1, Sequence = 0xf
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=01, enabled=1
Power: setting=D0, actual=D0
Connection: 3
0x13 0x14* 0x1c
Node 0x0c [Pin Complex] wcaps 0x400583: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Pincap 0x00011734: IN OUT EAPD Detect
Vref caps: HIZ 50 GRD 80
EAPD 0x2: EAPD
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00: VREF_HIZ
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Connection: 3
0x13* 0x14 0x1c
Node 0x0d [Pin Complex] wcaps 0x400501: Stereo
Pincap 0x00010050: OUT EAPD Balanced
EAPD 0x2: EAPD
Pin Default 0x90170110: [Fixed] Speaker at Int N/A
Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Misc = NO_PRESENCE
Pin-ctls: 0x00:
Power: setting=D0, actual=D0
Connection: 3
0x13* 0x14 0x1c
Node 0x0e [Pin Complex] wcaps 0x400583: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Pincap 0x00010034: IN OUT EAPD Detect
EAPD 0x2: EAPD
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Connection: 3
0x13 0x14* 0x1c
Node 0x0f [Pin Complex] wcaps 0x400583: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Pincap 0x00010034: IN OUT EAPD Detect
EAPD 0x2: EAPD
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Connection: 3
0x13 0x14* 0x1c
Node 0x10 [Pin Complex] wcaps 0x400500: Mono
Pincap 0x00000010: OUT
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00:
Power: setting=D0, actual=D0
Connection: 1
0x1a
Node 0x11 [Pin Complex] wcaps 0x400483: Stereo Amp-In
Control: name="Front Mic Capture Volume", index=0, device=0
ControlAmp: chs=3, dir=In, idx=0, ofs=0 Amp-In caps: N/A
Amp-In vals: [0x01 0x01]
Pincap 0x00000024: IN Detect
Pin Default 0x90a60130: [Fixed] Mic at Int N/A
Conn = Digital, Color = Unknown
DefAssociation = 0x3, Sequence = 0x0
Misc = NO_PRESENCE
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Node 0x12 [Vendor Defined Widget] wcaps 0xf00503: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Power: setting=D0, actual=D0
Connection: 1
0x20
Node 0x13 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out R/L
Control: name="Speaker Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=63
Control: name="Speaker Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Device: name="STAC92xx Analog", type="Audio", device=0 Amp-Out caps: N/A
Amp-Out vals: [0x41 0x41]
Converter: stream=5, channel=0
Power: setting=D0, actual=D0
Delay: 13 samples
Node 0x14 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out R/L
Control: name="Headphone Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=63
Control: name="Headphone Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: N/A
Amp-Out vals: [0x40 0x40]
Converter: stream=5, channel=0
Power: setting=D0, actual=D0
Delay: 13 samples
Node 0x15 [Audio Input] wcaps 0x1d0541: Stereo
Device: name="STAC92xx Analog", type="Audio", device=0
Converter: stream=0, channel=0
SDI-Select: 0
Power: setting=D0, actual=D0
Delay: 13 samples
Connection: 1
0x17
Processing caps: benign=0, ncoeff=0
Node 0x16 [Audio Input] wcaps 0x1d0541: Stereo
Converter: stream=0, channel=0
SDI-Select: 0
Power: setting=D0, actual=D0
Delay: 13 samples
Connection: 1
0x18
Processing caps: benign=0, ncoeff=0
Node 0x17 [Audio Selector] wcaps 0x300d0d: Stereo Amp-Out R/L
Control: name="Capture Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Control: name="Capture Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1
Amp-Out vals: [0x00 0x00]
Power: setting=D0, actual=D0
Connection: 7
0x0c 0x0e 0x0f 0x1b 0x11* 0x12 0x0aNode 0x18 [Audio Selector] wcaps 0x300d0d: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Power: setting=D0, actual=D0
Connection: 7
0x0c* 0x0e 0x0f 0x1b 0x11 0x12 0x0a
Node 0x19 [Audio Selector] wcaps 0x300501: Stereo
Power: setting=D0, actual=D0
Connection: 3
0x13* 0x14 0x1c
Node 0x1a [Audio Mixer] wcaps 0x200500: Mono
Power: setting=D0, actual=D0
Connection: 1
0x19Node 0x1b [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
Amp-In vals: [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97]
Power: setting=D0, actual=D0
Connection: 6
0x0c 0x0e 0x0f 0x13 0x14 0x0a
Node 0x1c [Audio Selector] wcaps 0x30050d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x9f 0x9f]
Power: setting=D0, actual=D0
Connection: 1
0x1b
Node 0x1d [Audio Output] wcaps 0x4061d: Stereo Digital Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Converter: stream=0, channel=0
Digital:
Digital category: 0x0
PCM:
rates [0x5e0]: 44100 48000 88200 96000 192000
bits [0xe]: 16 20 24
formats [0x5]: PCM AC3 Power: setting=D0, actual=D0
Delay: 4 samples
Node 0x1e [Audio Output] wcaps 0x4061d: Stereo Digital Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Converter: stream=0, channel=0
Digital:
Digital category: 0x0
PCM:
rates [0x5e0]: 44100 48000 88200 96000 192000
bits [0xe]: 16 20 24
formats [0x5]: PCM AC3 Power: setting=D0, actual=D0
Delay: 4 samples
Node 0x1f [Pin Complex] wcaps 0x400781: Stereo Digital
Pincap 0x00000014: OUT Detect
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Connection: 1
0x1d
Node 0x20 [Pin Complex] wcaps 0x400781: Stereo Digital
Pincap 0x00000034: IN OUT Detect
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power: setting=D0, actual=D0
Connection: 1
0x1e
Node 0x21 [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out
Control: name="Beep Playback Switch", index=0, device=0
ControlAmp: chs=1, dir=Out, idx=0, ofs=0
Control: name="Beep Playback Volume", index=0, device=0
ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x03, nsteps=0x03, stepsize=0x17, mute=1 Amp-Out vals: [0x00]
Node 0x22 [Vendor Defined Widget] wcaps 0xf00000: Mono
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 4 lines · David Henningsson
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes.
A known SigmaTel bug. Does your kernel already have these patches?
http://git.alsa-project.org/?p=alsa-kernel.git;a=commit;h=de8c85f7840e5e29629de95f5af24297fb325e0b
http://git.alsa-project.org/?p=alsa-kernel.git;a=commit;h=a74ccea51d4314632a81d568d59bf885e5b09d93
Regards,
Clemens
At Fri, 03 Dec 2010 12:30:02 +0100,
Quoted 16 lines · David Henningsson
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes. Codec is attached.
"Master" is a "Virtual master" control, and both "Master" and "Speaker" control amp-out on nid
0x13. Nid0x13does not have amp-out caps, but the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.There is some strange things here. First, in patch_sigmatel:create_controls_idx, there is this comment:
/* if dB scale is over -64dB, and finer enough, * let's reduce it to half */
Quoted 6 lines
Hmm? Removing half of the volume slider?
Second, assuming we actually buy this decision, wouldn't it make sense for people to be able to combine Master and Speaker to get the full -96 to 0 dB range? Instead, "Master" is just working over the range defined by "Speaker".
Well, the problem was fairly old. You must think of the world before anything dB evaluation was introduced in the mixer apps. They just took a percentage value, so we got to cut it off to give some "usable" interface for them.
The biggest problem right now is that you can't take it back so easily "just for PA". The PCM softvol is also the same. There is no perfect solution, and PA isn't by 100% people here. However, we must not give a regression in 100% manner.
OK, let's back to the bug point...
Quoted 9 lines
Third, there is an interesting condition in hda_codec.c:update_amp_value:
if (val > 0) val += ofs;Now this is in practice turning all volume controls which have ofs (e g those being "reduced to half") to a minimum-is-mute error: I can set the amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). So it isn't really mute, it's -96 dB signal, but I can't hear that anyway.
OK, this looks really like a bug that the driver gives min-mute flag. The min-mute flag should be given only for the STAC codecs with lower resolution, such as STAC9200. It seems that STAC925x (and STAC9202) are also in this category, while STAC9205 and other IDT codecs have higher resolutions.
Since both STAC9200 and STAC925x have own Master definition, the simplest solution is to remove TLV_DB_SCALE_MUTE for vmaster like below...
thanks,
Takashi
---
sound/pci/hda/patch_sigmatel.c +0 -2
@@ -1150,8 +1150,6 @@ static int stac92xx_build_controls(struct hda_codec *codec) HDA_OUTPUT, vmaster_tlv);/* correct volume offset */ vmaster_tlv[2 ] += vmaster_tlv[3 ] * spec->volume_offset; -/* minimum value is actually mute */ - vmaster_tlv[3 ] |=TLV_DB_SCALE_MUTE ; err =snd_hda_add_vmaster (codec,"Master Playback Volume" , vmaster_tlv, slave_vols);if (err <0 )
Quoted 30 lines · Takashi Iwai
At Fri, 03 Dec 2010 12:30:02 +0100,
Quoted 16 lines · David Henningsson
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes. Codec is attached.
"Master" is a "Virtual master" control, and both "Master" and "Speaker" control amp-out on nid
0x13. Nid0x13does not have amp-out caps, but the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.There is some strange things here. First, in patch_sigmatel:create_controls_idx, there is this comment:
/* if dB scale is over -64dB, and finer enough, * let's reduce it to half */Quoted 6 lines
Hmm? Removing half of the volume slider?
Second, assuming we actually buy this decision, wouldn't it make sense for people to be able to combine Master and Speaker to get the full -96 to 0 dB range? Instead, "Master" is just working over the range defined by "Speaker".
Well, the problem was fairly old. You must think of the world before anything dB evaluation was introduced in the mixer apps. They just took a percentage value, so we got to cut it off to give some "usable" interface for them.
Quoted 4 lines
The biggest problem right now is that you can't take it back so easily "just for PA". The PCM softvol is also the same. There is no perfect solution, and PA isn't by 100% people here. However, we must not give a regression in 100% manner.
Ok. I'm not certain I agree, but I see your point.
Quoted 19 lines
OK, let's back to the bug point...
Quoted 9 lines
Third, there is an interesting condition in hda_codec.c:update_amp_value:
if (val> 0) val += ofs;Now this is in practice turning all volume controls which have ofs (e g those being "reduced to half") to a minimum-is-mute error: I can set the amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). So it isn't really mute, it's -96 dB signal, but I can't hear that anyway.
OK, this looks really like a bug that the driver gives min-mute flag. The min-mute flag should be given only for the STAC codecs with lower resolution, such as STAC9200. It seems that STAC925x (and STAC9202) are also in this category, while STAC9205 and other IDT codecs have higher resolutions.
Quoted 3 lines
Since both STAC9200 and STAC925x have own Master definition, the simplest solution is to remove
TLV_DB_SCALE_MUTEfor vmaster like below...
I've tried it, but it doesn't help. Test case is simple: run the codec attached to the previous mail in hda-emu [1]. Then turn "Master" down from 64 to 60, or anything that makes the combination of "Master" and "Speaker" less than -48 dB, and notice that the amp value sent to the codec is 0x0 (i e -96 dB).
[1] If I never thanked you for that program, I do so now, it is a really great tool!
Signature · 2 lines
David Henningsson, Canonical Ltd. http://launchpad.net/~diwic
At Fri, 03 Dec 2010 16:34:14 +0100,
Quoted 62 lines · David Henningsson
Quoted 30 lines · Takashi Iwai
At Fri, 03 Dec 2010 12:30:02 +0100,
Quoted 16 lines · David Henningsson
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes. Codec is attached.
"Master" is a "Virtual master" control, and both "Master" and "Speaker" control amp-out on nid
0x13. Nid0x13does not have amp-out caps, but the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.There is some strange things here. First, in patch_sigmatel:create_controls_idx, there is this comment:
/* if dB scale is over -64dB, and finer enough, * let's reduce it to half */Quoted 6 lines
Hmm? Removing half of the volume slider?
Second, assuming we actually buy this decision, wouldn't it make sense for people to be able to combine Master and Speaker to get the full -96 to 0 dB range? Instead, "Master" is just working over the range defined by "Speaker".
Well, the problem was fairly old. You must think of the world before anything dB evaluation was introduced in the mixer apps. They just took a percentage value, so we got to cut it off to give some "usable" interface for them.
Quoted 4 lines
The biggest problem right now is that you can't take it back so easily "just for PA". The PCM softvol is also the same. There is no perfect solution, and PA isn't by 100% people here. However, we must not give a regression in 100% manner.
Ok. I'm not certain I agree, but I see your point.
Quoted 19 lines
OK, let's back to the bug point...
Quoted 9 lines
Third, there is an interesting condition in hda_codec.c:update_amp_value:
if (val> 0) val += ofs;Now this is in practice turning all volume controls which have ofs (e g those being "reduced to half") to a minimum-is-mute error: I can set the amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). So it isn't really mute, it's -96 dB signal, but I can't hear that anyway.
OK, this looks really like a bug that the driver gives min-mute flag. The min-mute flag should be given only for the STAC codecs with lower resolution, such as STAC9200. It seems that STAC925x (and STAC9202) are also in this category, while STAC9205 and other IDT codecs have higher resolutions.
Quoted 3 lines
Since both STAC9200 and STAC925x have own Master definition, the simplest solution is to remove
TLV_DB_SCALE_MUTEfor vmaster like below...
Quoted 5 lines
I've tried it, but it doesn't help. Test case is simple: run the codec attached to the previous mail in hda-emu [1]. Then turn "Master" down from 64 to 60, or anything that makes the combination of "Master" and "Speaker" less than -48 dB, and notice that the amp value sent to the codec is
0x0(i e -96 dB).
Ah, it's vmaster that limits the min/max in the upper layer. In the current code, 0 is always handled as 0 in update_amp_value(), so this is the case.
Fixing it would be tricky. The easiest way is to reduce this cut-off, but then it will hit too many people.
Quoted 2 lines
[1] If I never thanked you for that program, I do so now, it is a really great tool!
Good to hear :)
thanks,
Takashi
2010/12/3 David Henningsson <[email protected]>
Quoted 31 lines · Takashi Iwai
Quoted 30 lines
At Fri, 03 Dec 2010 12:30:02 +0100,
Quoted 16 lines · David Henningsson
I'm trying to nail down a strange behaviour. I have one "Master" and one "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the output mutes. Codec is attached.
"Master" is a "Virtual master" control, and both "Master" and "Speaker" control amp-out on nid
0x13. Nid0x13does not have amp-out caps, but the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.There is some strange things here. First, in patch_sigmatel:create_controls_idx, there is this comment:
/* if dB scale is over -64dB, and finer enough, * let's reduce it to half */Quoted 6 lines
Hmm? Removing half of the volume slider?
Second, assuming we actually buy this decision, wouldn't it make sense for people to be able to combine Master and Speaker to get the full -96 to 0 dB range? Instead, "Master" is just working over the range defined by "Speaker".
Well, the problem was fairly old. You must think of the world before anything dB evaluation was introduced in the mixer apps. They just took a percentage value, so we got to cut it off to give some "usable" interface for them.
Quoted 7 lines
Quoted 4 lines
The biggest problem right now is that you can't take it back so easily "just for PA". The PCM softvol is also the same. There is no perfect solution, and PA isn't by 100% people here. However, we must not give a regression in 100% manner.
Ok. I'm not certain I agree, but I see your point.
Seem that softvol plugin "PCM playback volume" really follow the OSS emulation "PCM" volume which mute at 0% , so is this a bug which report -51dB to the alsa application ?
Do softvol plugin need to use TLV_DB_SCALE_MUTE too ?
Quoted 26 lines
Quoted 5 lines
OK, let's back to the bug point...
Quoted 1 line
Third, there is an interesting condition in
hda_codec.c:update_amp_value:
Quoted 8 lines
Quoted 8 lines
if (val> 0) val += ofs;Now this is in practice turning all volume controls which have ofs (e g those being "reduced to half") to a minimum-is-mute error: I can set the amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). So it isn't really mute, it's -96 dB signal, but I can't hear that
anyway.
Quoted 10 lines
OK, this looks really like a bug that the driver gives min-mute flag. The min-mute flag should be given only for the STAC codecs with lower resolution, such as STAC9200. It seems that STAC925x (and STAC9202) are also in this category, while STAC9205 and other IDT codecs have higher resolutions.
Since both STAC9200 and STAC925x have own Master definition, the simplest solution is to remove
TLV_DB_SCALE_MUTEfor vmaster like below...
Quoted 10 lines
I've tried it, but it doesn't help. Test case is simple: run the codec attached to the previous mail in hda-emu [1]. Then turn "Master" down from 64 to 60, or anything that makes the combination of "Master" and "Speaker" less than -48 dB, and notice that the amp value sent to the codec is
0x0(i e -96 dB).[1] If I never thanked you for that program, I do so now, it is a really great tool!
Just using your alsamixertest-48.11 to test hda sound card
When using -i plughw:1
INFO:root:Running test for mixer PCM, level -3.000000 dB INFO:root:Running test for mixer PCM, level -6.000000 dB INFO:root:Running test for mixer PCM, level -9.000000 dB INFO:root:Running test for mixer PCM, level -12.000000 dB INFO:root:Running test for mixer PCM, level -15.000000 dB INFO:root:Running test for mixer PCM, level -18.000000 dB INFO:root:Running test for mixer PCM, level -21.000000 dB INFO:root:Running test for mixer PCM, level -24.000000 dB INFO:root:Running test for mixer PCM, level -27.000000 dB INFO:root:Running test for mixer PCM, level -30.000000 dB INFO:root:Running test for mixer PCM, level -33.000000 dB INFO:root:Running test for mixer PCM, level -36.000000 dB INFO:root:Running test for mixer PCM, level -39.000000 dB INFO:root:Running test for mixer PCM, level -42.000000 dB INFO:root:Running test for mixer PCM, level -45.000000 dB INFO:root:Running test for mixer PCM, level -48.000000 dB ERROR:root:Error 5: Mixer PCM mutes the signal at -51.000000 dB.
using -i plug:front as the same way as PA server
The dB value measured by your program is double of the value and this proves that the softvol control "PCM Playback Volume" has effect on both playback stream and capture stream to get this kind of result
why PA server still use "front" device for capture when the most common sound card have these problem ?
./alsamixertest.py -i plug:front:1 -o plug:front:1 -m hw:1 --step=3set(['Front', 'Master Front', 'Master', 'Hardware Master', 'PCM'])
...
INFO:root:Running initial test signal.
INFO:root:Testing that Master actually mutes the signal INFO:root:Testing that Front actually mutes the signal INFO:root:Running test for mixer Master, level -3.000000 dB INFO:root:Running test for mixer Master, level -6.000000 dB INFO:root:Running test for mixer Master, level -9.000000 dB INFO:root:Running test for mixer Master, level -12.000000 dB INFO:root:Running test for mixer Master, level -15.000000 dB INFO:root:Running test for mixer Master, level -18.000000 dB INFO:root:Running test for mixer Master, level -21.000000 dB INFO:root:Running test for mixer Master, level -24.000000 dB INFO:root:Running test for mixer Master, level -27.000000 dB INFO:root:Running test for mixer Master, level -30.000000 dB INFO:root:Running test for mixer Master, level -33.000000 dB INFO:root:Running test for mixer Master, level -36.000000 dB INFO:root:Running test for mixer Master, level -39.000000 dB INFO:root:Running test for mixer Master, level -42.000000 dB INFO:root:Running test for mixer Master, level -45.000000 dB INFO:root:Running test for mixer Master, level -48.000000 dB INFO:root:Running test for mixer Master, level -51.000000 dB INFO:root:Running test for mixer Master, level -54.000000 dB INFO:root:Running test for mixer Master, level -57.000000 dB INFO:root:Running test for mixer Master, level -58.500000 dB ERROR:root:Error 5: Mixer Master mutes the signal at -60.000000 dB. INFO:root:Running test for mixer PCM, level -3.000000 dB WARNING:root:Mixer PCM is 2.991528 dB off at -3.000000 dB. INFO:root:Running test for mixer PCM, level -6.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-6.000000, expected -9.726178 dB but measured -15.716394 dB.
INFO:root:Running test for mixer PCM, level -9.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-9.000000, expected -12.726178 dB but measured -21.838096 dB.
INFO:root:Running test for mixer PCM, level -12.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-12.000000, expected -15.726178 dB but measured -27.715342 dB. INFO:root:Running test for mixer PCM, level -15.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-15.000000, expected -18.726178 dB but measured -33.712999 dB. INFO:root:Running test for mixer PCM, level -18.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-18.000000, expected -21.726178 dB but measured -39.919739 dB. INFO:root:Running test for mixer PCM, level -21.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-21.000000, expected -24.726178 dB but measured -45.718424 dB. INFO:root:Running test for mixer PCM, level -24.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-24.000000, expected -27.726178 dB but measured -51.824640 dB. INFO:root:Running test for mixer PCM, level -27.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-27.000000, expected -30.726178 dB but measured -57.709120 dB. INFO:root:Running test for mixer PCM, level -30.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-30.000000, expected -33.726178 dB but measured -63.726170 dB. INFO:root:Running test for mixer PCM, level -33.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-33.000000, expected -36.726178 dB but measured -69.971399 dB. INFO:root:Running test for mixer PCM, level -36.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-36.000000, expected -39.726178 dB but measured -75.738969 dB. INFO:root:Running test for mixer PCM, level -39.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-39.000000, expected -42.726178 dB but measured -81.733219 dB. INFO:root:Running test for mixer PCM, level -42.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-42.000000, expected -45.726178 dB but measured -87.774599 dB. INFO:root:Running test for mixer PCM, level -45.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-45.000000, expected -48.726178 dB but measured -93.806418 dB. INFO:root:Running test for mixer PCM, level -48.000000 dB ERROR:root:Error 6: Mixer PCM has invalid dB data for dB=-48.000000, expected -51.726178 dB but measured -99.685773 dB. INFO:root:Running test for mixer PCM, level -51.000000 dB