diff options
author | Johns <johns98@gmx.net> | 2011-12-25 15:36:04 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2011-12-25 15:36:04 +0100 |
commit | 7f0ad63209b8bce413e76144a0ff09d992bf0231 (patch) | |
tree | 7ec1c8b861ecc13dde585a0b39f73467d3b52a22 | |
parent | 10ab0274abdf842dc7f34e970c4a95db78290219 (diff) | |
download | vdr-plugin-softhddevice-7f0ad63209b8bce413e76144a0ff09d992bf0231.tar.gz vdr-plugin-softhddevice-7f0ad63209b8bce413e76144a0ff09d992bf0231.tar.bz2 |
Support other than "PCM" alsa mixer channels.
-rw-r--r-- | README.txt | 12 | ||||
-rw-r--r-- | audio.c | 11 |
2 files changed, 21 insertions, 2 deletions
@@ -57,6 +57,18 @@ Install: cd vdr-softhddevice make VDRDIR=<path-to-your-vdr-files> LIBDIR=. +Setup: environment + Following is supported: + + DISPLAY=:0.0 + x11 display name + ALSA_DEVICE=default + alsa PCM device name + ALSA_MIXER=default + alsa control device name + ALSA_MIXER_CHANNEL=PCM + alsa control channel name + Setup: /etc/vdr/setup.conf Following is supported: @@ -60,6 +60,7 @@ static const char *AudioPCMDevice; ///< alsa PCM device name static const char *AudioMixerDevice; ///< alsa mixer device name +static const char *AudioMixerChannel; ///< alsa mixer channel name static volatile char AudioRunning; ///< thread running / stopped static int AudioPaused; ///< audio paused static unsigned AudioSampleRate; ///< audio sample rate in hz @@ -589,6 +590,7 @@ void AudioSetVolume(int volume) static void AlsaInitMixer(void) { const char *device; + const char *channel; snd_mixer_t *alsa_mixer; snd_mixer_elem_t *alsa_mixer_elem; long alsa_mixer_elem_min; @@ -599,13 +601,18 @@ static void AlsaInitMixer(void) device = "default"; } } - Debug(3, "audio/alsa: mixer open\n"); + if (!(channel = AudioMixerChannel)) { + if (!(channel = getenv("ALSA_MIXER_CHANNEL"))) { + channel = "PCM"; + } + } + Debug(3, "audio/alsa: mixer %s - %s open\n", device, channel); snd_mixer_open(&alsa_mixer, 0); if (alsa_mixer && snd_mixer_attach(alsa_mixer, device) >= 0 && snd_mixer_selem_register(alsa_mixer, NULL, NULL) >= 0 && snd_mixer_load(alsa_mixer) >= 0) { - const char *const alsa_mixer_elem_name = "PCM"; + const char *const alsa_mixer_elem_name = channel; alsa_mixer_elem = snd_mixer_first_elem(alsa_mixer); while (alsa_mixer_elem) { |