[pulseaudio-discuss] Alsamixertest

Colin Guthrie gmane at colin.guthr.ie
Thu Sep 30 07:33:21 PDT 2010


OK, here are some more test results,

This time rather than using "plughw:" for the output, I modified your
script to use "plug:front:" instead.

In this mode, PCM works as expected:


INFO:root:Running initial test signal.
INFO:root:Testing that Master actually mutes the signal
INFO:root:Running test for mixer Master, level -3.00dB
INFO:root:Running test for mixer Master, level -4.50dB
INFO:root:Running test for mixer Master, level -6.00dB
INFO:root:Running test for mixer Master, level -9.00dB
INFO:root:Running test for mixer Master, level -10.50dB
INFO:root:Running test for mixer Master, level -12.00dB
INFO:root:Running test for mixer Master, level -15.00dB
INFO:root:Running test for mixer Master, level -16.50dB
INFO:root:Running test for mixer Master, level -18.00dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-18.0,
expected -21.12dB but measured -19.98dB.
INFO:root:Running test for mixer Master, level -21.00dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-21.0,
expected -24.12dB but measured -22.78dB.
INFO:root:Running test for mixer Master, level -22.50dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-22.5,
expected -25.62dB but measured -24.14dB.
INFO:root:Running test for mixer Master, level -24.00dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-24.0,
expected -27.12dB but measured -25.46dB.
INFO:root:Running test for mixer Master, level -27.00dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-27.0,
expected -30.12dB but measured -28.06dB.
INFO:root:Running test for mixer Master, level -28.50dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-28.5,
expected -31.62dB but measured -29.30dB.
INFO:root:Running test for mixer Master, level -30.00dB
ERROR:root:Error 6: Mixer Master has invalid dB data for dB=-30.0,
expected -33.12dB but measured -30.71dB.
INFO:root:Running test for mixer PCM, level -2.00dB
INFO:root:Running test for mixer PCM, level -4.00dB
INFO:root:Running test for mixer PCM, level -6.00dB
INFO:root:Running test for mixer PCM, level -8.00dB
INFO:root:Running test for mixer PCM, level -10.00dB
INFO:root:Running test for mixer PCM, level -12.00dB
INFO:root:Running test for mixer PCM, level -14.00dB
INFO:root:Running test for mixer PCM, level -16.00dB
INFO:root:Running test for mixer PCM, level -18.00dB
INFO:root:Running test for mixer PCM, level -20.00dB
INFO:root:Running test for mixer PCM, level -22.00dB
INFO:root:Running test for mixer PCM, level -24.00dB
INFO:root:Running test for mixer PCM, level -26.00dB
INFO:root:Running test for mixer PCM, level -28.00dB
INFO:root:Running test for mixer PCM, level -30.00dB
INFO:root:Running test for mixer PCM, level -32.00dB
INFO:root:Running test for mixer PCM, level -34.00dB
INFO:root:Running test for mixer PCM, level -36.00dB
INFO:root:Running test for mixer PCM, level -38.00dB
INFO:root:Running test for mixer PCM, level -40.00dB
INFO:root:Running test for mixer PCM, level -42.00dB
INFO:root:Running test for mixer PCM, level -44.00dB
INFO:root:Running test for mixer PCM, level -46.00dB
INFO:root:Running test for mixer PCM, level -48.00dB
INFO:root:Running test for mixer PCM, level -50.00dB
INFO:root:Running test for mixer PCM, level -51.00dB
ERROR:root:Error 5: Mixer PCM mutes the signal.



^CTraceback (most recent call last):
  File "/usr/bin/alsamixertest", line 269, in <module>
    main()
  File "/usr/bin/alsamixertest", line 259, in main
    runtestsuite(devices, selected_path)
  File "/usr/bin/alsamixertest", line 143, in runtestsuite
    c.set_dB(cur_dB)
  File "/usr/share/alsamixertest/mixercontrol.py", line 73, in set_dB
    self.do_set(s)
  File "/usr/share/alsamixertest/mixercontrol.py", line 62, in do_set
    self.name) + args)
  File "/usr/share/alsamixertest/utils.py", line 14, in run_subprocess
    stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
  File "/usr/lib64/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1130, in _execute_child
    data = _eintr_retry_call(os.read, errpipe_read, 1048576)
  File "/usr/lib64/python2.6/subprocess.py", line 455, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt



It seemed to hang at the end, hence the control+C

So as Clements said on the Alsa-devel list, plughw: means that PCM will
be ineffective. In pulse, we *do* open the front: device which means
(for me at least) in PA, the PCM control *is* working.

I confirmed this by doing a quick test, playing a long sound in paplay
and adjusting the PCM directly via an alsa mixer. It worked. After about
400->1ms of delay it did actually adjust the output I heard. I guess
changing the mixer via alsa directly does not trigger a rewind+buffer
rewrite, hence the latency of the change.


So, the fact that my sound is muted at 16%, I believe is down to the
fact that my Master channel is set to 0% which must kick in some kind of
mute. If I manually play something where the master is at -45dB (or 3%)
I can hear it fine, and if I adjust PCM then it does indeed get quieter
still (with the latency of update due to lack of rewind above).

So my bug (the 16% cut off) is not infact due to softvol in this case,
it is very much due to to some kind of 0% master == mute.

I'm not sure whether or not PA should artificially set the it to >0 in
it's pipeline control object or if the -46.5dB/0% Master should *NOT*
mute at the alsa side. IMO the latter is the correct solution.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list