Repository navigation
op/mixer_alsa: alsamixer's volume scale; setting mixer control like aplay does it - #1445
Conversation
Keep doing it, as it's very good spam :p |
A little more comments on the changes made."Setting mixer control like aplay does it" means that now you can set Seems like getting/setting volume for left/right channels works fine even if the control is mono, because |
pgaskin
left a comment
There was a problem hiding this comment.
Seems to work fine with ALSA on PipeWire, code looks fine.
|
What is the reason for c710412? I understand the intention to have cleaner internal logic, but this has the potential of breakage, which we should avoid. I don't want people upgrading cmus to have to dig through changelogs to find how to make music work again. |
I'm not sure how to solve this. My problem with silently falling back to 'Master' is that it's done silently, so if you specify an incorrect control name, 'Master' will be assumed but you will never be notified because |
|
Old behavior: I personally like the new behavior more. For example, amixer assumes device name to be 'default' if it's unspecified, but leaving control name unspecified is an error. Right now if I understand correctly assuming control name is needed to try out different defaults: IMO it's better to do what amixer does: @pgaskin, what do you think about the last paragraph? Also why is All this uncertainty made me think if such feature as controlling system volume even belongs in a music player. I think it doesn't. And that is the reason why it's so hard to decide anything |
I do like explicit errors in general, but I don't have a strong opinion about this particular case.
IDK, I don't use ALSA, and this plugin predates me. I found https://unix.stackexchange.com/a/243698 though.
A few thoughts:
|
Most guides about volume in ALSA mention both 'PCM' and 'Master' so there's probably no best guess. I don't have 'PCM' on Intel HDA. Some sound cards may not have 'Master' volume control and ALSA has softvol plugin to emulate it.
ALSA doesn't have per-application volume, every volume control is per-device even if the device is virtual. And there's no per-stream volume (at least I couldn't find anything about it). So I'm going to reintroduce falling back to 'Master' but a little differently: Note about the above paragraph: when For new users who didn't change mixer's config variables it will work by default same as it currently does. For those who have both variables set to valid values it will work too. One thing that is different is that currently you leave |
|
Tidied the history a bit by merging a couple of commits into one and just abandoned trying to change the previous behavior of assuming 'Master' etc. |
pgaskin
left a comment
There was a problem hiding this comment.
Volume stuff looks good, no strong opinion on the mixer selem selection, one nitpick about the commits.
| if (!snd_mixer_selem_has_playback_volume(elem)) { | ||
| d_print("simple control '%s',%i does not have playback volume\n", | ||
| snd_mixer_selem_id_get_name(sid), | ||
| snd_mixer_selem_id_get_index(sid)); | ||
| return NULL; |
There was a problem hiding this comment.
The other difference here compare to the old code (if I'm understanding it correctly) is it won't fall back to the next selem with snd_mixer_selem_has_playback_volume is the chosen one doesn't. I don't personally have a strong opinion on this though, so I guess it's okay.
There was a problem hiding this comment.
Actually it is the original behavior. Previously there was elem = NULL; break;
There was a problem hiding this comment.
You're right, I overlooked that.
| if (!snd_mixer_selem_has_playback_volume(elem)) { | ||
| d_print("simple control '%s',%i does not have playback volume\n", | ||
| snd_mixer_selem_id_get_name(sid), | ||
| snd_mixer_selem_id_get_index(sid)); | ||
| return NULL; |
There was a problem hiding this comment.
You're right, I overlooked that.
https://build.opensuse.org/request/show/1394501 by user mia + anag_factory - Update to 2.13.0 * Set the minimum requested AAudio buffer capacity gh#cmus/cmus#1386 * Check for libavutil pkg-config gh#cmus/cmus#1388 * Add sort by duration gh#cmus/cmus#1440 * Respect scroll_offset setting when resizing window gh#cmus/cmus#1413 * Try to fallback to any plugin upon failure to init output plugin gh#cmus/cmus#1416 * PulseAudio bugfixes and APPLICATION_ID gh#cmus/cmus#1405 * ip/ffmpeg fixes and ffmpeg 8.0 support gh#cmus/cmus#1444 * CUE handling improvements and replaygain/genre support gh#cmus/cmus#1406 * Fix for missing Icecast streaming bitrate display. gh#cmus/cmus#1451 * op/mixer_alsa: alsamixer's volume scale; setting mixer control like aplay does it gh#cmus/cmus#1445 * ip/ffmpeg: fix seeking and
I'm spamming at this point, but this is pretty useful :)
Alsamixer and i3status and aplay (with -M flag) display so-called 'mapped volume' by default (see
man alsamixer"VOLUME MAPPING"), so I added it to alsa mixer plugin.mixer.alsa.mapped_volumeconfig option turns it on. It's enabled by default because Alsamixer and i3status do it, I think its ok.