mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
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.
This commit is contained in:
@@ -380,9 +380,17 @@ void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int
|
|||||||
lt_debug("%s\n", __FUNCTION__);
|
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)
|
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)
|
void cAudio::ScheduleMute(bool On)
|
||||||
@@ -399,9 +407,7 @@ void cAudio::EnableAnalogOut(bool enable)
|
|||||||
#define AUDIO_BYPASS_OFF 1
|
#define AUDIO_BYPASS_OFF 1
|
||||||
void cAudio::setBypassMode(bool disable)
|
void cAudio::setBypassMode(bool disable)
|
||||||
{
|
{
|
||||||
lt_debug("%s %d\n", __FUNCTION__, disable);
|
const char *opt[] = { "passthrough", "downmix" };
|
||||||
int mode = disable ? AUDIO_BYPASS_OFF : AUDIO_BYPASS_ON;
|
lt_debug("%s %d\n", __func__, disable);
|
||||||
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
|
proc_put("/proc/stb/audio/ac3", opt[disable], strlen(opt[disable]));
|
||||||
lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
@@ -86,8 +86,8 @@ class cAudio
|
|||||||
int StopClip();
|
int StopClip();
|
||||||
void getAudioInfo(int &type, int &layer, int& freq, int &bitrate, int &mode);
|
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);
|
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
|
||||||
bool IsHdmiDDSupported() { return false; };
|
bool IsHdmiDDSupported() { return true; };
|
||||||
void SetHdmiDD(bool) { return; };
|
void SetHdmiDD(bool enable);
|
||||||
void SetSpdifDD(bool enable);
|
void SetSpdifDD(bool enable);
|
||||||
void ScheduleMute(bool On);
|
void ScheduleMute(bool On);
|
||||||
void EnableAnalogOut(bool enable);
|
void EnableAnalogOut(bool enable);
|
||||||
|
Reference in New Issue
Block a user