Giter Club home page Giter Club logo

Comments (7)

kb100 avatar kb100 commented on June 2, 2024 1

I see... well the commit that is causing this issue for you was put in place to solve a similar issue for someone else (myself included) because either pulse people or alsa people switched conventions at some unknown version. Honestly, we don't know of an automatic way to tell what the correct $MIXER and $SCONTROL values are because it apparently depends on a huge number of variables, including version of pulse, version of alsa, and even what distro you are using. :(

For now, see the new commit and use the -m and -s options.

from i3blocks-contrib.

kb100 avatar kb100 commented on June 2, 2024

Interesting behavior... could post the output of the blocklet when you run it from the command line please?

#regular
./volume-pulseaudio

#scroll up and down
BLOCK_BUTTON=4 ./volume-pulseaudio
BLOCK_BUTTON=5 ./volume-pulseaudio

#toggle mute twice
BLOCK_BUTTON=2 ./volume-pulseaudio
BLOCK_BUTTON=2 ./volume-pulseaudio

Hopefully there are some helpful errors.

from i3blocks-contrib.

kb100 avatar kb100 commented on June 2, 2024

As a side note, if the issue is what I think it is (script wrongly things your mixer is "default" instead of "pulse"), you can temporarily fix this by editing the script and hard coding

MIXER=pulse
SCONTROL=Master
CAPABILITY=""

from i3blocks-contrib.

dikiaap avatar dikiaap commented on June 2, 2024

Here's the output:

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ ./volume-pulseaudio

  29% [0:analog-stereo]
  29% [0]
#ffffff

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ BLOCK_BUTTON=4 ./volume-pulseaudio
  33% [0:analog-stereo]
  33% [0]
#ffffff

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ BLOCK_BUTTON=5 ./volume-pulseaudio
  29% [0:analog-stereo]
  29% [0]
#ffffff

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ BLOCK_BUTTON=2 ./volume-pulseaudio
  29% [0:analog-stereo]
  29% [0]
#a0a0a0

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ BLOCK_BUTTON=2 ./volume-pulseaudio
  29% [0:analog-stereo]
  29% [0]
#a0a0a0

from i3blocks-contrib.

kb100 avatar kb100 commented on June 2, 2024

Could you investigate the behavior of

amixer -D $MIXER sset $SCONTROL 5%+ 

and

amixer -D $MIXER sset $SCONTROL toggle 

on your computer, trying different values for $MIXER and $SCONTROL? $MIXER is usually default or pulse, and $SCONTROL is usually Master, pulse, or Pulse.

from i3blocks-contrib.

dikiaap avatar dikiaap commented on June 2, 2024

From your previous comment. Yeah, that's what I thought. That works if I edit the script like that. I just do not want to get into merge conflict if there is a new commit.

No, I didn't set the environment variable of $MIXER.

Also this is my amixer info:

$ amixer info
Card default 'SB'/'HDA ATI SB at 0x90440000 irq 16'
  Mixer name	: 'Realtek ALC270'

If you mean something like this:

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D default sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 66 [76%] [-15.75dB] [on]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D default sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 66 [76%] [-15.75dB] [off]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D default sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 66 [76%] [-15.75dB] [on]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D pulse sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 35808 [55%] [on]
  Front Right: Playback 35808 [55%] [on]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D pulse sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 35808 [55%] [off]
  Front Right: Playback 35808 [55%] [off]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D pulse sset Master toggle 
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 35808 [55%] [on]
  Front Right: Playback 35808 [55%] [on]

The output in workspace bar is 55%, but in default is 76%

from i3blocks-contrib.

dikiaap avatar dikiaap commented on June 2, 2024

So what I think after test both devices is when I scroll volume, I incresase both volumes of the device.

i3 config:

bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q -D pulse sset Master 5%- unmute
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q -D pulse sset Master 5%+ unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q -D pulse sset Master toggle

i3blocks config:

[volume-pulseaudio]
command=~/.local/bin/i3blocks/volume-pulseaudio/volume-pulseaudio
interval=1
signal=10

This is before toggle mode, the output volume in a bar is 73% and volume is active:

$ amixer -D default sget Master      
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 76 [87%] [-8.25dB] [on]

$ amixer -D pulse sget Master        
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 47751 [73%] [on]
  Front Right: Playback 47751 [73%] [on]

Then when I do a toggle mode with scroll's click, it just mute "pulse" and "default" volume:

$ amixer -D default sget Master
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 76 [87%] [-8.25dB] [off]

$ amixer -D pulse sget Master  
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 47751 [73%] [off]
  Front Right: Playback 47751 [73%] [off]

When I turned it back by clicking on the scroll again, nothing happened, and the bar still muted. But it is active again in "default" device:

$ amixer -D default sget Master
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 76 [87%] [-8.25dB] [on]

~/.local/bin/i3blocks/volume-pulseaudio on  master 
 $ amixer -D pulse sget Master  
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 47751 [73%] [off]
  Front Right: Playback 47751 [73%] [off]

from i3blocks-contrib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.