I have found source in Enigma2 for this in enigma2/lib/dvb/volume.h and enigma2/lib/dvb/volume.cpp and I based my application on this code but I noticed that there is used constant ALSA_VOLUME_MIXER which has been removed from configure.ac and I don't know what mixer name I should use in my code.
I will paste the snippet of my code here:
// card = "default", mixer_name = "Master", mixer_index = 0 int AlsaAudioSink::AlsaMasterVolume(AudioVolumeAction volume_action, const char *card, const char *mixer_name, const int mixer_index, long *volume) { // TODO: Exception/error handling should be improved in this method snd_mixer_t *handle; snd_mixer_elem_t *elem; snd_mixer_selem_id_t *sid; int ret; snd_mixer_selem_id_alloca(&sid); //sets simple-mixer index and name snd_mixer_selem_id_set_index(sid, mixer_index); snd_mixer_selem_id_set_name(sid, mixer_name); if ((snd_mixer_open(&handle, 0)) < 0) { return -1; } if ((snd_mixer_attach(handle, card)) < 0) { snd_mixer_close(handle); return -2; } if ((snd_mixer_selem_register(handle, NULL, NULL)) < 0) { snd_mixer_close(handle); return -3; } ret = snd_mixer_load(handle); if (ret < 0) { snd_mixer_close(handle); return -4; } elem = snd_mixer_find_selem(handle, sid); // THIS FAILS if (!elem) { snd_mixer_close(handle); return -5; } // ... }
Currently, I receive the error on "snd_mixer_find_selem" instruction: "This sound device does not have any controls.".
My another question is: is it possible from Enigma2 to increase/decrease the volume of only Enigma2 (not the system)?
I would appreciate any help on this.
Best regards,
Dreambox_user