Springen naar inhoud


Dreambox_user

Lid geworden: 19 jan 2012
Offline Laatste activiteit: 18 jul 2012 21:02
-----

Onderwerpen die ik ben begonnen

Device Volume control by Alsa Mixer (Dreambox DM8000)

27 maart 2012 - 13:55

I'm trying to write an application in C++ (seperate application from Enigma2) which will be able to increase/decrease the volume of the system.
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

Reading info on InfoBar

1 februari 2012 - 00:35

Hey

I would like to read infos (channel number, name of channel, what is playing now, time) actually displayed on Info Bar. Where can I grab it?

Thanks in advance!

How to read teletext?

19 januari 2012 - 15:05

Hello,
I'd like to read all text which is available on a single page on Teletext and save it to a text file.
Can anybody tell me how to do it?

Many thanks for any advice on this matter!