spark: implement AC3 passthrough on SPDIF and HDMI

Note: untested (no hardware). AC3 on HDMI will only work if
AC3 on SPDIF is also selected.


Origin commit data
------------------
Branch: master
Commit: b9f3ae5372
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-06-08 (Fri, 08 Jun 2012)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-06-08 22:17:30 +02:00
parent c0de97ffcc
commit 5b00e16610
2 changed files with 14 additions and 8 deletions

View File

@@ -380,9 +380,17 @@ void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int
lt_debug("%s\n", __FUNCTION__);
};
void cAudio::SetHdmiDD(bool enable)
{
const char *opt[] = { "pcm", "spdif" };
lt_debug("%s %d\n", __func__, enable);
proc_put("/proc/stb/hdmi/audio_source", opt[enable], strlen(opt[enable]));
}
void cAudio::SetSpdifDD(bool enable)
{
lt_debug("%s %d\n", __FUNCTION__, enable);
lt_debug("%s %d\n", __func__, enable);
setBypassMode(!enable);
};
void cAudio::ScheduleMute(bool On)
@@ -399,9 +407,7 @@ void cAudio::EnableAnalogOut(bool enable)
#define AUDIO_BYPASS_OFF 1
void cAudio::setBypassMode(bool disable)
{
lt_debug("%s %d\n", __FUNCTION__, disable);
int mode = disable ? AUDIO_BYPASS_OFF : AUDIO_BYPASS_ON;
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
return;
const char *opt[] = { "passthrough", "downmix" };
lt_debug("%s %d\n", __func__, disable);
proc_put("/proc/stb/audio/ac3", opt[disable], strlen(opt[disable]));
}

View File

@@ -86,8 +86,8 @@ class cAudio
int StopClip();
void getAudioInfo(int &type, int &layer, int& freq, int &bitrate, int &mode);
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
bool IsHdmiDDSupported() { return false; };
void SetHdmiDD(bool) { return; };
bool IsHdmiDDSupported() { return true; };
void SetHdmiDD(bool enable);
void SetSpdifDD(bool enable);
void ScheduleMute(bool On);
void EnableAnalogOut(bool enable);