Bug 46236

Summary: Microsoft LifeChat LX-3000 USB Audio Headset DB issue with Volume Scale
Product: PulseAudio Reporter: Konomi <konomikitten>
Component: modulesAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: minor    
Priority: medium CC: haitzer, lennart, paul.f.fee
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Good volume scaling
Bad volume scaling
lsusb -vvvv -d 045e:070f

Description Konomi 2012-02-17 09:22:41 UTC
Please bare with me as I don't normally report problems of this nature if ever. Recently I noticed my headset the LX-3000 was not scaling audio right. Looking in alsamixer confirmed this as moving the volume from 0 to 1 would move the scale up on the pulseaudio volume from 0 to 30. I eventually came across a post on the ubuntu forums detailing a work around:

http://ubuntuforums.org/showpost.php?p=9184651&postcount=4

Quote:

"There are a few variables which control how PulseAudio controls the volume. You can either edit /etc/pulse/default.pa (you'll have to be root to do that) to change the behavior for all users, or copy that file to ~/.pulse/default.pa and then edit that file, to change behavior for the current user only.

Open the file mentioned above. Find the row saying "load-module module-udev-detect" and change it to:

load-module module-udev-detect ignore_dB=1"

End Quote.

The problem was gone and the volume scaled correctly. I'm hoping to give the information needed here so pulseaudio's db can be updated. Here are the details of the USB audio. Please ask if more information is needed.

$ aplay -l | grep "USB Audio"
card 1: LX3000 [Microsoft LifeChat LX-3000], device 0: USB Audio [USB Audio]

$ lsusb | grep "Microsoft"
Bus 002 Device 011: ID 045e:070f Microsoft Corp.

Alsamixer reports the lowest volume for this device to be -28.37 dB and the highest to be -0.06 dB.

Thank you in advance.
Comment 1 Raymond 2013-08-27 01:22:33 UTC
do you mean pulseaudio cannot find the base volume when 0dB is not inside the dB rangle of playback volume ?

you have to provide pulseaudio verbose log
Comment 2 Paul Fee 2013-10-09 09:51:55 UTC
Thanks Kitty, I had the same issue with an LX-3000 headset.  Audio volume was too low until I adjust the volume to about 30%, then it would jump very quickly to being too loud.  Only a small range give usable volumes.

The workaround of adding "ignore_dB" to ~/.pulse/default.pa worked for me.  Volume now scales as expected.

Raymond - how can I help provide the logs you need?  Where are the logs? Do I need to turn up the verbosity?  If so how?  Would you like logs with and without the workaround applied?

My system is running Fedora 19 KDE spin with latest updates.  Pulseaudio 3.0-10, Kernel 3.11.3, KDE 4.11.1.
Comment 3 Raymond 2013-10-11 12:53:05 UTC
https://wiki.ubuntu.com/PulseAudio/Log

need the pulseaudio verbose log when you change the volume from min to max
Comment 4 Paul Fee 2013-10-21 16:37:07 UTC
Created attachment 87934 [details]
Good volume scaling

Affect of adjusting volume on hardware output device using pavucontrol.

~/.pulse/default.pa adjusted with line:
load-module module-udev-detect ignore_dB=1

Volume scales as desired between 0% and 100%.
Comment 5 Paul Fee 2013-10-21 16:41:16 UTC
Created attachment 87935 [details]
Bad volume scaling

Bad volume scaling

Affect of adjusting volume on hardware output device using pavucontrol.

~/.pulse/default.pa is identical to /etc/pulse/default.pa, with the line:
load-module module-udev-detect

Silence until about 25%, then sudden jump to loud about 35%.  Scaling not smooth.
Comment 6 Raymond 2013-10-23 03:01:54 UTC
dB range of Speaker Playback Volume is -28.37dB to -0.06dB  with steps 0 - 16



state.LX3000 {
	control.1 {
		iface PCM
		name 'Playback Channel Map'
		value.0 3
		value.1 4
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.2 {
		iface MIXER
		name 'Mic Playback Switch'
		value false
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.3 {
		iface MIXER
		name 'Mic Playback Volume'
		value 0
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 32'
			dbmin 0
			dbmax 4781
			dbvalue.0 0
		}
	}
	control.4 {
		iface MIXER
		name 'Speaker Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.5 {
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 146
		value.1 146
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 151'
			dbmin -2837
			dbmax -6
			dbvalue.0 -100
			dbvalue.1 -100
		}
	}
	control.6 {
		iface MIXER
		name 'Mic Capture Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.7 {
		iface MIXER
		name 'Mic Capture Volume'
		value 16
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 16'
			dbmin 0
			dbmax 2381
			dbvalue.0 2381
		}
	}
	control.8 {
		iface MIXER
		name 'Auto Gain Control'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
}
Comment 7 Raymond 2013-10-23 03:10:55 UTC

(   0.284|   0.000) I: [pulseaudio] source.c:     udev.id = "usb-045e_Microsoft_LifeChat_LX-3000-00-LX3000"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.bus = "usb"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.vendor.id = "045e"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.vendor.name = "Microsoft Corp."
(   0.284|   0.000) I: [pulseaudio] source.c:     device.product.id = "070f"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.product.name = "Microsoft LifeChat LX-3000 "
(   0.284|   0.000) I: [pulseaudio] source.c:     device.serial = "045e_Microsoft_LifeChat_LX-3000"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.string = "3"
(   0.284|   0.000) I: [pulseaudio] source.c:     module-udev-detect.discovered = "1"
(   0.284|   0.000) I: [pulseaudio] source.c:     device.icon_name = "audio-card-usb"
(   0.284|   0.000) I: [pulseaudio] alsa-sink.c: Using 2.0 fragments of size 176400 bytes (1000.00ms), buffer size is 352800 bytes (2000.00ms)
(   0.284|   0.000) I: [pulseaudio] alsa-sink.c: Time scheduling watermark is 20.00ms
(   0.284|   0.000) D: [pulseaudio] alsa-sink.c: hwbuf_unused=0
(   0.284|   0.000) D: [pulseaudio] alsa-sink.c: setting avail_min=87319
(   0.284|   0.000) D: [pulseaudio] alsa-mixer.c: Activating path analog-output-speaker
(   0.284|   0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output-speaker (Speakers), direction=1, priority=100, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=151, min_dB=-28.37, max_dB=-0.06


seem pulseaudio present a dB range from -inf to 0dB to the user while the hardware only support -28.37 to -0.06 

do you mean you cannot hear any sound at dB min -28.37 dB ?
Comment 8 Raymond 2013-10-23 03:59:27 UTC
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output-speaker (Speakers), direction=1, priority=100, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=87, min_dB=-130.5, max_dB=0
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=3, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Element Speaker, direction=1, switch=1, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=4, required_absent=0, mask=0x0, n_channels=0, override_map=yes
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Jack Headphone, alsa_name='Headphone Jack', detection unavailable
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Jack Front Headphone, alsa_name='Front Headphone Jack', detection possible
(   0.094|   0.000) D: [pulseaudio] alsa-mixer.c: Jack Speaker Phantom, alsa_name='Speaker Phantom Jack', detection possible
(   0.094|   0.000) I: [pulseaudio] alsa-sink.c: Successfully enabled deferred volume.
(   0.094|   0.000) I: [pulseaudio] alsa-sink.c: Hardware volume ranges from -130.50 dB to 0.00 dB.



  Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0

but your onboard alc269vb only has 0 - 87 steps and stepsize 0x02 = 0.75dB 

dB range should be -(87 x 0.75)dB  to 0dB 


Codec: Realtek ALC269VB
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0269

No Modem Function Group found
Default PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
GPIO: io=2, o=0, i=0, unsolicited=1, wake=0
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0x1d: Stereo Amp-Out
  Device: name="ALC269VB Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
  Amp-Out vals:  [0x57 0x57]
  Converter: stream=8, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x03 [Audio Output] wcaps 0x1d: Stereo Amp-Out
  Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
  Amp-Out vals:  [0x57 0x57]
  Converter: stream=8, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Comment 9 Paul Fee 2013-10-23 14:32:18 UTC
Raymond, I'm not sure from your comments above if you require more information.

Can you clarify if there's any additional data you'd like me to collect or tests that I can carry out to help fix this bug?

A fix for this bug should result in volume controls for LX-3000 headsets working as expected out of the box, with smooth volume adjustments between 0% and 100% volume.

Thanks.
Comment 10 Raymond 2013-10-23 15:21:50 UTC
are there any specification about dB range for LifeChat LX-3000 ?

does your onboard sound get mute when dB below -65.25 dB or -130.5dB ?

when you specify ignore_DB, pulseaudio just set headwaters volume to 100% and use software volume
Comment 11 Paul Fee 2013-10-23 15:35:43 UTC
(In reply to comment #10)
> are there any specification about dB range for LifeChat LX-3000 ?

I haven't configured (nor know how to) any dB ranges for the LX-3000 headset.  I don't know if Microsoft has published any technical data about this headset.

> 
> does your onboard sound get mute when dB below -65.25 dB or -130.5dB ?

I don't have any speakers connected to the onboard soundcard.  I'm using a USB headset as it's easier to plug into the USB hub on top off my desk, rather than plug into the audio jacks on the PC under my desk.  A USB headset is also more convenient as there's only one connector, rather than speaker and mic jacks on analogue headsets.

This doesn't help fix the bug, but gives context why someone may use USB audio hardware exclusively.

> 
> when you specify ignore_DB, pulseaudio just set headwaters volume to 100%
> and use software volume

s/headwaters/hardware/ ?

Is there a way this can be made the default for LX-3000 users?  Is the problem that the LX-3000 is incorrectly reporting its supported dB range?  If the bug is in the LX-3000 hardware, does pulseaudio have a whitelist/blacklist of good/bad hardware that would allow it to use appropriate settings without individual users having to reconfigure?  Even better would be a more generic solution that's not restricted to LX-3000 devices - if that's possible.
Comment 12 Raymond 2013-10-24 07:46:44 UTC
post the output of 

lsusb -vvvv

for your lifechat lx3000



do volume change as expected  if you use ?

alsamixer -c 3
Comment 13 Paul Fee 2013-10-25 09:07:25 UTC
(In reply to comment #12)
> does the volume change as expected if you use ?
> 
> alsamixer -c 3

"alsamixer -c 3" on my machine selects Card: HD-Audio Generic, Chip: ATI R6xx HDMI.  So instead I invoked "alsamixer -c 0" since that selects Card: Microsoft LifeChat LX-3000, Chip: USB Mixer.

Yes, adjusting the speaker volume using alsamixer worked as expected.  Within alsamixer, Speaker volume 0 was reported as dB gain: -28.37, -28.37.  Speaker volume 100 was reported as dB gain: -0.06, -0.06.  The change was smooth across the range 0 to 100.
Comment 14 Paul Fee 2013-10-25 09:12:02 UTC
Created attachment 88104 [details]
lsusb -vvvv -d 045e:070f

Verbose information from lsusb for Microsoft LX-3000 USB Headset (045e:070f).
Comment 15 Raymond 2013-10-27 01:20:16 UTC
http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/pulse/volume.h

Volumes commonly span between muted (0%), and normal (100%). It is possible
 to set volumes to higher than 100%, but clipping might occur.


/** Normal volume (100%, 0 dB) */
#define PA_VOLUME_NORM ((pa_volume_t) 0x10000U)

/** Muted (minimal valid) volume (0%, -inf dB) */
#define PA_VOLUME_MUTED ((pa_volume_t) 0U)



your live chat does not has dB MAX at zero dB (100%)

how did pulseaudio's 30% volume = -28.37 dB ?
Comment 16 Tanu Kaskinen 2013-10-28 11:13:21 UTC
(In reply to comment #13)
> Yes, adjusting the speaker volume using alsamixer worked as expected. 
> Within alsamixer, Speaker volume 0 was reported as dB gain: -28.37, -28.37. 
> Speaker volume 100 was reported as dB gain: -0.06, -0.06.  The change was
> smooth across the range 0 to 100.

Within alsamixer, when you set the Speaker volume to 0, is it muted? If it is (as I suspect), then this is clearly a bug in ALSA, because ALSA tells that the attenuation is -28.37 dB, while in reality it's -inf dB (muted).
Comment 17 Raymond 2013-10-28 12:00:51 UTC
USB Audio 1.0 Specification

5.2.2.2.3
Mixer Control
A Mixer Unit consists of a number of Mixer Controls, either programmable or fixed. A Mixer Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The settings for the CUR, MIN, and MAX attributes can range from +127.9961 dB (0x7FFF) down to -127.9961 dB (0x8001) in steps of 1/256
dB or 0.00390625 dB (0x0001). The range for the CUR attribute is extended by code 0x8000, representing silence, i.e., -∞ dB. The settings for the RES attribute can only take positive values and range from 1/256 dB (0x0001) to +127.9961 dB (0x7FFF).
Comment 18 Raymond 2013-10-28 12:20:21 UTC
USB Audio 2.0 specification

5.2.5.5.1 Mixer Control

...

In addition, code 0x8000, representing silence (i.e., -∞ dB), must always be implemented. However, it must never be reported as the MIN attribute value.
Comment 19 Raymond 2013-10-30 01:30:30 UTC
http://en.wikipedia.org/wiki/Audio_bit_depth

24-bit digital audio has a theoretical maximum SNR of 144 dB, compared to 96 dB for 16-bit

Signal-to-noise ratio and resolution of bit depths# bits	SNR	Possible integer values	Base ten signed range
4	24.08 dB	16	−8 to +7
8	48.16 dB	256	−128 to +127
16	96.33 dB	65,536	−32,768 to +32,767
20	120.41 dB	1,048,576	−524,288 to +524,287
24	144.49 dB	16,777,216	−8,388,608 to +8,388,607
32	192.66 dB	4,294,967,296	−2,147,483,648 to +2,147,483,647
48	288.99 dB	281,474,976,710,656	−140,737,488,355,328 to +140,737,488,355,327
64	385.32 dB	9,223,372,036,854,775,807	−4,611,686,018,427,387,903 to +4,611,686,018,427,387,902

the volume control of livechat is about 4 bit while the volume control is just  16 bit plus -inf

are your livechat confine to USB audio 1.0 or 2.0 ?
Comment 20 Michael Heyns 2014-03-13 23:58:49 UTC
I just want to confirm that the issue is still present and the workaround works for me.
Comment 21 Raymond 2014-03-14 05:36:10 UTC
	control.4 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 151'
		comment.dbmin -2837
		comment.dbmax -119
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 118
		value.1 118
	}


you cannot change cval->res since 151 is a prime number,

even if you think the audio device cannot provide 0.17 dB per step

http://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Decibel/
Comment 22 GitLab Migration User 2018-07-30 10:19:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/342.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.