0

In the documentation for snd_mixer_open, the description for the second parameter int mode is: "open mode". But I can't find any further information about which symbolic values to use in the same module. After some searching, I found that in the snd_ctl/control module, there are symbolic values like SND_CTL_NONBLOCK and SND_CTL_ASYNC, and also SND_CTL_READONLY. But I have still no indication which ones are ok to use in the snd_mixer_open function! And as these are prefixed with 'SND_CTL' I have the impression they are only meant for functions of the snd_ctl module.

(What I'm generally trying to achieve, is to be able to read the volume level of the master channel of the default sound card.)

Ploppz
  • 154
  • 2
  • 13
  • there is other function prototype https://developer.blackberry.com/playbook/native/reference/com.qnx.doc.neutrino.audio/topic/libs/snd_mixer_open.html – EsmaeelE Aug 16 '17 at 14:35
  • https://stackoverflow.com/questions/21483929/set-mixer-as-default-alsa-api – EsmaeelE Aug 16 '17 at 14:36

1 Answers1

1

From the source in alsa-lib/src/mixer.c:68 the "mode" argument is flagged as unused:

int snd_mixer_open(snd_mixer_t **mixerp, int mode ATTRIBUTE_UNUSED)

and the source of the function bears that out. So it looks like it's safe to use any int there (I'd personally just go with 0).

Simon Aldrich
  • 80
  • 1
  • 7