0

I'm developing my first sound card driver in Ubuntu with ALSA. Implementing a volume control for the sound card I stumbled upon a few questions.

1) For the function that is assigned to snd_kcontrol_new.info, I'm trying to understand the logic behind choosing the values of snd_ctl_elem_info.value.integer.min and max. my sound card can go between -100db and 0db, how do I decide if I map it to 0-100 in the snd_ctl_elem_info.value.integer.min/max or 0-15, or any other range?

2) I'm struggling to understand the difference between the control names PCM Playback Volume, Master Playback Volume, and Playback Volume.

Thanks for the answers, and apologies if the questions are very trivial, but I couldn't find a good explanation to them.

1
  1. The control values typically are just the hardware's register values.

    The mapping between control values and dB values is done with TLV metadata.

  2. "PCM" applies to the sound played through the PCM device, while "Master" applies to all sounds played.

  • Hi CL. thank you for the reply. I would appreciate some clarification about 1. What do you mean by HW register values? I'm controlling the volume by sending SPI commands to the sound card, and the protocol is specific to that card. So I'm not sure which registers you are talking about. About 2. The card is giving me only PCM data, so it's the only sound I'm getting, and the format is PCM, so in this case would Master and PCM be equivalent? Thanks – Michael P Oct 28 '15 at 22:51
  • 1. The values sent over SPI end up in some register, don't they? 2. If in doubt, use "Master". – CL. Oct 29 '15 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.