i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Mouse wheel volume control broke on sound block.

Open harryNID opened this issue 6 years ago • 9 comments

Manjaro Linux i3status-rust-git Driver: Alsa

[[block]] block = "sound" driver = "alsa" step_width = 3

For some reason the mouse wheel volume controls do not work anymore. This is a recent occurrence. When I try to scroll on the block the volume adjusts erratically until it finally ends up at "0". I have to go into alsamixer to correct.

I do not know if ; added mapped-volume option for correct volume #508 (*Note: I do not think this is it as it was working and sound was sinking better than before this commit.) or Unify use of spawn_child_async in click handlers could be the culprit

harryNID avatar Apr 26 '20 11:04 harryNID

added mapped-volume option for correct volume #508

This seems like the likely culprit. I think the -M flag needs to be added to the set command too, like here: https://github.com/vivien/i3blocks/pull/254/files

ammgws avatar Apr 27 '20 09:04 ammgws

Could you please see if #617 solves this?

Otherwise it may be a while until I can find some time to reproduce and check myself.

ammgws avatar Apr 27 '20 09:04 ammgws

Ok, thanks for looking into this :) Good news and Bad news!

The Good news is that the fix works, somewhat!

The Bad news is that for some reason if I am at 86% to 100% everything works as it should (volume goes up and down). If I am from 0% to 85% that also works (volume also goes up and down) but here is the weird thing if I am above 85% and drop below that it locks below 85% permanently and I can go no higher again unless I manually nudge it past 85% in alsamixer. Your fix is definitely better than it was. It is manageable now.

I might be hesitant to roll out this solution unless others are experiencing this as it's not a 100% fix but it is better than before. It's entirely up to you.

If you get a chance to look into this it would be appreciated. If you need any info to help reproduce this such as my full config or more detailed info of my install then let me know and I would be happy to help.

Thanks

harryNID avatar Apr 27 '20 23:04 harryNID

Does removing the -M flag all together (revert #508) fix the problem?

ammgws avatar Apr 27 '20 23:04 ammgws

Sorry for not getting back sooner!

To answer your question, it does but we are back to the original reason you used the -M flag in the first place. Volume does increase/decrease throughout the range but it is reported differently than what alsamixer reports. Your previous solution, of adding -M to both methods, is the closest to what is desired but it has that sticking point at 85%.

I noticed in alsamixer that 85% is when it start going into the red. I use a HDA-Intel builtin soundcard. One would assume that amixer in -M mode is scaling the response in some way as 85% in -M mode

amixer reports: Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 87 Mono: Playback 82 [85%] [-3.75dB] [on]

and at 100% (-M mode again) it reports Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 87 Mono: Playback 87 [100%] [0.00dB] [on]

I don't know if this info helps but I will keep trying to help if you have any further ideas of what is causing this.

Thank You!

harryNID avatar Apr 29 '20 01:04 harryNID

OK I tried the alsa driver and I can't reproduce :( But then again amixer shows me the same volume regardless of whether or not I use the -M flag, so not sure what's going on there.

Does the value shown in the bar get above 85% if you increase the volume manually using alsamixer etc?

ammgws avatar Apr 29 '20 01:04 ammgws

Also turns out the volume block in i3blocks isn't actually using the -M option yet (unmerged): https://github.com/vivien/i3blocks-contrib/pull/264/files

Might be a good idea to make using -M configurable like in that PR.

ammgws avatar Apr 29 '20 01:04 ammgws

@harryNID Could you please try #622? The -M flag is now off by default, so it should solve your issue. The issue with your volume display getting stuck when using the -M flag probably isn't solved though. I can't reproduce that one.

ammgws avatar Apr 29 '20 14:04 ammgws

I narrowed down what was causing this issue for me if you are interested. This is with "-M" enabled.

As noted above I had "step_width = 3" in my config. If I either remove that option (thereby using the default) or set it to a number above "3" then everything works fine. If I set it to "3" it stops at 85%. If I set it to "2" it stops at 75% and If I set it to "1" it will only lower the volume down to 0 but you can't raise volume at all.

It seems like step width is scaling somehow as well.

Hope this helps!!

harryNID avatar May 01 '20 22:05 harryNID