Bug 94061 - Volume set below -27 db (35 per centage) makes Creative HS-720 absolutely silent
Summary: Volume set below -27 db (35 per centage) makes Creative HS-720 absolutely silent
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: alsa (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-09 11:10 UTC by Yan Pas
Modified: 2018-07-30 10:28 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
vvvvlog (563.35 KB, text/plain)
2016-02-09 15:48 UTC, Yan Pas
Details
alsainfo (4.67 KB, text/plain)
2016-02-10 14:18 UTC, Yan Pas
Details

Description Yan Pas 2016-02-09 11:10:33 UTC
Without pulseaudio volume level is detected correctly. (I 've changed default card in /etc/asound.conf, then ran `speaker-test -c6 -twav` and set volume in alsamixer to 3 per centages)
With pulseaudio:
1) Headset is loud, even on lowest possible volume level
2) If I set volume below 35 per centages (below -27 db) the output becomes silent immediately.
3) On some computers, there is possibility to change analog mode to digital (S/PDIF). With digital mode it becomes calmer: the loudest volume level produces low volume, it is the same as 35% of analog mode, and the lowest volume level may be still determined.

Tested with latest versions (ubuntu xenial):
Version 7.1
kernel 4.4

cat /proc/asound/card3/pcm0p/info 
card: 3
device: 0
subdevice: 0
stream: PLAYBACK
id: USB Audio
name: USB Audio
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1
Comment 1 Yan Pas 2016-02-09 11:19:17 UTC
from lshw
            *-usbhost
                product: OHCI PCI host controller
                vendor: Linux 4.4.0-2-generic ohci_hcd
                physical id: 1
                bus info: usb@7
                logical name: usb7
                version: 4.04
                capabilities: usb-1.10
                configuration: driver=hub slots=4 speed=12Mbit/s
              *-usb
                   description: Audio device
                   product: Creative HS-720 Headset
                   vendor: Creative Technology Ltd.
                   physical id: 1
                   bus info: usb@7:1
                   version: 1.00
                   capabilities: usb-1.10 audio-control
                   configuration: driver=usbhid maxpower=100mA speed=12Mbit/s
Comment 2 Raymond 2016-02-09 14:57:51 UTC
You can use ignore_db=1 If pulseaudio don't. Like dB range -28.37 dB to 0dB




state.Headset { 
control.1 { iface MIXER name 'PCM Playback Switch'
 value true comment { access 'read write' 
type BOOLEAN
 count 1 } } 
control.2 { iface MIXER name 'PCM Playback Volume' 
value.0 12 value.1 12 comment { access 'read write'
 type INTEGER 
count 2 
range '0 - 38' dbmin -2837 dbmax -6 
dbvalue.0 -1943 dbvalue.1 -1943 } }
Comment 3 Raymond 2016-02-09 15:02:34 UTC
Can you provide the log when you change the volume slider? 

Do the volume change when you change from step 0 to step 38 using alsa mixer

-28.37 to -0.06 dB
Comment 4 Raymond 2016-02-09 15:08:37 UTC
You can provide correct dB range by re calibrate your usb audio device

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=42e3121d90f42e57f6dbd6083dff2f57b3ec7daa
Comment 5 Yan Pas 2016-02-09 15:48:18 UTC
Created attachment 121624 [details]
vvvvlog

I've made log according to this guide https://wiki.ubuntu.com/PulseAudio/Log :
`LANG=C pulseaudio -vvvv --log-time=1 > ~/pulseverbose.log 2>&1`
Comment 6 Yan Pas 2016-02-09 16:00:31 UTC
1)I've searched over the internet and have found the same issue as mine (35% too), but with another usb audio card :
https://chrisjean.com/fix-for-usb-audio-is-too-loud-and-mutes-at-low-volume-in-ubuntu/
Some notes from this guide helped me: I 've changed "volume = merge" to "volume = ignore" in /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

Situation now is much much better: headset behave as they should be (the same like in digital mode), but the maximum volume is not loud enough imho (120-130% would be fine). Setting volume over 100% causes overdrive (headset may play louder without overdrives according to my past expirience). 

Maybe making such config default is good idea? (replace  merge with ignore)

2) I 'm using windows-dualboot and I have noticed that 100% volume on windows is always louder that 100% on linux (with PA)

3) In which file should I place "ignore_db=1"?

4) Is it dangerous to recalibrate my headsets? Should I use any program (I don't know which) to provide range which I consider correct? And which units should I use ? (dB, volts, some virtual usb units etc.) I guess such patches should be sent to alsa project or kernel, not PA.
Comment 7 Yan Pas 2016-02-09 16:30:08 UTC
Nevermind point 3. "load-module module-udev-detect use_ucm=0 ignore_dB=1" in /etc/pulse/default.pa is far better solution. The volume may be still extreme loud, but I won't set it over 45%.
From all above I conclude:
1) It's not PA fault, but some default configurations may be altered in pulseaudio. Why not to make ignore_dB=1 default?
2) According to latest comment here: https://chrisjean.com/fix-for-usb-audio-is-too-loud-and-mutes-at-low-volume-in-ubuntu/
On some architectures (amd64) or most motherboards creative and some other cards are too loud, and I should have talks with kernel devs with this problem
Comment 8 Raymond 2016-02-10 09:32:17 UTC
1.814| 0.000) I: [pulseaudio] alsa-sink.c: Hardware volume ranges from -28,37 dB to -0,06 dB. ( 1.814| 0.000) I: [pulseaudio] alsa-sink.c: Fixing base volume to 0,06 dB ( 1.814| 0.000) I: [pulseaudio] alsa-sink.c: Using hardware volume control. Hardware dB scale supported. ( 1.814| 0.000) I: [pulseaudio] alsa-sink.c: Using hardware mute control. ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: snd_pcm_dump(): ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: Hardware PCM card 2 'Creative HS-720 Headset' device 0 subdevice 0 ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: Its setup is: ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: stream : PLAYBACK ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: access : MMAP_INTERLEAVED ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: format : S16_LE ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: subformat : STD ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: channels : 2 ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: rate : 44100 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: exact rate : 44100 (44100/1) 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: msbits : 16 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: buffer_size : 88200 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: period_size : 44100 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: period_time : 1000000 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: tstamp_mode : ENABLE 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: period_step : 1 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: avail_min : 87319 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: period_event : 0 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: start_threshold : -1 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: stop_threshold : 6206523236469964800
 ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: silence_threshold: 0
 ( 1.814| 0.000) D: [pulseaudio] alsa-util.c: silence_size : 0 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: boundary : 6206523236469964800 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: appl_ptr : 0 
( 1.814| 0.000) D: [pulseaudio] alsa-util.c: hw_ptr : 0 
( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: Requested volume: 0: 35% 1: 35% 
( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: in dB: 0: -27,14 dB 1: -27,14 dB
 ( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: Got hardware volume: 0: 36% 1: 36%
 ( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: in dB: 0: -26,82 dB 1: -26,82 dB ( 1.815| 0.000) D: [alsa-sink-USB Audio] alsa-sink.c: Thread starting up 
( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: Calculated software volume: 0: 99% 1: 99% (accurate-enough=no) 
( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: in dB: 0: -0,32 dB 1: -0,32 dB 
( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: Written HW volume did not match with the request: 0: 35% 1: 35% (request) != 0: 36% 1: 36%
 ( 1.815| 0.000) D: [pulseaudio] alsa-sink.
Comment 9 Yan Pas 2016-02-10 14:18:35 UTC
Created attachment 121649 [details]
alsainfo

That's my alsainfo.sh output.
BTW, the log, which was uploaded before was made under these circumstances: I've changed volume from about 25 to 40 per cents. I didn't understand what am I exactly to do, particalrly which interpreter to use for the script you wrote in comment 2
Comment 10 Raymond 2016-02-10 15:21:18 UTC
dB per step = (28.37-0.06)/38 = 0.745 dB per step

 min dB -28.37,  -27.625 , -26.88
Comment 11 Raymond 2016-02-11 02:07:18 UTC
(In reply to Yan Pashkovsky from comment #6)
> 1)I've searched over the internet and have found the same issue as mine (35%
> too), but with another usb audio card :
> https://chrisjean.com/fix-for-usb-audio-is-too-loud-and-mutes-at-low-volume-
> in-ubuntu/
> Some notes from this guide helped me: I 've changed "volume = merge" to
> "volume = ignore" in
> /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common
> 
> Situation now is much much better: headset behave as they should be (the
> same like in digital mode), but the maximum volume is not loud enough imho
> (120-130% would be fine). Setting volume over 100% causes overdrive (headset
> may play louder without overdrives according to my past expirience). 
> 
> Maybe making such config default is good idea? (replace  merge with ignore)


> 
687| 0.000) I: [pulseaudio] alsa-sink.c: Hardware volume ranges from -179,00 dB to 0,00 dB.
 ( 1.687| 0.000) I: [pulseaudio] alsa-sink.c: Fixing base volume to 0,00 dB
 ( 1.687| 0.000) I: [pulseaudio] alsa-sink.c: Using hardware volume control. Hardware dB scale supported. 
( 1.687| 0.000) I: [pulseaudio] alsa-sink.c: Using hardware mute control. 
( 1.687| 0.000) D: [pulseaudio] alsa-util.c: snd_pcm_dump(): 
( 1.687| 0.000) D: [pulseaudio] alsa-util.c: Soft volume PCM 
( 1.687| 0.000) D: [pulseaudio] alsa-util.c: Control: PCM Playback Volume 
( 1.687| 0.000) D: [pulseaudio] alsa-util.c: min_dB: -51
 ( 1.687| 0.000) D: [pulseaudio] alsa-util.c: max_dB: 0 
( 1.687| 0.000) D: [pulseaudio] alsa-util.c: resolution: 256


Pulseaudio seem ignore softvol plugin PCM as realtek alc892 dB range is obly 9x
Comment 12 Raymond 2016-02-11 03:28:06 UTC
state.IntelHDA { control.1 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 64' comment.dbmin -6400 comment.dbmax 0 iface MIXER name 'Front Playback Volume' value.0 64 value.1 64 }

Alc892 only have 64 steps and each step is 1dB 

How do pulseaudio calculate -179dB?
Comment 13 Raymond 2016-02-11 03:37:43 UTC
Front + virtual Master + PCM softvol = -64 -64 -51 = -179

do the volume range correct?
Comment 14 Raymond 2016-02-11 14:00:40 UTC
1.815| 0.000) D: [pulseaudio] alsa-sink.c: in dB: 0: -27,14 dB 1: -27,14 dB ( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: Got hardware volume: 0: 36% 1: 36% ( 1.815| 0.000) D: [pulseaudio] alsa-sink.c: in dB: 0: -26,82 dB 1: -26,82 dB ( 1



There is no hardware volume at -26.82 dB
Comment 15 Raymond 2016-02-12 16:16:10 UTC
why pulseaudio adjust dB by -0.06



-26.88 = -26.82 - 0.06
Comment 16 GitLab Migration User 2018-07-30 10:28:25 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/446.


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.