- Set vol or pcm, but not both. Changing both channels makes volume feedback non-linear.
- Set / read monitor channel.
Details
- Reviewers
christos - Group Reviewers
desktop multimedia
Diff Detail
- Repository
- R11 FreeBSD ports repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| audio/pulseaudio/files/patch-src_modules_oss_module-oss.c | ||
|---|---|---|
| 104 | That doesn't seem right. If we have both SOUND_MASK_VOLUME and SOUND_MASK_PCM requests, we should handle both. What's the root problem this patch tries to solve? | |
| audio/pulseaudio/files/patch-src_modules_oss_module-oss.c | ||
|---|---|---|
| 104 | Pulseaudio does not allow to change pcm and vol for oss mixer independently. When changing volume in plasma-pa applet or using pactl set-sink-volume it set both vol and pcm channels to the same value. As a result real sound volume drops dramatically when you move volume slider away from 100%. Usually you want to keep pcm constant and change real volume via vol channel. KMix worked this way before we switched to Plasma-pa by default. | |
For the context: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/modules/oss/module-oss.c?ref_type=heads&plain=1#L840
static void sink_set_volume(pa_sink *s) {
struct userdata *u;
pa_assert_se(u = s->userdata);
pa_assert(u->mixer_devmask & (SOUND_MASK_VOLUME|SOUND_MASK_PCM));
if (u->mixer_devmask & SOUND_MASK_VOLUME)
(void) pa_oss_set_volume(u->mixer_fd, SOUND_MIXER_WRITE_VOLUME, &s->sample_spec, &s->real_volume);
if (u->mixer_devmask & SOUND_MASK_PCM)
(void) pa_oss_set_volume(u->mixer_fd, SOUND_MIXER_WRITE_PCM, &s->sample_spec, &s->real_volume);
}| audio/pulseaudio/files/patch-src_modules_oss_module-oss.c | ||
|---|---|---|
| 104 | Are you sure it is really a PulseAudio API problem? I do see the problem - if I move the volume scrollbar in Plasma System settings and then run mixer from the console, both vol and pcm get changed indeed. But it might be Plasma problem, not a PulseAudio one. Do you have a reproducer that does not involve Plasma clients? | |
| audio/pulseaudio/files/patch-src_modules_oss_module-oss.c | ||
|---|---|---|
| 104 | I just reproduced this on cinnamon, which uses the API directly. PulseAudio's own pavucontrol should exhibit the same. | |
| audio/pulseaudio/files/patch-src_modules_oss_module-oss.c | ||
|---|---|---|
| 104 |
Sure, you can use pactl utility from pulseaudio package. At least after this patch sink_set_volume behaves consistently with sink_get_volume. I wonder whether we need to read/set pcm at all in these functions. Are there mixers which have pcm channel but not vol? | |
The mixer knobs are a bit confusing since they are part of the legacy OSS API, but typically vol controls the hardware master volume, and pcm the software volume, usually from applications and sound(4) virtual channels.
I think what the patch does is correct, even though I don't use pulseaudio at all.
All right, @makc please give me a couple of days, as I still want to research why PulseAudio ends up being passed both SOUND_MASK_VOLUME and SOUND_MASK_PCM.