Py3status: volume_status broken with pulseaudio?

Created on 14 May 2018  Â·  9Comments  Â·  Source: ultrabug/py3status

It seems like the volume_status module is broken with pulseaudio.

This is my config:

volume_status master {
     format = "  {percentage}"
     format_muted = "   {percentage}"
     thresholds = []
     device = "default"
     mixer = "Master"
     mixer_idx = 0
}

Now, this is what happens:

$ pactl set-sink-volume 1 0%
$ pactl list sinks | grep '^[[:space:]]Volume:'
        Volume: front-left: 19660 /  30% / -31,37 dB,   front-right: 19660 /  30% / -31,37 dB
        Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB

This works fine, it displays 0 in the status bar and no sound is playing

$ pactl set-sink-volume 1 +5%
$ pactl list sinks | grep '^[[:space:]]Volume:'
        Volume: front-left: 19660 /  30% / -31,37 dB,   front-right: 19660 /  30% / -31,37 dB
        Volume: front-left: 3276 /   5% / -78,07 dB,   front-right: 3276 /   5% / -78,07 dB

But the status bar still displays 0.

Turning the volume up to 30% gives 55 in the status bar.

ALSA (which I'm pretty sure the module is pulling the data from) also displays the correct volume:

$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 19655 [30%] [on]
  Front Right: Playback 19655 [30%] [on]

My versions:

$ py3status --version
py3status version 3.8 (python 3.5.5)
$ pulseaudio --version
pulseaudio 11.1
$ uname -a
Linux localhost 4.15.18 #1 SMP Thu Apr 26 15:05:04 CEST 2018 x86_64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux
$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k4.15.18.

Most helpful comment

Hey, that did the trick! I was running a version from April 2nd (Gentoo Repositories). Manually patched it and everything's back to normal now.

Thanks for your help!

All 9 comments

Try this... Your grepped data shows that you have more than 1 Volume:. Do it again without grepping and you should see Sink # numbers too. Specify device with that number in your config as it could be 0, 1, or 55 (random in some card)... and see if it works now.

Side note: You can add {command} to the format too to identify the backend.

For pulseaudio, default device is 0.
For alsa, default device is default.

You tried pulseaudio with device = default in your config above.

EDIT: I'm not sure where mixer and mixer_idx came from. Custom module?

Thanks for the reply, that did seem to help a little bit.

However, the steps are still messed up. Here's the numbers, going +5% at a time:

"Real" volume | py3status volume
------------ | -------------
0 | 0
5 | 0
10 | 9
15 | 27
20 | 38
25 | 47
30 | 55
35 | 61
40 | 66
45 | 70
50 | 75
55 | 78
60 | 83
65 | 86
70 | 89
75 | 91
80 | 94
85 | 97
90 | 98
95 | 100
100 | 100

This is what I'm using to increase the volume btw:

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && killall -USR1 py3status

1337 was merged a month ago. See if you're using the latest module volume_status.py.

EDIT: Also, you can use py3-cmd refresh volume_status instead of killall -USR1 py3status.

Hey, that did the trick! I was running a version from April 2nd (Gentoo Repositories). Manually patched it and everything's back to normal now.

Thanks for your help!

Thanks @lasers

@chrboe tho, I'm curious since I'm also obviously maintaining the Gentoo package which is py3status-3.8 so what did you manually patch please?

Oh I just put the patch from the PR into /etc/portage/patches/x11-misc/py3status/ and rebuilt.

It would be awesome if you could release a new version though, since I think this bug affects some more people. Or even a -9999 ebuild for the latest git version?

You're right @chrboe I've just released 3.9 ! :+1:

Wow, that was quick. Thanks!

Was this page helpful?
0 / 5 - 0 ratings