[alsa-devel] Fixup set PCM/headphones volume from Master

David Jordan david2 at system76.com
Mon Nov 7 17:59:39 CET 2016


I'm working on a kernel-level fixup for a set of hardware which uses a
separate DAC for the "headphones" output.  So far, I've gotten
everything but the volume control working correctly.  "PCM Playback
Volume" controls the headphones volume since the same digital output
drives both SPDIF and the analog headphones jack.  

So, "PCM Playback Volume" should always equal "Master Playback Volume"
when headphones are plugged in. (You can't insert both an SPDIF and
headphones at the same time anyway, since they use the same jack, so
there's no downside there.)

Here's where I could really use some help from people who know ALSA
plumbing better than I do.  It seems to me this should be possible by
overriding the "Master Playback Volume" put function with one that finds
the "PCM Playback Volume" control and sets the volume for both controls.

For some reason, I can't seem to access the PCM control from my master
put function.  Attempts to find it via snd_ctl_find_id or
snd_ctl_find_numid result in kernel oops.  There might be something
simple I'm missing, or perhaps there is a better way to link the two
volume controls?


-- 
  David Jordan
  david2 at system76.com


More information about the Alsa-devel mailing list