32 #include <sys/types.h>
48 #include "hostPersistence.hpp"
49 #include "dsserverlogger.h"
50 #include "dsAudioSettings.h"
52 #include "safec_lib.h"
54 static int m_isInitialized = 0;
55 static int m_isPlatInitialized = 0;
57 static bool m_MS12DAPV2Enabled = 0;
58 static bool m_MS12DEEnabled = 0;
59 static bool m_LEEnabled = 0;
60 static int m_volumeDuckingLevel = 0;
61 static float m_volumeLevel = 0;
62 static int m_MuteStatus =
false;
63 static int m_isDuckingInProgress =
false;
65 static pthread_mutex_t dsLock = PTHREAD_MUTEX_INITIALIZER;
66 int _srv_AudioAuto = 0;
71 #define IARM_BUS_Lock(lock) pthread_mutex_lock(&dsLock)
72 #define IARM_BUS_Unlock(lock) pthread_mutex_unlock(&dsLock)
74 IARM_Result_t _dsAudioPortInit(
void *arg);
75 IARM_Result_t _dsGetAudioPort(
void *arg);
76 IARM_Result_t _dsGetSupportedARCTypes(
void *arg);
77 IARM_Result_t _dsAudioSetSAD(
void *arg);
78 IARM_Result_t _dsAudioEnableARC(
void *arg);
79 IARM_Result_t _dsSetStereoMode(
void *arg);
80 IARM_Result_t _dsSetStereoAuto(
void *arg);
81 IARM_Result_t _dsGetStereoAuto(
void *arg);
82 IARM_Result_t _dsSetAudioMute(
void *arg);
83 IARM_Result_t _dsIsAudioMute(
void *arg);
84 IARM_Result_t _dsAudioPortTerm(
void *arg);
85 IARM_Result_t _dsGetStereoMode(
void *arg);
86 IARM_Result_t _dsGetAudioFormat(
void *arg);
87 IARM_Result_t _dsGetEncoding(
void *arg);
88 IARM_Result_t _dsIsAudioMSDecode(
void *arg);
89 IARM_Result_t _dsIsAudioMS12Decode(
void *arg);
90 IARM_Result_t _dsIsAudioPortEnabled(
void *arg);
93 IARM_Result_t _dsGetEnablePersist(
void *arg);
94 IARM_Result_t _dsSetEnablePersist(
void *arg);
96 IARM_Result_t _dsEnableAudioPort(
void *arg);
97 IARM_Result_t _dsSetAudioDucking(
void *arg);
98 IARM_Result_t _dsGetAudioLevel(
void *arg);
99 IARM_Result_t _dsSetAudioLevel(
void *arg);
100 IARM_Result_t _dsGetAudioGain(
void *arg);
101 IARM_Result_t _dsSetAudioGain(
void *arg);
102 IARM_Result_t _dsEnableLEConfig(
void *arg);
103 IARM_Result_t _dsGetLEConfig(
void *arg);
104 IARM_Result_t _dsSetAudioDelay(
void *arg);
105 IARM_Result_t _dsGetAudioDelay(
void *arg);
106 IARM_Result_t _dsSetAudioDelayOffset(
void *arg);
107 IARM_Result_t _dsGetAudioDelayOffset(
void *arg);
108 IARM_Result_t _dsGetSinkDeviceAtmosCapability(
void *arg);
109 IARM_Result_t _dsSetAudioAtmosOutputMode(
void *arg);
111 IARM_Result_t _dsSetAudioCompression(
void *arg);
112 IARM_Result_t _dsGetAudioCompression(
void *arg);
113 IARM_Result_t _dsSetDialogEnhancement(
void *arg);
114 IARM_Result_t _dsGetDialogEnhancement(
void *arg);
115 IARM_Result_t _dsSetDolbyVolumeMode(
void *arg);
116 IARM_Result_t _dsGetDolbyVolumeMode(
void *arg);
117 IARM_Result_t _dsSetIntelligentEqualizerMode(
void *arg);
118 IARM_Result_t _dsGetIntelligentEqualizerMode(
void *arg);
119 IARM_Result_t _dsSetGraphicEqualizerMode(
void *arg);
120 IARM_Result_t _dsGetGraphicEqualizerMode(
void *arg);
122 IARM_Result_t _dsGetVolumeLeveller(
void *arg);
123 IARM_Result_t _dsSetVolumeLeveller(
void *arg);
124 IARM_Result_t _dsGetBassEnhancer(
void *arg);
125 IARM_Result_t _dsSetBassEnhancer(
void *arg);
126 IARM_Result_t _dsIsSurroundDecoderEnabled(
void *arg);
127 IARM_Result_t _dsEnableSurroundDecoder(
void *arg);
128 IARM_Result_t _dsGetDRCMode(
void *arg);
129 IARM_Result_t _dsSetDRCMode(
void *arg);
130 IARM_Result_t _dsGetSurroundVirtualizer(
void *arg);
131 IARM_Result_t _dsSetSurroundVirtualizer(
void *arg);
132 IARM_Result_t _dsGetMISteering(
void *arg);
133 IARM_Result_t _dsSetMISteering(
void *arg);
134 IARM_Result_t _dsGetMS12AudioProfileList(
void *arg);
135 IARM_Result_t _dsGetMS12AudioProfile(
void *arg);
136 IARM_Result_t _dsSetMS12AudioProfile(
void *arg);
138 IARM_Result_t _dsGetAssociatedAudioMixing(
void *arg);
139 IARM_Result_t _dsSetAssociatedAudioMixing(
void *arg);
140 IARM_Result_t _dsGetFaderControl(
void *arg);
141 IARM_Result_t _dsSetFaderControl(
void *arg);
142 IARM_Result_t _dsGetPrimaryLanguage(
void *arg);
143 IARM_Result_t _dsSetPrimaryLanguage(
void *arg);
144 IARM_Result_t _dsGetSecondaryLanguage(
void *arg);
145 IARM_Result_t _dsSetSecondaryLanguage(
void *arg);
147 IARM_Result_t _dsGetAudioCapabilities(
void *arg);
148 IARM_Result_t _dsGetMS12Capabilities(
void *arg);
149 IARM_Result_t _dsAudioOutIsConnected(
void *arg);
150 IARM_Result_t _dsResetBassEnhancer(
void *arg);
151 IARM_Result_t _dsResetSurroundVirtualizer(
void *arg);
152 IARM_Result_t _dsResetVolumeLeveller(
void *arg);
153 IARM_Result_t _dsResetDialogEnhancement(
void *arg);
154 IARM_Result_t _dsSetMS12SetttingsOverride(
void *arg);
155 IARM_Result_t _dsGetHDMIARCPortId(
void *arg);
157 static void _GetAudioModeFromPersistent(
void *arg);
159 void _dsAudioOutPortConnectCB(
dsAudioPortType_t portType,
unsigned int uiPortNo,
bool isPortConnected);
160 static dsError_t _dsAudioOutRegisterConnectCB (dsAudioOutPortConnectCB_t cbFun);
163 static std::string _dsGetCurrentProfileProperty(std::string property);
164 static void _dsMS12ProfileSettingOverride(intptr_t handle);
165 static std::string _dsGenerateProfileProperty(std::string profile,std::string property);
166 static bool _dsMs12ProfileSupported(intptr_t handle,std::string profile);
167 static IARM_Result_t _resetDialogEnhancerLevel(intptr_t handle);
168 static IARM_Result_t _resetBassEnhancer(intptr_t handle);
169 static IARM_Result_t _resetVolumeLeveller(intptr_t handle);
170 static IARM_Result_t _resetSurroundVirtualizer(intptr_t handle);
171 static IARM_Result_t _setDialogEnhancement(intptr_t handle,
int enhancerLevel);
172 static IARM_Result_t _setBassEnhancer(intptr_t handle ,
int boost);
173 static IARM_Result_t _setVolumeLeveller(intptr_t handle,
int volLevellerMode,
int volLevellerLevel);
174 static IARM_Result_t _setSurroundVirtualizer(intptr_t handle ,
int virtualizerMode ,
int virtualizerBoost);
176 void AudioConfigInit()
178 typedef dsError_t (*dsEnableLEConfig_t)(intptr_t handle,
const bool enable);
181 static dsEnableLEConfig_t func = NULL;
184 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
186 func = (dsEnableLEConfig_t) dlsym(dllib,
"dsEnableLEConfig");
188 __TIMESTAMP();printf(
"dsEnableLEConfig(int, bool) is defined and loaded\r\n");
189 std::string _LEEnable(
"FALSE");
196 #ifndef DS_LE_DEFAULT_DISABLED
199 __TIMESTAMP();printf(
"LE : Persisting default LE status: %s \r\n",_LEEnable.c_str());
202 if(_LEEnable ==
"TRUE")
205 func(handle,m_LEEnabled);
210 func(handle,m_LEEnabled);
214 __TIMESTAMP();printf(
"dsEnableLEConfig(int, bool) is not defined\r\n");
219 __TIMESTAMP();printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
224 __TIMESTAMP();printf(
"dsEnableLEConfig(int, bool) is failed. since dsAUDIOPORT_TYPE_HDMI 0 port not available\r\n");
227 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
228 typedef dsError_t (*dsSetAudioGain_t)(intptr_t handle,
float gain);
229 static dsSetAudioGain_t dsSetAudioGainFunc = 0;
230 if (dsSetAudioGainFunc == 0) {
231 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
233 dsSetAudioGainFunc = (dsSetAudioGain_t) dlsym(dllib,
"dsSetAudioGain");
234 if (dsSetAudioGainFunc) {
235 printf(
"dsSetAudioGain_t(int, float ) is defined and loaded\r\n");
236 std::string _AudioGain(
"0");
237 float m_audioGain = 0;
246 printf(
"SPEAKER0.audio.Gain not found in persistence store. Try system default\n");
253 m_audioGain = atof(_AudioGain.c_str());
254 if (dsSetAudioGainFunc(handle, m_audioGain) ==
dsERR_NONE) {
255 printf(
"Port %s: Initialized audio gain : %f\n",
"SPEAKER0", m_audioGain);
266 printf(
"HDMI0.audio.Gain not found in persistence store. Try system default\n");
273 m_audioGain = atof(_AudioGain.c_str());
274 if (dsSetAudioGainFunc(handle, m_audioGain) ==
dsERR_NONE) {
275 printf(
"Port %s: Initialized audio gain : %f\n",
"HDMI0", m_audioGain);
281 printf(
"dsSetAudioGain_t(int, float ) is not defined\r\n");
286 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
291 typedef dsError_t (*dsSetAudioLevel_t)(intptr_t handle,
float level);
292 static dsSetAudioLevel_t dsSetAudioLevelFunc = 0;
293 if (dsSetAudioLevelFunc == 0) {
294 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
296 dsSetAudioLevelFunc = (dsSetAudioLevel_t) dlsym(dllib,
"dsSetAudioLevel");
297 if (dsSetAudioGainFunc) {
298 printf(
"dsSetAudioLevel_t(int, float ) is defined and loaded\r\n");
299 std::string _AudioLevel(
"0");
300 float m_audioLevel = 0;
309 printf(
"SPEAKER0.audio.Level not found in persistence store. Try system default\n");
316 m_audioLevel = atof(_AudioLevel.c_str());
317 if (dsSetAudioLevelFunc(handle, m_audioLevel) ==
dsERR_NONE) {
318 m_volumeLevel = m_audioLevel;
319 printf(
"Port %s: Initialized audio level : %f\n",
"SPEAKER0", m_audioLevel);
330 printf(
"HEADPHONE0.audio.Level not found in persistence store. Try system default\n");
337 m_audioLevel = atof(_AudioLevel.c_str());
338 if (dsSetAudioLevelFunc(handle, m_audioLevel) ==
dsERR_NONE) {
339 printf(
"Port %s: Initialized audio level : %f\n",
"HEADPHONE0", m_audioLevel);
350 printf(
"HDMI0.audio.Level not found in persistence store. Try system default\n");
357 m_audioLevel = atof(_AudioLevel.c_str());
358 if (dsSetAudioLevelFunc(handle, m_audioLevel) ==
dsERR_NONE) {
359 printf(
"Port %s: Initialized audio level : %f\n",
"HDMI0", m_audioLevel);
360 m_volumeLevel = m_audioLevel;
365 printf(
"dsSetAudioLevel_t(int, float ) is not defined\r\n");
370 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
375 typedef dsError_t (*dsSetAudioDelay_t)(intptr_t handle, uint32_t audioDelayMs);
376 static dsSetAudioDelay_t dsSetAudioDelayFunc = 0;
377 if (dsSetAudioDelayFunc == 0) {
378 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
380 dsSetAudioDelayFunc = (dsSetAudioDelay_t) dlsym(dllib,
"dsSetAudioDelay");
381 if (dsSetAudioDelayFunc) {
382 printf(
"dsSetAudioDelay_t(int, uint32_t) is defined and loaded\r\n");
383 std::string _AudioDelay(
"0");
384 int m_audioDelay = 0;
393 printf(
"SPEAKER0.audio.Delay not found in persistence store. Try system default\n");
400 m_audioDelay = atoi(_AudioDelay.c_str());
401 if (dsSetAudioDelayFunc(handle, m_audioDelay) ==
dsERR_NONE) {
402 printf(
"Port %s: Initialized audio delay : %d\n",
"SPEAKER0", m_audioDelay);
413 printf(
"HDMI0.audio.Delay not found in persistence store. Try system default\n");
420 m_audioDelay = atoi(_AudioDelay.c_str());
421 if (dsSetAudioDelayFunc(handle, m_audioDelay) ==
dsERR_NONE) {
422 printf(
"Port %s: Initialized audio delay : %d\n",
"HDMI0", m_audioDelay);
433 printf(
"HDMI_ARC0.audio.Delay not found in persistence store. Try system default\n");
440 m_audioDelay = atoi(_AudioDelay.c_str());
441 if (dsSetAudioDelayFunc(handle, m_audioDelay) ==
dsERR_NONE) {
442 printf(
"Port %s: Initialized audio delay : %d\n",
"HDMI_ARC0", m_audioDelay);
449 printf(
"dsSetAudioDelay_t(int, uint32_t) is not defined\r\n");
454 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
459 typedef dsError_t (*dsSetAudioDelayOffset_t)(intptr_t handle, uint32_t audioDelayOffsetMs);
460 static dsSetAudioDelayOffset_t dsSetAudioDelayOffsetFunc = 0;
461 if (dsSetAudioDelayOffsetFunc == 0) {
462 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
464 dsSetAudioDelayOffsetFunc = (dsSetAudioDelayOffset_t) dlsym(dllib,
"dsSetAudioDelayOffset");
465 if (dsSetAudioDelayOffsetFunc) {
466 printf(
"dsSetAudioDelayOffset_t(int, uint32_t) is defined and loaded\r\n");
467 std::string _AudioDelayOffset(
"0");
468 int m_audioDelayOffset = 0;
477 printf(
"SPEAKER0.audio.DelayOffset not found in persistence store. Try system default\n");
481 _AudioDelayOffset =
"0";
484 m_audioDelayOffset = atoi(_AudioDelayOffset.c_str());
485 if (dsSetAudioDelayOffsetFunc(handle, m_audioDelayOffset) ==
dsERR_NONE) {
486 printf(
"Port %s: Initialized audio delay offset : %d\n",
"SPEAKER0", m_audioDelayOffset);
497 printf(
"HDMI0.audio.DelayOffset not found in persistence store. Try system default\n");
501 _AudioDelayOffset =
"0";
504 m_audioDelayOffset = atoi(_AudioDelayOffset.c_str());
505 if (dsSetAudioDelayOffsetFunc(handle, m_audioDelayOffset) ==
dsERR_NONE) {
506 printf(
"Port %s: Initialized audio delay offset : %d\n",
"HDMI0", m_audioDelayOffset);
517 printf(
"HDMI_ARC0.audio.DelayOffset not found in persistence store. Try system default\n");
521 _AudioDelayOffset =
"0";
524 m_audioDelayOffset = atoi(_AudioDelayOffset.c_str());
525 if (dsSetAudioDelayOffsetFunc(handle, m_audioDelayOffset) ==
dsERR_NONE) {
526 printf(
"Port %s: Initialized audio delay offset : %d\n",
"HDMI_ARC0", m_audioDelayOffset);
531 printf(
"dsSetAudioDelayOffset_t(int, uint32_t) is not defined\r\n");
536 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
541 typedef dsError_t (*dsSetPrimaryLanguage_t)(intptr_t handle,
const char* pLang);;
542 static dsSetPrimaryLanguage_t dsSetPrimaryLanguageFunc = 0;
543 if (dsSetPrimaryLanguageFunc == 0) {
544 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
546 dsSetPrimaryLanguageFunc = (dsSetPrimaryLanguage_t) dlsym(dllib,
"dsSetPrimaryLanguage");
547 if (dsSetPrimaryLanguageFunc) {
548 printf(
"dsSetPrimaryLanguage_t(int, char* ) is defined and loaded\r\n");
549 std::string _PrimaryLanguage(
"eng");
556 printf(
"audio.PrimaryLanguage not found in persistence store. Try system default\n");
560 _PrimaryLanguage =
"eng";
563 if (dsSetPrimaryLanguageFunc(handle, _PrimaryLanguage.c_str()) ==
dsERR_NONE) {
564 printf(
"Initialized Primary Language : %s\n", _PrimaryLanguage.c_str());
568 printf(
"dsSetPrimaryLanguage_t(int, char* ) is not defined\r\n");
573 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
578 typedef dsError_t (*dsSetSecondaryLanguage_t)(intptr_t handle,
const char* sLang);;
579 static dsSetSecondaryLanguage_t dsSetSecondaryLanguageFunc = 0;
580 if (dsSetSecondaryLanguageFunc == 0) {
581 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
583 dsSetSecondaryLanguageFunc = (dsSetSecondaryLanguage_t) dlsym(dllib,
"dsSetSecondaryLanguage");
584 if (dsSetSecondaryLanguageFunc) {
585 printf(
"dsSetSecondaryLanguage_t(int, char* ) is defined and loaded\r\n");
586 std::string _SecondaryLanguage(
"eng");
593 printf(
"audio.SecondaryLanguage not found in persistence store. Try system default\n");
597 _SecondaryLanguage =
"eng";
600 if (dsSetSecondaryLanguageFunc(handle, _SecondaryLanguage.c_str()) ==
dsERR_NONE) {
601 printf(
"Initialized Secondary Language : %s\n", _SecondaryLanguage.c_str());
605 printf(
"dsSetSecondaryLanguage_t(int, char* ) is not defined\r\n");
610 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
615 typedef dsError_t (*dsSetFaderControl_t)(intptr_t handle,
int mixerbalance);
616 static dsSetFaderControl_t dsSetFaderControlFunc = 0;
617 if (dsSetFaderControlFunc == 0) {
618 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
620 dsSetFaderControlFunc = (dsSetFaderControl_t) dlsym(dllib,
"dsSetFaderControl");
621 if (dsSetFaderControlFunc) {
622 printf(
"dsSetFaderControl_t(int, int) is defined and loaded\r\n");
623 std::string _FaderControl(
"0");
624 int m_faderControl = 0;
632 printf(
"audio.FaderControl not found in persistence store. Try system default\n");
639 m_faderControl = atoi(_FaderControl.c_str());
640 if (dsSetFaderControlFunc(handle, m_faderControl) ==
dsERR_NONE) {
641 printf(
"Initialized Fader Control, mixing : %d\n", m_faderControl);
646 printf(
"dsSetFaderControl_t(int, int) is not defined\r\n");
651 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
656 typedef dsError_t (*dsSetAssociatedAudioMixing_t)(intptr_t handle,
bool mixing);
657 static dsSetAssociatedAudioMixing_t dsSetAssociatedAudioMixingFunc = 0;
658 if (dsSetAssociatedAudioMixingFunc == 0) {
659 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
661 dsSetAssociatedAudioMixingFunc = (dsSetAssociatedAudioMixing_t) dlsym(dllib,
"dsSetAssociatedAudioMixing");
662 if (dsSetAssociatedAudioMixingFunc) {
663 printf(
"dsSetAssociatedAudioMixing_t (intptr_t handle, bool mixing ) is defined and loaded\r\n");
664 std::string _AssociatedAudioMixing(
"Disabled");
665 bool m_AssociatedAudioMixing =
false;
671 printf(
"audio.AssociatedAudioMixing not found in persistence store. Try system default\n");
675 _AssociatedAudioMixing =
"Disabled";
678 if (_AssociatedAudioMixing ==
"Enabled") {
679 m_AssociatedAudioMixing =
true;
682 m_AssociatedAudioMixing =
false;
685 if (dsSetAssociatedAudioMixingFunc(handle, m_AssociatedAudioMixing) ==
dsERR_NONE) {
686 printf(
"Initialized AssociatedAudioMixingFunc : %d\n", m_AssociatedAudioMixing);
690 printf(
"dsSetAssociatedAudioMixing_t (intptr_t handle, bool enable) is not defined\r\n");
695 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
699 std::string _AProfileSupport(
"FALSE");
700 std::string _AProfile(
"Off");
705 _AProfileSupport =
"FALSE";
706 printf(
"audio.MS12Profile.supported setting not found in hostDataDeafult \r\n");
708 printf(
" audio.MS12Profile.supported = %s ..... \r\n",_AProfileSupport.c_str());
711 if(_AProfileSupport ==
"TRUE") {
712 typedef dsError_t (*dsSetMS12AudioProfile_t)(intptr_t handle,
const char* profile);
713 static dsSetMS12AudioProfile_t dsSetMS12AudioProfileFunc = 0;
714 if (dsSetMS12AudioProfileFunc == 0) {
715 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
717 dsSetMS12AudioProfileFunc = (dsSetMS12AudioProfile_t) dlsym(dllib,
"dsSetMS12AudioProfile");
718 if (dsSetMS12AudioProfileFunc) {
719 printf(
"dsSetMS12AudioProfile_t(int, const char*) is defined and loaded\r\n");
728 printf(
"audio.MS12Profile not found in persistence store. Try system default\n");
738 if (dsSetMS12AudioProfileFunc(handle, _AProfile.c_str()) ==
dsERR_NONE) {
739 printf(
"Port %s: Initialized MS12 Audio Profile : %s\n",
"SPEAKER0", _AProfile.c_str());
743 printf(
"Port %s: Initialization failed !!! MS12 Audio Profile : %s\n",
"SPEAKER0", _AProfile.c_str());
746 #if 0 // No Audio Profile support for STB devices
750 if (dsSetMS12AudioProfileFunc(handle, _AProfile.c_str()) ==
dsERR_NONE) {
751 printf(
"Port %s: Initialized MS12 Audio Profile : %d\n",
"HDMI0", _AProfile.c_str());
757 printf(
"dsSetMS12AudioProfile_t(int, const char*) is not defined\r\n");
762 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
769 if((_AProfileSupport ==
"TRUE") && (_AProfile !=
"Off")) {
770 std::string _profileOverride =
"FALSE";
775 _profileOverride =
"FALSE";
776 printf(
" audio.Compression.ms12ProfileOverride settings not found in system default ..... \r\n");
778 printf(
" audio.Compression.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
780 if(_profileOverride ==
"TRUE") {
781 typedef dsError_t (*dsSetAudioCompression_t)(intptr_t handle,
int compressionLevel);
782 static dsSetAudioCompression_t dsSetAudioCompressionFunc = 0;
783 if (dsSetAudioCompressionFunc == 0) {
784 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
786 dsSetAudioCompressionFunc = (dsSetAudioCompression_t) dlsym(dllib,
"dsSetAudioCompression");
787 if (dsSetAudioCompressionFunc) {
788 printf(
"dsSetAudioCompression_t(int, int ) is defined and loaded\r\n");
789 std::string _AudioCompression(
"0");
790 int m_audioCompression = 0;
793 m_audioCompression = atoi(_AudioCompression.c_str());
797 if (dsSetAudioCompressionFunc(handle, m_audioCompression) ==
dsERR_NONE) {
798 printf(
"Port %s: Initialized audio compression : %d\n",
"SPEAKER0", m_audioCompression);
804 if (dsSetAudioCompressionFunc(handle, m_audioCompression) ==
dsERR_NONE) {
805 printf(
"Port %s: Initialized audio compression : %d\n",
"HDMI0", m_audioCompression);
811 printf(
"audio.Compression not found in persistence store. System Default configured through profiles\n");
815 printf(
"dsSetAudioCompression_t(int, int) is not defined\r\n");
820 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
825 _profileOverride =
"FALSE";
830 _profileOverride =
"FALSE";
831 printf(
" audio.DialogEnhancer.ms12ProfileOverride settings not found in system default ..... \r\n");
833 printf(
" audio.DialogEnhancer.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
835 if(_profileOverride ==
"TRUE") {
836 typedef dsError_t (*dsSetDialogEnhancement_t)(intptr_t handle,
int enhancerLevel);
837 static dsSetDialogEnhancement_t dsSetDialogEnhancementFunc = 0;
838 if (dsSetDialogEnhancementFunc == 0) {
839 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
841 dsSetDialogEnhancementFunc = (dsSetDialogEnhancement_t) dlsym(dllib,
"dsSetDialogEnhancement");
842 if (dsSetDialogEnhancementFunc) {
843 printf(
"dsSetDialogEnhancement_t(int, int) is defined and loaded\r\n");
844 std::string _EnhancerLevel(
"0");
845 int m_enhancerLevel = 0;
846 std::string _Property = _dsGetCurrentProfileProperty(
"EnhancerLevel");
849 m_enhancerLevel = atoi(_EnhancerLevel.c_str());
853 if (dsSetDialogEnhancementFunc(handle, m_enhancerLevel) ==
dsERR_NONE) {
854 printf(
"Port %s: Initialized dialog enhancement level : %d\n",
"SPEAKER0", m_enhancerLevel);
860 if (dsSetDialogEnhancementFunc(handle, m_enhancerLevel) ==
dsERR_NONE) {
861 printf(
"Port %s: Initialized dialog enhancement level : %d\n",
"HDMI0", m_enhancerLevel);
866 printf(
"audio.EnhancerLevel not found in persistence store. System Default configured through profiles\n");
870 printf(
"dsSetDialogEnhancement_t(int, int ) is not defined\r\n");
875 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
880 _profileOverride =
"FALSE";
885 _profileOverride =
"FALSE";
886 printf(
" audio.DolbyVolumeMode.ms12ProfileOverride settings not found in system default ..... \r\n");
888 printf(
" audio.DolbyVolumeMode.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
890 if(_profileOverride ==
"TRUE") {
891 typedef dsError_t (*dsSetDolbyVolumeMode_t)(intptr_t handle,
bool enable);
892 static dsSetDolbyVolumeMode_t dsSetDolbyVolumeModeFunc = 0;
893 if (dsSetDolbyVolumeModeFunc == 0) {
894 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
896 dsSetDolbyVolumeModeFunc = (dsSetDolbyVolumeMode_t) dlsym(dllib,
"dsSetDolbyVolumeMode");
897 if (dsSetDolbyVolumeModeFunc) {
898 printf(
"dsSetDolbyVolumeMode_t(int, bool) is defined and loaded\r\n");
899 std::string _DolbyVolumeMode(
"FALSE");
900 bool m_dolbyVolumeMode =
false;
903 if (_DolbyVolumeMode ==
"TRUE") {
904 m_dolbyVolumeMode =
true;
907 m_dolbyVolumeMode =
false;
912 if (dsSetDolbyVolumeModeFunc(handle, m_dolbyVolumeMode) ==
dsERR_NONE) {
913 printf(
"Port %s: Initialized Dolby Volume Mode : %d\n",
"SPEAKER0", m_dolbyVolumeMode);
919 if (dsSetDolbyVolumeModeFunc(handle, m_dolbyVolumeMode) ==
dsERR_NONE) {
920 printf(
"Port %s: Initialized Dolby Volume Mode : %d\n",
"HDMI0", m_dolbyVolumeMode);
925 printf(
"audio.DolbyVolumeMode not found in persistence store. System Default configured through profiles\n");
929 printf(
"dsSetDolbyVolumeMode_t(int, bool) is not defined\r\n");
934 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
939 _profileOverride =
"FALSE";
944 _profileOverride =
"FALSE";
945 printf(
" audio.IntelligentEQ.ms12ProfileOverride settings not found in system default ..... \r\n");
947 printf(
" audio.IntelligentEQ.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
949 if(_profileOverride ==
"TRUE") {
950 typedef dsError_t (*dsSetIntelligentEqualizerMode_t)(intptr_t handle,
int mode);
951 static dsSetIntelligentEqualizerMode_t dsSetIntelligentEqualizerModeFunc = 0;
952 if (dsSetIntelligentEqualizerModeFunc == 0) {
953 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
955 dsSetIntelligentEqualizerModeFunc = (dsSetIntelligentEqualizerMode_t) dlsym(dllib,
"dsSetIntelligentEqualizerMode");
956 if (dsSetIntelligentEqualizerModeFunc) {
957 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is defined and loaded\r\n");
958 std::string _IEQMode(
"0");
964 m_IEQMode = atoi(_IEQMode.c_str());
968 if (dsSetIntelligentEqualizerModeFunc(handle, m_IEQMode) ==
dsERR_NONE) {
969 printf(
"Port %s: Initialized Intelligent Equalizer mode : %d\n",
"SPEAKER0", m_IEQMode);
975 if (dsSetIntelligentEqualizerModeFunc(handle, m_IEQMode) ==
dsERR_NONE) {
976 printf(
"Port %s: Initialized Intelligent Equalizer mode : %d\n",
"HDMI0", m_IEQMode);
981 printf(
"audio.IntelligentEQ not found in persistence store. System Default configured through profiles\n");
985 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is not defined\r\n");
990 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
995 _profileOverride =
"FALSE";
1000 _profileOverride =
"FALSE";
1001 printf(
" audio.VolumeLeveller.ms12ProfileOverride settings not found in system default ..... \r\n");
1003 printf(
" audio.VolumeLeveller.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1005 if(_profileOverride ==
"TRUE") {
1007 static dsSetVolumeLeveller_t dsSetVolumeLevellerFunc = 0;
1008 if (dsSetVolumeLevellerFunc == 0) {
1009 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1011 dsSetVolumeLevellerFunc = (dsSetVolumeLeveller_t) dlsym(dllib,
"dsSetVolumeLeveller");
1012 if (dsSetVolumeLevellerFunc) {
1013 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is defined and loaded\r\n");
1014 std::string _volLevellerMode(
"0");
1015 std::string _volLevellerLevel(
"0");
1017 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
1018 std::string _Propertylevel = _dsGetCurrentProfileProperty(
"VolumeLeveller.level");
1022 m_volumeLeveller.mode = atoi(_volLevellerMode.c_str());
1023 m_volumeLeveller.level = atoi(_volLevellerLevel.c_str());
1027 if (dsSetVolumeLevellerFunc(handle, m_volumeLeveller) ==
dsERR_NONE) {
1028 printf(
"Port %s: Initialized Volume Leveller : Mode: %d, Level: %d\n",
"SPEAKER0", m_volumeLeveller.mode, m_volumeLeveller.level);
1034 if (dsSetVolumeLevellerFunc(handle, m_volumeLeveller) ==
dsERR_NONE) {
1035 printf(
"Port %s: Initialized Volume Leveller : Mode: %d, Level: %d\n",
"HDMI0", m_volumeLeveller.mode, m_volumeLeveller.level);
1040 printf(
"audio.VolumeLeveller not found in persistence store. System Default configured through profiles\n");
1044 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is not defined\r\n");
1049 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1054 _profileOverride =
"FALSE";
1059 _profileOverride =
"FALSE";
1060 printf(
" audio.BassBoost.ms12ProfileOverride settings not found in system default ..... \r\n");
1062 printf(
" audio.BassBoost.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1064 if(_profileOverride ==
"TRUE") {
1065 typedef dsError_t (*dsSetBassEnhancer_t)(intptr_t handle,
int boost);
1066 static dsSetBassEnhancer_t dsSetBassEnhancerFunc = 0;
1067 if (dsSetBassEnhancerFunc == 0) {
1068 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1070 dsSetBassEnhancerFunc = (dsSetBassEnhancer_t) dlsym(dllib,
"dsSetBassEnhancer");
1071 if (dsSetBassEnhancerFunc) {
1072 printf(
"dsSetBassEnhancer_t(int, int) is defined and loaded\r\n");
1073 std::string _BassBoost(
"0");
1074 int m_bassBoost = 0;
1077 m_bassBoost = atoi(_BassBoost.c_str());
1081 if (dsSetBassEnhancerFunc(handle, m_bassBoost) ==
dsERR_NONE) {
1082 printf(
"Port %s: Initialized Bass Boost : %d\n",
"SPEAKER0", m_bassBoost);
1088 if (dsSetBassEnhancerFunc(handle, m_bassBoost) ==
dsERR_NONE) {
1089 printf(
"Port %s: Initialized Bass Boost : %d\n",
"HDMI0", m_bassBoost);
1094 printf(
"audio.BassBoost not found in persistence store. System Default configured through profiles\n");
1098 printf(
"dsSetBassEnhancer_t(int, int) is not defined\r\n");
1103 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1108 _profileOverride =
"FALSE";
1113 _profileOverride =
"FALSE";
1114 printf(
" audio.SurroundDecoder.ms12ProfileOverride settings not found in system default ..... \r\n");
1116 printf(
" audio.SurroundDecoder.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1118 if(_profileOverride ==
"TRUE") {
1119 typedef dsError_t (*dsEnableSurroundDecoder_t)(intptr_t handle,
bool enabled);
1120 static dsEnableSurroundDecoder_t dsEnableSurroundDecoderFunc = 0;
1121 if (dsEnableSurroundDecoderFunc == 0) {
1122 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1124 dsEnableSurroundDecoderFunc = (dsEnableSurroundDecoder_t) dlsym(dllib,
"dsEnableSurroundDecoder");
1125 if (dsEnableSurroundDecoderFunc) {
1126 printf(
"dsEnableSurroundDecoder_t(int, bool) is defined and loaded\r\n");
1127 std::string _SurroundDecoder(
"FALSE");
1128 bool m_surroundDecoder =
false;
1131 if (_SurroundDecoder ==
"TRUE") {
1132 m_surroundDecoder =
true;
1135 m_surroundDecoder =
false;
1140 if (dsEnableSurroundDecoderFunc(handle, m_surroundDecoder) ==
dsERR_NONE) {
1141 printf(
"Port %s: Initialized Surroudn Decoder : %d\n",
"SPEAKER0", m_surroundDecoder);
1147 if (dsEnableSurroundDecoderFunc(handle, m_surroundDecoder) ==
dsERR_NONE) {
1148 printf(
"Port %s: Initialized Surroudn Decoder : %d\n",
"HDMI0", m_surroundDecoder);
1153 printf(
"audio.SurroundDecoderEnabled not found in persistence store. System Default configured through profiles\n");
1157 printf(
"dsEnableSurroundDecoder_t(int, bool) is not defined\r\n");
1162 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1167 _profileOverride =
"FALSE";
1172 _profileOverride =
"FALSE";
1173 printf(
" audio.DRCMode.ms12ProfileOverride settings not found in system default ..... \r\n");
1175 printf(
" audio.DRCMode.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1177 if(_profileOverride ==
"TRUE") {
1178 typedef dsError_t (*dsSetDRCMode_t)(intptr_t handle,
int mode);
1179 static dsSetDRCMode_t dsSetDRCModeFunc = 0;
1180 if (dsSetDRCModeFunc == 0) {
1181 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1183 dsSetDRCModeFunc = (dsSetDRCMode_t) dlsym(dllib,
"dsSetDRCMode");
1184 if (dsSetDRCModeFunc) {
1185 printf(
"dsSetDRCMode_t(int, int) is defined and loaded\r\n");
1186 std::string _DRCMode(
"Line");
1190 if (_DRCMode ==
"RF") {
1199 if (dsSetDRCModeFunc(handle, m_DRCMode) ==
dsERR_NONE) {
1200 printf(
"Port %s: Initialized DRCMode : %d\n",
"SPEAKER0", m_DRCMode);
1206 if (dsSetDRCModeFunc(handle, m_DRCMode) ==
dsERR_NONE) {
1207 printf(
"Port %s: Initialized DRCMode : %d\n",
"HDMI0", m_DRCMode);
1212 printf(
"audio.DRCMode not found in persistence store. System Default configured through profiles\n");
1216 printf(
"dsSetDRCMode_t(int, int) is not defined\r\n");
1221 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1226 _profileOverride =
"FALSE";
1231 _profileOverride =
"FALSE";
1232 printf(
" audio.SurroundVirtualizer.ms12ProfileOverride settings not found in system default ..... \r\n");
1234 printf(
" audio.SurroundVirtualizer.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1236 if(_profileOverride ==
"TRUE") {
1238 static dsSetSurroundVirtualizer_t dsSetSurroundVirtualizerFunc = 0;
1239 if (dsSetSurroundVirtualizerFunc == 0) {
1240 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1242 dsSetSurroundVirtualizerFunc = (dsSetSurroundVirtualizer_t) dlsym(dllib,
"dsSetSurroundVirtualizer");
1243 if (dsSetSurroundVirtualizerFunc) {
1244 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t virtualizer) is defined and loaded\r\n");
1245 std::string _SVMode(
"0");
1246 std::string _SVBoost(
"0");
1248 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
1249 std::string _PropertyBoost = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.boost");
1253 m_virtualizer.mode = atoi(_SVMode.c_str());
1254 m_virtualizer.boost = atoi(_SVBoost.c_str());
1258 if (dsSetSurroundVirtualizerFunc(handle, m_virtualizer) ==
dsERR_NONE) {
1259 printf(
"Port %s: Initialized Surround Virtualizer : Mode: %d, Boost : %d\n",
"SPEAKER0", m_virtualizer.mode, m_virtualizer.boost);
1265 if (dsSetSurroundVirtualizerFunc(handle, m_virtualizer) ==
dsERR_NONE){
1266 printf(
"Port %s: Initialized Surround Virtualizer : Mode: %d, Boost : %d\\n",
"HDMI0", m_virtualizer.mode, m_virtualizer.boost);
1271 printf(
"audio.SurroundVirtualizer not found in persistence store. System Default configured through profiles \n");
1275 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is not defined\r\n");
1280 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1285 _profileOverride =
"FALSE";
1290 _profileOverride =
"FALSE";
1291 printf(
" audio.MISteering.ms12ProfileOverride settings not found in system default ..... \r\n");
1293 printf(
" audio.MISteering.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1295 if(_profileOverride ==
"TRUE") {
1296 typedef dsError_t (*dsSetMISteering_t)(intptr_t handle,
bool enabled);
1297 static dsSetMISteering_t dsSetMISteeringFunc = 0;
1298 if (dsSetMISteeringFunc == 0) {
1299 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1301 dsSetMISteeringFunc = (dsSetMISteering_t) dlsym(dllib,
"dsSetMISteering");
1302 if (dsSetMISteeringFunc) {
1303 printf(
"dsSetMISteering_t(int, bool) is defined and loaded\r\n");
1304 std::string _MISteering(
"Disabled");
1305 bool m_MISteering =
false;
1308 if (_MISteering ==
"Enabled") {
1309 m_MISteering =
true;
1312 m_MISteering =
false;
1317 if (dsSetMISteeringFunc(handle, m_MISteering) ==
dsERR_NONE) {
1318 printf(
"Port %s: Initialized MI Steering : %d\n",
"SPEAKER0", m_MISteering);
1323 if (dsSetMISteeringFunc(handle, m_MISteering) ==
dsERR_NONE) {
1324 printf(
"Port %s: Initialized MI Steering : %d\n",
"HDMI0", m_MISteering);
1328 printf(
"Port %s: Initialization MI Steering : %d failed. Port not available\n",
"HDMI0", m_MISteering);
1332 printf(
"audio.MISteering not found in persistence store. System Default configured through profiles\n");
1336 printf(
"dsSetMISteering_t(int, bool) is not defined\r\n");
1341 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1346 _profileOverride =
"FALSE";
1351 _profileOverride =
"FALSE";
1352 printf(
" audio.GraphicEQ.ms12ProfileOverride settings not found in system default ..... \r\n");
1354 printf(
" audio.GraphicEQ.ms12ProfileOverride = %s ..... \r\n",_profileOverride.c_str());
1356 if(_profileOverride ==
"TRUE") {
1357 typedef dsError_t (*dsSetGraphicEqualizerMode_t)(intptr_t handle,
int mode);
1358 static dsSetGraphicEqualizerMode_t dsSetGraphicEqualizerModeFunc = 0;
1359 if (dsSetGraphicEqualizerModeFunc == 0) {
1360 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1362 dsSetGraphicEqualizerModeFunc = (dsSetGraphicEqualizerMode_t) dlsym(dllib,
"dsSetGraphicEqualizerMode");
1363 if (dsSetGraphicEqualizerModeFunc) {
1364 printf(
"dsSetGraphicEqualizerMode_t(int, int) is defined and loaded\r\n");
1365 std::string _GEQMode(
"0");
1371 m_GEQMode = atoi(_GEQMode.c_str());
1375 if (dsSetGraphicEqualizerModeFunc(handle, m_GEQMode) ==
dsERR_NONE) {
1376 printf(
"Port %s: Initialized Graphic Equalizer mode : %d\n",
"SPEAKER0", m_GEQMode);
1382 if (dsSetGraphicEqualizerModeFunc(handle, m_GEQMode) ==
dsERR_NONE) {
1383 printf(
"Port %s: Initialized Graphic Equalizer mode : %d\n",
"HDMI0", m_GEQMode);
1388 printf(
"audio.GraphicEQ not found in persistence store. System Default configured through profiles\n");
1392 printf(
"dsSetGraphicEqualizerMode_t(int, int) is not defined\r\n");
1397 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1404 else if(_AProfileSupport ==
"FALSE") {
1405 typedef dsError_t (*dsSetAudioCompression_t)(intptr_t handle,
int compressionLevel);
1406 static dsSetAudioCompression_t dsSetAudioCompressionFunc = 0;
1407 if (dsSetAudioCompressionFunc == 0) {
1408 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1410 dsSetAudioCompressionFunc = (dsSetAudioCompression_t) dlsym(dllib,
"dsSetAudioCompression");
1411 if (dsSetAudioCompressionFunc) {
1412 printf(
"dsSetAudioCompression_t(int, int ) is defined and loaded\r\n");
1413 std::string _AudioCompression(
"0");
1414 int m_audioCompression = 0;
1420 printf(
"audio.Compression not found in persistence store. Try system default\n");
1424 _AudioCompression =
"0";
1427 m_audioCompression = atoi(_AudioCompression.c_str());
1431 if (dsSetAudioCompressionFunc(handle, m_audioCompression) ==
dsERR_NONE) {
1432 printf(
"Port %s: Initialized audio compression : %d\n",
"SPEAKER0", m_audioCompression);
1438 if (dsSetAudioCompressionFunc(handle, m_audioCompression) ==
dsERR_NONE) {
1439 printf(
"Port %s: Initialized audio compression : %d\n",
"HDMI0", m_audioCompression);
1444 printf(
"dsSetAudioCompression_t(int, int) is not defined\r\n");
1449 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1454 typedef dsError_t (*dsSetDialogEnhancement_t)(intptr_t handle,
int enhancerLevel);
1455 static dsSetDialogEnhancement_t dsSetDialogEnhancementFunc = 0;
1456 if (dsSetDialogEnhancementFunc == 0) {
1457 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1459 dsSetDialogEnhancementFunc = (dsSetDialogEnhancement_t) dlsym(dllib,
"dsSetDialogEnhancement");
1460 if (dsSetDialogEnhancementFunc) {
1461 printf(
"dsSetDialogEnhancement_t(int, int) is defined and loaded\r\n");
1462 std::string _EnhancerLevel(
"0");
1463 int m_enhancerLevel = 0;
1469 printf(
"audio.EnhancerLevel not found in persistence store. Try system default\n");
1473 _EnhancerLevel =
"0";
1476 m_enhancerLevel = atoi(_EnhancerLevel.c_str());
1480 if (dsSetDialogEnhancementFunc(handle, m_enhancerLevel) ==
dsERR_NONE) {
1481 printf(
"Port %s: Initialized dialog enhancement level : %d\n",
"SPEAKER0", m_enhancerLevel);
1487 if (dsSetDialogEnhancementFunc(handle, m_enhancerLevel) ==
dsERR_NONE) {
1488 printf(
"Port %s: Initialized dialog enhancement level : %d\n",
"HDMI0", m_enhancerLevel);
1493 printf(
"dsSetDialogEnhancement_t(int, int ) is not defined\r\n");
1498 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1503 typedef dsError_t (*dsSetDolbyVolumeMode_t)(intptr_t handle,
bool enable);
1504 static dsSetDolbyVolumeMode_t dsSetDolbyVolumeModeFunc = 0;
1505 bool bDolbyVolumeOverrideCheck =
true;
1506 if (dsSetDolbyVolumeModeFunc == 0) {
1507 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1509 dsSetDolbyVolumeModeFunc = (dsSetDolbyVolumeMode_t) dlsym(dllib,
"dsSetDolbyVolumeMode");
1510 if (dsSetDolbyVolumeModeFunc) {
1511 printf(
"dsSetDolbyVolumeMode_t(int, bool) is defined and loaded\r\n");
1512 std::string _DolbyVolumeMode(
"FALSE");
1513 bool m_dolbyVolumeMode =
false;
1516 bDolbyVolumeOverrideCheck =
false;
1520 printf(
"audio.DolbyVolumeMode not found in persistence store. Try system default\n");
1524 _DolbyVolumeMode =
"FALSE";
1527 if (_DolbyVolumeMode ==
"TRUE") {
1528 m_dolbyVolumeMode =
true;
1531 m_dolbyVolumeMode =
false;
1536 if (dsSetDolbyVolumeModeFunc(handle, m_dolbyVolumeMode) ==
dsERR_NONE) {
1537 printf(
"Port %s: Initialized Dolby Volume Mode : %d\n",
"SPEAKER0", m_dolbyVolumeMode);
1543 if (dsSetDolbyVolumeModeFunc(handle, m_dolbyVolumeMode) ==
dsERR_NONE) {
1544 printf(
"Port %s: Initialized Dolby Volume Mode : %d\n",
"HDMI0", m_dolbyVolumeMode);
1549 printf(
"dsSetDolbyVolumeMode_t(int, bool) is not defined\r\n");
1554 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1558 typedef dsError_t (*dsSetIntelligentEqualizerMode_t)(intptr_t handle,
int mode);
1559 static dsSetIntelligentEqualizerMode_t dsSetIntelligentEqualizerModeFunc = 0;
1560 if (dsSetIntelligentEqualizerModeFunc == 0) {
1561 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1563 dsSetIntelligentEqualizerModeFunc = (dsSetIntelligentEqualizerMode_t) dlsym(dllib,
"dsSetIntelligentEqualizerMode");
1564 if (dsSetIntelligentEqualizerModeFunc) {
1565 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is defined and loaded\r\n");
1566 std::string _IEQMode(
"0");
1575 printf(
"audio.IntelligentEQ not found in persistence store. Try system default\n");
1582 m_IEQMode = atoi(_IEQMode.c_str());
1587 if (dsSetIntelligentEqualizerModeFunc(handle, m_IEQMode) ==
dsERR_NONE) {
1588 printf(
"Port %s: Initialized Intelligent Equalizer mode : %d\n",
"SPEAKER0", m_IEQMode);
1594 if (dsSetIntelligentEqualizerModeFunc(handle, m_IEQMode) ==
dsERR_NONE) {
1595 printf(
"Port %s: Initialized Intelligent Equalizer mode : %d\n",
"HDMI0", m_IEQMode);
1600 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is not defined\r\n");
1605 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1610 static dsSetVolumeLeveller_t dsSetVolumeLevellerFunc = 0;
1611 if (dsSetVolumeLevellerFunc == 0) {
1612 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1614 dsSetVolumeLevellerFunc = (dsSetVolumeLeveller_t) dlsym(dllib,
"dsSetVolumeLeveller");
1615 if (dsSetVolumeLevellerFunc) {
1616 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is defined and loaded\r\n");
1617 std::string _volLevellerMode(
"0");
1618 std::string _volLevellerLevel(
"0");
1623 bDolbyVolumeOverrideCheck =
true;
1627 printf(
"audio.VolumeLeveller not found in persistence store. Try system default\n");
1632 _volLevellerMode =
"0";
1633 _volLevellerLevel =
"0";
1636 m_volumeLeveller.mode = atoi(_volLevellerMode.c_str());
1637 m_volumeLeveller.level = atoi(_volLevellerLevel.c_str());
1640 printf(
"bDolbyVolumeOverrideCheck value: %d\n", bDolbyVolumeOverrideCheck);
1642 if (dsSetVolumeLevellerFunc(handle, m_volumeLeveller) ==
dsERR_NONE) {
1643 printf(
"Port %s: Initialized Volume Leveller : Mode: %d, Level: %d\n",
"SPEAKER0", m_volumeLeveller.mode, m_volumeLeveller.level);
1649 if (dsSetVolumeLevellerFunc(handle, m_volumeLeveller) ==
dsERR_NONE) {
1650 printf(
"Port %s: Initialized Volume Leveller : Mode: %d, Level: %d\n",
"HDMI0", m_volumeLeveller.mode, m_volumeLeveller.level);
1655 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is not defined\r\n");
1660 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1665 typedef dsError_t (*dsSetBassEnhancer_t)(intptr_t handle,
int boost);
1666 static dsSetBassEnhancer_t dsSetBassEnhancerFunc = 0;
1667 if (dsSetBassEnhancerFunc == 0) {
1668 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1670 dsSetBassEnhancerFunc = (dsSetBassEnhancer_t) dlsym(dllib,
"dsSetBassEnhancer");
1671 if (dsSetBassEnhancerFunc) {
1672 printf(
"dsSetBassEnhancer_t(int, int) is defined and loaded\r\n");
1673 std::string _BassBoost(
"0");
1674 int m_bassBoost = 0;
1680 printf(
"audio.BassBoost not found in persistence store. Try system default\n");
1681 std::string _Property = _dsGetCurrentProfileProperty(
"BassBoost");
1688 m_bassBoost = atoi(_BassBoost.c_str());
1692 if (dsSetBassEnhancerFunc(handle, m_bassBoost) ==
dsERR_NONE) {
1693 printf(
"Port %s: Initialized Bass Boost : %d\n",
"SPEAKER0", m_bassBoost);
1699 if (dsSetBassEnhancerFunc(handle, m_bassBoost) ==
dsERR_NONE) {
1700 printf(
"Port %s: Initialized Bass Boost : %d\n",
"HDMI0", m_bassBoost);
1705 printf(
"dsSetBassEnhancer_t(int, int) is not defined\r\n");
1710 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1715 typedef dsError_t (*dsEnableSurroundDecoder_t)(intptr_t handle,
bool enabled);
1716 static dsEnableSurroundDecoder_t dsEnableSurroundDecoderFunc = 0;
1717 if (dsEnableSurroundDecoderFunc == 0) {
1718 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1720 dsEnableSurroundDecoderFunc = (dsEnableSurroundDecoder_t) dlsym(dllib,
"dsEnableSurroundDecoder");
1721 if (dsEnableSurroundDecoderFunc) {
1722 printf(
"dsEnableSurroundDecoder_t(int, bool) is defined and loaded\r\n");
1723 std::string _SurroundDecoder(
"FALSE");
1724 bool m_surroundDecoder =
false;
1730 printf(
"audio.SurroundDecoderEnabled not found in persistence store. Try system default\n");
1734 _SurroundDecoder =
"FALSE";
1737 if (_SurroundDecoder ==
"TRUE") {
1738 m_surroundDecoder =
true;
1741 m_surroundDecoder =
false;
1746 if (dsEnableSurroundDecoderFunc(handle, m_surroundDecoder) ==
dsERR_NONE) {
1747 printf(
"Port %s: Initialized Surroudn Decoder : %d\n",
"SPEAKER0", m_surroundDecoder);
1753 if (dsEnableSurroundDecoderFunc(handle, m_surroundDecoder) ==
dsERR_NONE) {
1754 printf(
"Port %s: Initialized Surroudn Decoder : %d\n",
"HDMI0", m_surroundDecoder);
1759 printf(
"dsEnableSurroundDecoder_t(int, bool) is not defined\r\n");
1764 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1769 typedef dsError_t (*dsSetDRCMode_t)(intptr_t handle,
int mode);
1770 static dsSetDRCMode_t dsSetDRCModeFunc = 0;
1771 if (dsSetDRCModeFunc == 0) {
1772 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1774 dsSetDRCModeFunc = (dsSetDRCMode_t) dlsym(dllib,
"dsSetDRCMode");
1775 if (dsSetDRCModeFunc) {
1776 printf(
"dsSetDRCMode_t(int, int) is defined and loaded\r\n");
1777 std::string _DRCMode(
"Line");
1784 printf(
"audio.DRCMode not found in persistence store. Try system default\n");
1791 if (_DRCMode ==
"RF") {
1800 if (dsSetDRCModeFunc(handle, m_DRCMode) ==
dsERR_NONE) {
1801 printf(
"Port %s: Initialized DRCMode : %d\n",
"SPEAKER0", m_DRCMode);
1807 if (dsSetDRCModeFunc(handle, m_DRCMode) ==
dsERR_NONE) {
1808 printf(
"Port %s: Initialized DRCMode : %d\n",
"HDMI0", m_DRCMode);
1813 printf(
"dsSetDRCMode_t(int, int) is not defined\r\n");
1818 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1824 static dsSetSurroundVirtualizer_t dsSetSurroundVirtualizerFunc = 0;
1825 if (dsSetSurroundVirtualizerFunc == 0) {
1826 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1828 dsSetSurroundVirtualizerFunc = (dsSetSurroundVirtualizer_t) dlsym(dllib,
"dsSetSurroundVirtualizer");
1829 if (dsSetSurroundVirtualizerFunc) {
1830 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is defined and loaded\r\n");
1831 std::string _SVMode(
"0");
1832 std::string _SVBoost(
"0");
1838 m_virtualizer.mode = atoi(_SVMode.c_str());
1839 m_virtualizer.boost = atoi(_SVBoost.c_str());
1843 printf(
"audio.SurroundVirtualizer.mode/audio.SurroundVirtualizer.boost not found in persistence store. Try system default\n");
1852 m_virtualizer.mode = atoi(_SVMode.c_str());
1853 m_virtualizer.boost = atoi(_SVBoost.c_str());
1857 if (dsSetSurroundVirtualizerFunc(handle, m_virtualizer) ==
dsERR_NONE) {
1858 printf(
"Port %s: Initialized Surround Virtualizer : Mode: %d, Boost : %d\n",
"SPEAKER0", m_virtualizer.mode, m_virtualizer.boost);
1864 if (dsSetSurroundVirtualizerFunc(handle, m_virtualizer) ==
dsERR_NONE) {
1865 printf(
"Port %s: Initialized Surround Virtualizer : Mode: %d, Boost : %d\\n",
"HDMI0", m_virtualizer.mode, m_virtualizer.boost);
1870 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is not defined\r\n");
1875 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1880 typedef dsError_t (*dsSetMISteering_t)(intptr_t handle,
bool enabled);
1881 static dsSetMISteering_t dsSetMISteeringFunc = 0;
1882 if (dsSetMISteeringFunc == 0) {
1883 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1885 dsSetMISteeringFunc = (dsSetMISteering_t) dlsym(dllib,
"dsSetMISteering");
1886 if (dsSetMISteeringFunc) {
1887 printf(
"dsSetMISteering_t(int, bool) is defined and loaded\r\n");
1888 std::string _MISteering(
"Disabled");
1889 bool m_MISteering =
false;
1895 printf(
"audio.MISteering not found in persistence store. Try system default\n");
1899 _MISteering =
"Disabled";
1902 if (_MISteering ==
"Enabled") {
1903 m_MISteering =
true;
1906 m_MISteering =
false;
1912 if (dsSetMISteeringFunc(handle, m_MISteering) ==
dsERR_NONE) {
1913 printf(
"Port %s: Initialized MI Steering : %d\n",
"SPEAKER0", m_MISteering);
1918 if (dsSetMISteeringFunc(handle, m_MISteering) ==
dsERR_NONE) {
1919 printf(
"Port %s: Initialized MI Steering : %d\n",
"HDMI0", m_MISteering);
1923 printf(
"Port %s: Initialization MI Steering : %d failed. Port not available\n",
"HDMI0", m_MISteering);
1927 printf(
"dsSetMISteering_t(int, bool) is not defined\r\n");
1932 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1937 typedef dsError_t (*dsSetGraphicEqualizerMode_t)(intptr_t handle,
int mode);
1938 static dsSetGraphicEqualizerMode_t dsSetGraphicEqualizerModeFunc = 0;
1939 if (dsSetGraphicEqualizerModeFunc == 0) {
1940 dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
1942 dsSetGraphicEqualizerModeFunc = (dsSetGraphicEqualizerMode_t) dlsym(dllib,
"dsSetGraphicEqualizerMode");
1943 if (dsSetGraphicEqualizerModeFunc) {
1944 printf(
"dsSetGraphicEqualizerMode_t(int, int) is defined and loaded\r\n");
1945 std::string _GEQMode(
"0");
1954 printf(
"audio.GraphicEQ not found in persistence store. Try system default\n");
1961 m_GEQMode = atoi(_GEQMode.c_str());
1966 if (dsSetGraphicEqualizerModeFunc(handle, m_GEQMode) ==
dsERR_NONE) {
1967 printf(
"Port %s: Initialized Graphic Equalizer mode : %d\n",
"SPEAKER0", m_GEQMode);
1973 if (dsSetGraphicEqualizerModeFunc(handle, m_GEQMode) ==
dsERR_NONE) {
1974 printf(
"Port %s: Initialized Graphic Equalizer mode : %d\n",
"HDMI0", m_GEQMode);
1979 printf(
"dsSetGraphicEqualizerMode_t(int, int) is not defined\r\n");
1984 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
1991 std::string _ARCAudioModeAuto(
"FALSE");
1997 printf(
"HDMI_ARC0.AudioMode.AUTO not found in persistence store. Try system default\n");
2001 _ARCAudioModeAuto =
"FALSE";
2004 if (_ARCAudioModeAuto.compare(
"TRUE") == 0)
2006 typedef dsError_t (*dsSetStereoAuto_t)(intptr_t handle,
int autoMode);
2007 static dsSetStereoAuto_t func = 0;
2009 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2011 func = (dsSetStereoAuto_t) dlsym(dllib,
"dsSetStereoAuto");
2013 printf(
"dsSetStereoAuto_t(int, int *) is defined and loaded\r\n");
2016 printf(
"dsSetStereoAuto_t(int, int *) is not defined\r\n");
2021 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2025 if (func != 0 && handle != NULL)
2029 printf(
"dsSetStereoAuto Port HDMI_0ARC Audio Mode is set to Auto \n");
2034 else if (_ARCAudioModeAuto.compare(
"FALSE") == 0)
2036 if (NULL != handle) {
2039 printf(
"dsSetStereoMode The HDMI ARC Port Audio Settings Mode is %d \r\n",_srv_HDMI_ARC_Audiomode);
2046 #endif //DS_AUDIO_SETTINGS_PERSISTENCE
2049 IARM_Result_t dsAudioMgr_init()
2052 IARM_BUS_Lock(lock);
2056 std::string _AudioModeSettings(
"STEREO");
2058 __TIMESTAMP();printf(
"The HDMI Audio Mode Setting on startup is %s \r\n",_AudioModeSettings.c_str());
2059 if (_AudioModeSettings.compare(
"SURROUND") == 0)
2063 else if (_AudioModeSettings.compare(
"PASSTHRU") == 0)
2067 else if (_AudioModeSettings.compare(
"DOLBYDIGITAL") == 0)
2071 else if (_AudioModeSettings.compare(
"DOLBYDIGITALPLUS") == 0)
2082 std::string _AudioModeAuto(
"FALSE");
2092 _AudioModeAuto =
"TRUE";
2100 _AudioModeAuto =
false;
2102 std::string _ARCAudioModeAuto(
"FALSE");
2103 std::string _SPDIFAudioModeAuto(
"FALSE");
2109 printf(
"HDMI_ARC0.AudioMode.AUTO not found in persistence store. Try system default\n");
2113 _ARCAudioModeAuto =
"FALSE";
2123 printf(
"SPDIF0.AudioMode.AUTO not found in persistence store. Try system default\n");
2127 _SPDIFAudioModeAuto =
"FALSE";
2131 if ((_AudioModeAuto.compare(
"TRUE") == 0) || (_ARCAudioModeAuto.compare(
"TRUE") == 0) || (_SPDIFAudioModeAuto.compare(
"TRUE") == 0))
2139 __TIMESTAMP();printf(
"The HDMI Audio Auto Setting on startup is %s \r\n",_AudioModeAuto.c_str());
2140 __TIMESTAMP();printf(
"The HDMI ARC Audio Auto Setting on startup is %s \r\n",_ARCAudioModeAuto.c_str());
2141 __TIMESTAMP();printf(
"The SPDIF Audio Auto Setting on startup is %s \r\n",_SPDIFAudioModeAuto.c_str());
2144 std::string _SPDIFModeSettings(
"STEREO");
2146 __TIMESTAMP();printf(
"The SPDIF Audio Mode Setting on startup is %s \r\n",_SPDIFModeSettings.c_str());
2147 if (_SPDIFModeSettings.compare(
"SURROUND") == 0)
2151 else if (_SPDIFModeSettings.compare(
"PASSTHRU") == 0)
2160 std::string _ARCModeSettings(
"STEREO");
2162 __TIMESTAMP();printf(
"The HDMI ARC Audio Mode Setting on startup is %s \r\n",_ARCModeSettings.c_str());
2163 if (_ARCModeSettings.compare(
"SURROUND") == 0)
2167 else if (_ARCModeSettings.compare(
"PASSTHRU") == 0)
2178 printf(
"Exception in Getting the Audio settings on Startup..... \r\n");
2180 if (!m_isPlatInitialized) {
2185 m_isPlatInitialized ++;
2188 audio_portstate_event_data.data.AudioPortStateInfo.audioPortState = dsAUDIOPORT_STATE_INITIALIZED;
2189 printf(
"%s: AudioOutPort PortInitState:%d \r\n", __FUNCTION__, audio_portstate_event_data.data.AudioPortStateInfo.audioPortState);
2192 (
void *)&audio_portstate_event_data,
2193 sizeof(audio_portstate_event_data));
2197 IARM_BUS_Unlock(lock);
2198 return IARM_RESULT_SUCCESS;
2203 IARM_Result_t dsAudioMgr_term()
2205 return IARM_RESULT_SUCCESS;
2208 IARM_Result_t _dsAudioPortInit(
void *arg)
2210 IARM_BUS_Lock(lock);
2212 if (!m_isInitialized) {
2247 IARM_Bus_RegisterCall(IARM_BUS_DSMGR_API_dsGetSinkDeviceAtmosCapability, _dsGetSinkDeviceAtmosCapability);
2256 IARM_Bus_RegisterCall(IARM_BUS_DSMGR_API_dsSetIntelligentEqualizerMode, _dsSetIntelligentEqualizerMode);
2257 IARM_Bus_RegisterCall(IARM_BUS_DSMGR_API_dsGetIntelligentEqualizerMode, _dsGetIntelligentEqualizerMode);
2296 dsError_t eRet = _dsAudioOutRegisterConnectCB (_dsAudioOutPortConnectCB);
2298 printf (
"%s: _dsAudioOutRegisterConnectCB eRet:%04x", __FUNCTION__, eRet);
2301 eRet = _dsAudioFormatUpdateRegisterCB (_dsAudioFormatUpdateCB) ;
2303 printf (
"%s: _dsAudioFormatUpdateRegisterCB eRet:%04x", __FUNCTION__, eRet);
2306 m_isInitialized = 1;
2309 if (!m_isPlatInitialized) {
2314 m_isPlatInitialized++;
2317 IARM_BUS_Unlock(lock);
2319 return IARM_RESULT_SUCCESS;
2323 IARM_Result_t _dsGetAudioPort(
void *arg)
2327 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2330 IARM_BUS_Lock(lock);
2336 printf(
"%s..%d-%d \r\n",__func__,param->type,param->index);
2339 result = IARM_RESULT_SUCCESS;
2343 IARM_BUS_Unlock(lock);
2350 IARM_Result_t _dsGetStereoMode(
void *arg)
2354 IARM_BUS_Lock(lock);
2356 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2360 if (param != NULL && param->toPersist && NULL != param->handle) {
2361 _GetAudioModeFromPersistent(arg);
2362 result = IARM_RESULT_SUCCESS;
2364 else if (param != NULL && NULL != param->handle)
2367 if (_srv_AudioAuto) {
2371 result = IARM_RESULT_SUCCESS;
2373 param->mode = stereoMode;
2379 param->mode = _srv_SPDIF_Audiomode;
2380 printf(
"The SPDIF Port Audio Settings Mode is %d \r\n",param->mode);
2383 param->mode = _srv_HDMI_Audiomode;
2384 printf(
"The HDMI Port Audio Settings Mode is %d \r\n",param->mode);
2386 else if (_APortType == dsAUDIOPORT_TYPE_HDMI_ARC) {
2387 param->mode = _srv_HDMI_ARC_Audiomode;
2388 printf(
"The HDMI ARC Port Audio Settings Mode is %d \r\n",param->mode);
2391 result = IARM_RESULT_SUCCESS;
2395 IARM_BUS_Unlock(lock);
2401 IARM_Result_t _dsSetStereoMode(
void *arg)
2406 IARM_BUS_Lock(lock);
2408 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2411 if (NULL != param->handle) {
2413 param->rpcResult = ret;
2427 __TIMESTAMP();printf(
"Setting Audio Mode STEREO with persistent value : %d \r\n",param->toPersist);
2431 if (param->toPersist)
2438 if (param->toPersist)
2443 else if (_APortType == dsAUDIOPORT_TYPE_HDMI_ARC)
2445 if (param->toPersist)
2451 eventData.data.Audioport.type = _APortType;
2457 __TIMESTAMP();printf(
"Setting Audio Mode SURROUND with persistent value %d \r\n",param->toPersist);
2461 if (param->toPersist)
2468 if (param->toPersist)
2473 else if (_APortType == dsAUDIOPORT_TYPE_HDMI_ARC)
2475 if (param->toPersist)
2482 eventData.data.Audioport.type = _APortType;
2487 __TIMESTAMP();printf(
"Setting Audio Mode Dolby Digital with persistent value %d \r\n",param->toPersist);
2491 if (param->toPersist)
2497 eventData.data.Audioport.type = _APortType;
2502 __TIMESTAMP();printf(
"Setting Audio Mode Dolby Digital Plus with persistent value %d \r\n",param->toPersist);
2506 if (param->toPersist)
2512 eventData.data.Audioport.type = _APortType;
2517 __TIMESTAMP();printf(
"Setting Audio Mode PASSTHRU with persistent value %d \r\n",param->toPersist);
2521 if (param->toPersist)
2527 if (param->toPersist)
2531 else if (_APortType == dsAUDIOPORT_TYPE_HDMI_ARC)
2533 if (param->toPersist)
2540 eventData.data.Audioport.type = _APortType;
2545 result = IARM_RESULT_SUCCESS;
2549 printf(
"Error in Setting audio mode... \r\n");
2554 IARM_BUS_Unlock(lock);
2559 IARM_Result_t _dsGetStereoAuto(
void *arg)
2563 IARM_BUS_Lock(lock);
2569 param->autoMode = (_srv_AudioAuto ? 1 : 0);
2572 IARM_BUS_Unlock(lock);
2574 return IARM_RESULT_SUCCESS;
2577 IARM_Result_t _dsSetStereoAuto(
void *arg)
2580 IARM_BUS_Lock(lock);
2582 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2587 printf(
"Param is null\r\n");
2592 if (param->toPersist) {
2593 switch(_APortType) {
2598 case dsAUDIOPORT_TYPE_HDMI_ARC:
2612 typedef dsError_t (*dsSetStereoAuto_t)(intptr_t handle,
int autoMode);
2613 static dsSetStereoAuto_t func = 0;
2615 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2617 func = (dsSetStereoAuto_t) dlsym(dllib,
"dsSetStereoAuto");
2619 printf(
"dsSetStereoAuto_t(int, int *) is defined and loaded\r\n");
2622 printf(
"dsSetStereoAuto_t(int, int *) is not defined\r\n");
2627 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2631 if (func != 0 && param != NULL)
2633 if (func(param->handle, param->autoMode) ==
dsERR_NONE)
2635 result = IARM_RESULT_SUCCESS;
2640 _srv_AudioAuto = param->autoMode ? 1 : 0;
2642 IARM_BUS_Unlock(lock);
2643 return IARM_RESULT_SUCCESS;
2646 IARM_Result_t _dsSetAudioDucking(
void *arg)
2650 IARM_BUS_Lock(lock);
2652 bool portEnabled =
false;
2655 printf(
"%s action : %d type :%d val :%d m_volumeLevel:%f \n",__FUNCTION__,param->action,param->type,param->level,m_volumeLevel );
2659 printf(
"%s failed dsIsAudioPortEnabled\n",__FUNCTION__);
2662 if(m_MuteStatus || !portEnabled)
2664 printf(
"%s mute on/port disabled so ignore the duckig request\n",__FUNCTION__);
2665 IARM_BUS_Unlock(lock);
2666 return IARM_RESULT_SUCCESS;
2671 m_isDuckingInProgress =
true;
2674 volume = (m_volumeLevel * param->level) / 100;
2678 if(param->level > m_volumeLevel)
2680 volume = m_volumeLevel;
2684 volume = param->level;
2690 m_isDuckingInProgress =
false;
2691 volume = m_volumeLevel;
2693 printf(
":%s adjusted volume volume :%d m_volumeDuckingLevel :%d\n",__FUNCTION__,volume,m_volumeDuckingLevel );
2698 typedef dsError_t (*dsSetAudioLevel_t)(intptr_t handle,
float level);
2699 static dsSetAudioLevel_t func = 0;
2702 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2704 func = (dsSetAudioLevel_t) dlsym(dllib,
"dsSetAudioLevel");
2706 printf(
"dsSetAudioLevel_t(int, float ) is defined and loaded \r\n");
2709 printf(
"dsSetAudioLevel_t(int, float ) is not defined \r\n");
2714 printf(
"Opening RDK_DSHAL_NAME [%s] failed \r\n", RDK_DSHAL_NAME);
2719 func(param->handle, volume);
2722 if(volume != m_volumeDuckingLevel)
2724 m_volumeDuckingLevel = volume;
2729 mode = _srv_SPDIF_Audiomode;
2732 mode = _srv_HDMI_Audiomode;
2734 printf(
"The Port type is :%d Audio Settings Mode is %d \r\n",_APortType, mode);
2738 eventData.data.AudioLevelInfo.level = 0;
2739 printf(
" IARM_BUS_DSMGR_EVENT_AUDIO_LEVEL_CHANGED PASSTHRU mode volume:%d \n",eventData.data.AudioLevelInfo.level);
2743 eventData.data.AudioLevelInfo.level = volume;
2744 printf(
" IARM_BUS_DSMGR_EVENT_AUDIO_LEVEL_CHANGED volume:%d \n ",eventData.data.AudioLevelInfo.level);
2748 IARM_BUS_Unlock(lock);
2750 return IARM_RESULT_SUCCESS;
2753 IARM_Result_t _dsGetAudioGain(
void *arg)
2755 #ifndef RDK_DSHAL_NAME
2756 #warning "RDK_DSHAL_NAME is not defined"
2757 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
2760 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2761 IARM_BUS_Lock(lock);
2763 typedef dsError_t (*dsGetAudioGain_t)(intptr_t handle,
float *gain);
2764 static dsGetAudioGain_t func = 0;
2766 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2768 func = (dsGetAudioGain_t) dlsym(dllib,
"dsGetAudioGain");
2770 printf(
"dsGetAudioGain_t(int, float *) is defined and loaded\r\n");
2773 printf(
"dsGetAudioGain_t(int, float *) is not defined\r\n");
2778 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2784 if (func != 0 && param != NULL)
2788 if (func(param->handle, &gain) ==
dsERR_NONE)
2791 result = IARM_RESULT_SUCCESS;
2795 IARM_BUS_Unlock(lock);
2799 IARM_Result_t _dsGetAudioLevel(
void *arg)
2801 #ifndef RDK_DSHAL_NAME
2802 #warning "RDK_DSHAL_NAME is not defined"
2803 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
2806 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2807 IARM_BUS_Lock(lock);
2809 typedef dsError_t (*dsGetAudioLevel_t)(intptr_t handle,
float *level);
2810 static dsGetAudioLevel_t func = 0;
2812 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2814 func = (dsGetAudioLevel_t) dlsym(dllib,
"dsGetAudioLevel");
2816 printf(
"dsGetAudioLevel_t(int, float *) is defined and loaded\r\n");
2819 printf(
"dsGetAudioLevel_t(int, float *) is not defined\r\n");
2824 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2830 if (func != 0 && param != NULL)
2834 if (func(param->handle, &level) ==
dsERR_NONE)
2836 param->level = level;
2837 result = IARM_RESULT_SUCCESS;
2841 IARM_BUS_Unlock(lock);
2845 IARM_Result_t _dsSetAudioGain(
void *arg)
2847 #ifndef RDK_DSHAL_NAME
2848 #warning "RDK_DSHAL_NAME is not defined"
2849 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
2852 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2853 IARM_BUS_Lock(lock);
2855 typedef dsError_t (*dsSetAudioGain_t)(intptr_t handle,
float gain);
2856 static dsSetAudioGain_t func = 0;
2858 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2860 func = (dsSetAudioGain_t) dlsym(dllib,
"dsSetAudioGain");
2862 printf(
"dsSetAudioGain_t(int, float ) is defined and loaded\r\n");
2865 printf(
"dsSetAudioGain_t(int, float ) is not defined\r\n");
2870 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2876 if (func != 0 && param != NULL)
2878 if (func(param->handle, param->gain) ==
dsERR_NONE)
2880 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
2881 std::string _AudioGain = std::to_string(param->gain);
2883 switch(_APortType) {
2885 printf(
"%s: port: %s , persist audio gain: %f\n",__func__,
"SPDIF0", param->gain);
2889 printf(
"%s: port: %s , persist audio gain: %f\n",__func__,
"HDMI0", param->gain);
2893 printf(
"%s: port: %s , persist audio gain: %f\n",__func__,
"SPEAKER0", param->gain);
2900 result = IARM_RESULT_SUCCESS;
2904 IARM_BUS_Unlock(lock);
2910 IARM_Result_t _dsSetAudioLevel(
void *arg)
2912 #ifndef RDK_DSHAL_NAME
2913 #warning "RDK_DSHAL_NAME is not defined"
2914 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
2917 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2918 IARM_BUS_Lock(lock);
2920 typedef dsError_t (*dsSetAudioLevel_t)(intptr_t handle,
float level);
2921 static dsSetAudioLevel_t func = 0;
2923 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
2925 func = (dsSetAudioLevel_t) dlsym(dllib,
"dsSetAudioLevel");
2927 printf(
"dsSetAudioLevel_t(int, float ) is defined and loaded\r\n");
2930 printf(
"dsSetAudioLevel_t(int, float ) is not defined\r\n");
2935 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
2941 if (func != 0 && param != NULL)
2943 printf(
"_dsSetAudioLevel param->level :%f m_isDuckingInProgress :%d \n",param->level,m_isDuckingInProgress);
2944 if (m_isDuckingInProgress || func(param->handle, param->level) ==
dsERR_NONE)
2946 m_volumeLevel = (int) param->level;
2947 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
2948 std::string _AudioLevel = std::to_string(param->level);
2950 switch(_APortType) {
2952 printf(
"%s: port: %s , persist audio level: %f\n",__func__,
"SPDIF0", param->level);
2956 printf(
"%s: port: %s , persist audio level: %f\n",__func__,
"HDMI0", param->level);
2960 printf(
"%s: port: %s , persist audio level: %f\n",__func__,
"SPEAKER0", param->level);
2964 printf(
"%s: port: %s , persist audio level: %f\n",__func__,
"HEADPHONE0", param->level);
2971 result = IARM_RESULT_SUCCESS;
2975 IARM_BUS_Unlock(lock);
2981 IARM_Result_t _dsSetAudioMute(
void *arg)
2985 IARM_BUS_Lock(lock);
2987 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
2993 m_MuteStatus = param->mute;
2994 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
2995 std::string _mute = param->mute ?
"TRUE" :
"FALSE";
2997 switch(_APortType) {
2999 printf(
"%s: port: %s , persist audio mute: %s\n",__func__,
"SPDIF0", param->mute ?
"TRUE" :
"FALSE");
3003 printf(
"%s: port: %s , persist audio mute: %s\n",__func__,
"HDMI0", param->mute ?
"TRUE" :
"FALSE");
3007 printf(
"%s: port: %s , persist audio mute: %s\n",__func__,
"SPEAKER0", param->mute ?
"TRUE" :
"FALSE");
3011 printf(
"%s: port: %s , persist audio mute: %s\n",__func__,
"HEADPHONE0", param->mute ?
"TRUE" :
"FALSE");
3018 result = IARM_RESULT_SUCCESS;
3021 IARM_BUS_Unlock(lock);
3027 IARM_Result_t _dsIsAudioMute(
void *arg)
3031 IARM_BUS_Lock(lock);
3033 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3040 param->mute = muted;
3042 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3043 std::string isMuteKey(
"");
3044 std::string _mute(
"FALSE");
3046 switch(_APortType) {
3048 isMuteKey.append(
"SPDIF0.audio.mute");
3051 isMuteKey.append(
"HDMI0.audio.mute");
3054 isMuteKey.append(
"SPEAKER0.audio.mute");
3057 isMuteKey.append(
"HEADPHONE0.audio.mute");
3066 printf(
"%s : Exception in getting the %s from persistence storage\n", __FUNCTION__, isMuteKey.c_str());
3069 if (
"TRUE" == _mute) {
3072 printf(
"%s: persist value:%s for :%s\n", __FUNCTION__, _mute.c_str(), isMuteKey.c_str());
3073 #endif //DS_AUDIO_SETTINGS_PERSISTENCE end
3075 result = IARM_RESULT_SUCCESS;
3078 IARM_BUS_Unlock(lock);
3084 IARM_Result_t _dsIsAudioPortEnabled(
void *arg)
3088 IARM_BUS_Lock(lock);
3090 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3093 bool enabled =
false;
3097 param->enabled = enabled;
3098 result = IARM_RESULT_SUCCESS;
3100 printf(
"%s : returned ret: %04x enabled: %s\n", __FUNCTION__, ret, param->enabled?
"TRUE":
"FALSE");
3102 IARM_BUS_Unlock(lock);
3108 IARM_Result_t _dsEnableAudioPort(
void *arg)
3111 IARM_BUS_Lock(lock);
3113 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3119 result = IARM_RESULT_SUCCESS;
3122 std::string isEnabledAudioPortKey(
"audio.");
3123 isEnabledAudioPortKey.append (param->portName);
3124 isEnabledAudioPortKey.append (
".isEnabled");
3128 bool bAudioPortEnableVerify =
false;
3131 if (bAudioPortEnableVerify != param->enabled) {
3132 printf(
"%s : %s Audio port status verification failed. param->enabled: %d bAudioPortEnableVerify:%d\n",
3133 __FUNCTION__, isEnabledAudioPortKey.c_str(), param->enabled, bAudioPortEnableVerify);
3136 printf(
"%s : %s Audio port status verification passed. status %d\n", __FUNCTION__, isEnabledAudioPortKey.c_str(), param->enabled);
3140 printf(
"%s : %s Audio port status:%s verification step: dsIsAudioPortEnabled call failed\n",
3141 __FUNCTION__, isEnabledAudioPortKey.c_str(), param->enabled?
"TRUE":
"FALSE");
3144 IARM_BUS_Unlock(lock);
3149 IARM_Result_t _dsGetEnablePersist(
void *arg)
3153 IARM_BUS_Lock(lock);
3155 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3159 bool enabled =
true;
3161 std::string isEnabledAudioPortKey(
"audio.");
3162 isEnabledAudioPortKey.append (param->portName);
3163 isEnabledAudioPortKey.append (
".isEnabled");
3164 std::string _AudioPortEnable(
"TRUE");
3165 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3171 printf(
"Init: %s : %s port enable settings not found in persistence store. Try system default\n",__FUNCTION__, isEnabledAudioPortKey.c_str());
3176 _AudioPortEnable =
"TRUE";
3179 if (
"FALSE" == _AudioPortEnable) {
3180 printf(
"%s: persist dsEnableAudioPort value: _AudioPortEnable:%s:\n", __FUNCTION__, _AudioPortEnable.c_str());
3184 printf(
"%s: persist dsEnableAudioPort value: _AudioPortEnable:%s:\n", __FUNCTION__, _AudioPortEnable.c_str());
3188 #endif //DS_AUDIO_SETTINGS_PERSISTENCE end
3190 param->enabled = enabled;
3191 result = IARM_RESULT_SUCCESS;
3192 printf(
"%s: persist dsEnableAudioPort value: %s for the port %s AudioPortEnable: %s result:%d \n",
3193 __FUNCTION__, param->enabled?
"TRUE":
"FALSE", isEnabledAudioPortKey.c_str(), _AudioPortEnable.c_str(), result);
3195 IARM_BUS_Unlock(lock);
3201 IARM_Result_t _dsSetEnablePersist(
void *arg)
3204 IARM_BUS_Lock(lock);
3206 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3210 result = IARM_RESULT_SUCCESS;
3212 std::string isEnabledAudioPortKey(
"audio.");
3213 isEnabledAudioPortKey.append (param->portName);
3214 isEnabledAudioPortKey.append (
".isEnabled");
3215 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3216 printf(
"%s: persist dsEnableAudioPort value: %s for the port %s\n", __FUNCTION__, param->enabled?
"TRUE":
"FALSE", isEnabledAudioPortKey.c_str());
3218 #endif //DS_AUDIO_SETTINGS_PERSISTENCE end
3220 IARM_BUS_Unlock(lock);
3226 IARM_Result_t _dsAudioPortTerm(
void *arg)
3230 IARM_BUS_Lock(lock);
3232 m_isPlatInitialized--;
3234 if (0 == m_isPlatInitialized)
3238 printf(
"_dsAudioPortTerm is not success\r\n");
3242 IARM_BUS_Unlock(lock);
3244 return IARM_RESULT_SUCCESS;
3248 IARM_Result_t _dsGetAudioFormat(
void *arg)
3251 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3252 IARM_BUS_Lock(lock);
3255 static dsGetAudioFormat_t func = 0;
3257 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3259 func = (dsGetAudioFormat_t) dlsym(dllib,
"dsGetAudioFormat");
3261 printf(
"dsGetAudioFormat_t(int, dsAudioFormat_t *) is defined and loaded\r\n");
3264 printf(
"dsGetAudioFormat_t(int, dsAudioFormat_t *) is not defined\r\n");
3269 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3275 if (func != 0 && param != NULL)
3278 param->audioFormat = dsAUDIO_FORMAT_NONE;
3280 if (func(param->handle, &aFormat) ==
dsERR_NONE)
3282 param->audioFormat = aFormat;
3283 result = IARM_RESULT_SUCCESS;
3287 IARM_BUS_Unlock(lock);
3292 IARM_Result_t _dsGetEncoding(
void *arg)
3296 IARM_BUS_Lock(lock);
3298 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3310 result = IARM_RESULT_SUCCESS;
3312 param->encoding = _encoding;
3315 __TIMESTAMP();printf(
"param->encoding = %d\r\n",_encoding);
3319 IARM_BUS_Unlock(lock);
3327 intptr_t halhandle = 0;
3329 numPorts =
dsUTL_DIM(kSupportedPortTypes);
3331 for(i=0; i< numPorts; i++)
3334 if (handle == halhandle)
3336 return kPorts[i].id.type;
3340 __TIMESTAMP();printf(
"Error: The Requested Audio Port is not part of Platform Port Configuration \r\n");
3345 IARM_Result_t _dsIsAudioMSDecode(
void *arg)
3348 IARM_BUS_Unlock(lock);
3350 #ifndef RDK_DSHAL_NAME
3351 #warning "RDK_DSHAL_NAME is not defined"
3352 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3356 IARM_BUS_Lock(lock);
3358 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3359 typedef dsError_t (*dsIsAudioMSDecode_t)(intptr_t handle,
bool *HasMS11Decode);
3360 static dsIsAudioMSDecode_t func = NULL;
3362 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3364 func = (dsIsAudioMSDecode_t) dlsym(dllib,
"dsIsAudioMSDecode");
3366 __TIMESTAMP();printf(
"dsIsAudioMSDecode(int, bool*) is defined and loaded\r\n");
3369 __TIMESTAMP();printf(
"dsIsAudioMSDecode(int, bool*) is not defined\r\n");
3374 __TIMESTAMP();printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3380 bool HasMS11Decode =
false;
3381 dsError_t ret = func(param->handle, &HasMS11Decode);
3383 param->ms11Enabled = HasMS11Decode;
3384 result = IARM_RESULT_SUCCESS;
3387 param->ms11Enabled =
false;
3390 IARM_BUS_Unlock(lock);
3395 IARM_Result_t _dsIsAudioMS12Decode(
void *arg)
3398 IARM_BUS_Unlock(lock);
3400 #ifndef RDK_DSHAL_NAME
3401 #warning "RDK_DSHAL_NAME is not defined"
3402 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3406 IARM_BUS_Lock(lock);
3408 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3409 typedef dsError_t (*dsIsAudioMS12Decode_t)(intptr_t handle,
bool *HasMS12Decode);
3410 static dsIsAudioMS12Decode_t func = NULL;
3412 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3414 func = (dsIsAudioMS12Decode_t) dlsym(dllib,
"dsIsAudioMS12Decode");
3416 __TIMESTAMP();printf(
"dsIsAudioMS12Decode(int, bool*) is defined and loaded\r\n");
3419 __TIMESTAMP();printf(
"dsIsAudioMS12Decode(int, bool*) is not defined\r\n");
3424 __TIMESTAMP();printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3430 bool HasMS12Decode =
false;
3431 dsError_t ret = func(param->handle, &HasMS12Decode);
3433 param->ms12Enabled = HasMS12Decode;
3434 result = IARM_RESULT_SUCCESS;
3437 param->ms12Enabled =
false;
3440 IARM_BUS_Unlock(lock);
3445 IARM_Result_t _dsSetAudioDelay(
void *arg)
3447 #ifndef RDK_DSHAL_NAME
3448 #warning "RDK_DSHAL_NAME is not defined"
3449 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3452 IARM_BUS_Lock(lock);
3454 IARM_Result_t result = IARM_RESULT_SUCCESS;
3455 typedef dsError_t (*dsSetAudioDelay_t)(intptr_t handle, uint32_t audioDelayMs);
3456 static dsSetAudioDelay_t func = 0;
3458 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3460 func = (dsSetAudioDelay_t) dlsym(dllib,
"dsSetAudioDelay");
3462 printf(
"dsSetAudioDelay_t(int, uint32_t) is defined and loaded\r\n");
3465 printf(
"dsSetAudioDelay_t(int, uint32_t) is not defined\r\n");
3470 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3476 if (func != 0 && param != NULL)
3478 if (func(param->handle, param->audioDelayMs) !=
dsERR_NONE)
3480 __TIMESTAMP();printf(
"%s: (SERVER) Unable to set audiodelay\n", __FUNCTION__);
3481 result = IARM_RESULT_INVALID_STATE;
3484 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3485 std::string _AudioDelay = std::to_string(param->audioDelayMs);
3487 switch(_APortType) {
3489 printf(
"%s: port: %s , persist audio delay: %d\n",__func__,
"SPDIF0", param->audioDelayMs);
3493 printf(
"%s: port: %s , persist audio delay: %d\n",__func__,
"HDMI0", param->audioDelayMs);
3497 printf(
"%s: port: %s , persist audio delay: %d\n",__func__,
"SPEAKER0", param->audioDelayMs);
3500 case dsAUDIOPORT_TYPE_HDMI_ARC:
3501 printf(
"%s: port: %s , persist audio delay: %d\n",__func__,
"HDMI_ARC0", param->audioDelayMs);
3505 printf(
"%s: port: UNKNOWN , persist audio delay: %d : NOT SET\n",__func__, param->audioDelayMs);
3511 result = IARM_RESULT_INVALID_STATE;
3514 IARM_BUS_Unlock(lock);
3519 IARM_Result_t _dsGetAudioDelay(
void *arg)
3521 #ifndef RDK_DSHAL_NAME
3522 #warning "RDK_DSHAL_NAME is not defined"
3523 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3526 IARM_BUS_Lock(lock);
3528 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3529 typedef dsError_t (*dsGetAudioDelay_t)(intptr_t handle, uint32_t *audioDelayMs);
3530 static dsGetAudioDelay_t func = 0;
3532 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3534 func = (dsGetAudioDelay_t) dlsym(dllib,
"dsGetAudioDelay");
3536 printf(
"dsGetAudioDelay_t(int, uint32_t*) is defined and loaded\r\n");
3539 printf(
"dsGetAudioDelay_t(int, uint32_t*) is not defined\r\n");
3544 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3550 if (func != 0 && param != NULL)
3552 uint32_t audioDelayMs = 0;
3553 param->audioDelayMs = 0;
3554 if (func(param->handle, &audioDelayMs) ==
dsERR_NONE)
3556 param->audioDelayMs = audioDelayMs;
3557 result = IARM_RESULT_SUCCESS;
3561 IARM_BUS_Unlock(lock);
3565 IARM_Result_t _dsSetAudioDelayOffset(
void *arg)
3567 #ifndef RDK_DSHAL_NAME
3568 #warning "RDK_DSHAL_NAME is not defined"
3569 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3572 IARM_BUS_Lock(lock);
3574 IARM_Result_t result = IARM_RESULT_SUCCESS;
3575 typedef dsError_t (*dsSetAudioDelayOffset_t)(intptr_t handle, uint32_t audioDelayOffsetMs);
3576 static dsSetAudioDelayOffset_t func = 0;
3578 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3580 func = (dsSetAudioDelayOffset_t) dlsym(dllib,
"dsSetAudioDelayOffset");
3582 printf(
"dsSetAudioDelayOffset_t(int, uint32_t) is defined and loaded\r\n");
3585 printf(
"dsSetAudioDelayOffset_t(int, uint32_t) is not defined\r\n");
3590 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3596 if (func != 0 && param != NULL)
3598 if (func(param->handle, param->audioDelayOffsetMs) !=
dsERR_NONE)
3600 __TIMESTAMP();printf(
"%s: (SERVER) Unable to set audiodelay offset\n", __FUNCTION__);
3601 result = IARM_RESULT_INVALID_STATE;
3603 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3604 std::string _AudioDelayOffset = std::to_string(param->audioDelayOffsetMs);
3606 switch(_APortType) {
3608 printf(
"%s: port: %s , persist audio delay offset ms: %d\n",__func__,
"SPDIF0", param->audioDelayOffsetMs);
3612 printf(
"%s: port: %s , persist audio delay offset ms: %d\n",__func__,
"HDMI0", param->audioDelayOffsetMs);
3616 printf(
"%s: port: %s , persist audio delay offset ms: %d\n",__func__,
"SPEAKER0", param->audioDelayOffsetMs);
3619 case dsAUDIOPORT_TYPE_HDMI_ARC:
3620 printf(
"%s: port: %s , persist audio delay: %d\n",__func__,
"HDMI_ARC0", param->audioDelayOffsetMs);
3629 result = IARM_RESULT_INVALID_STATE;
3632 IARM_BUS_Unlock(lock);
3637 IARM_Result_t _dsGetAudioDelayOffset(
void *arg)
3639 #ifndef RDK_DSHAL_NAME
3640 #warning "RDK_DSHAL_NAME is not defined"
3641 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3644 IARM_BUS_Lock(lock);
3646 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3647 typedef dsError_t (*dsGetAudioDelayOffset_t)(intptr_t handle, uint32_t *audioDelayOffsetMs);
3648 static dsGetAudioDelayOffset_t func = 0;
3650 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3652 func = (dsGetAudioDelayOffset_t) dlsym(dllib,
"dsGetAudioDelayOffset");
3654 printf(
"dsGetAudioDelayOffset_t(int, uint32_t*) is defined and loaded\r\n");
3657 printf(
"dsGetAudioDelayOffset_t(int, uint32_t*) is not defined\r\n");
3662 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3668 if (func != 0 && param != NULL)
3670 uint32_t audioDelayOffsetMs = 0;
3671 param->audioDelayOffsetMs = 0;
3672 if (func(param->handle, &audioDelayOffsetMs) ==
dsERR_NONE)
3674 param->audioDelayOffsetMs = audioDelayOffsetMs;
3675 result = IARM_RESULT_SUCCESS;
3679 IARM_BUS_Unlock(lock);
3683 IARM_Result_t _dsSetAudioAtmosOutputMode(
void *arg)
3685 #ifndef RDK_DSHAL_NAME
3686 #warning "RDK_DSHAL_NAME is not defined"
3687 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3690 IARM_BUS_Lock(lock);
3692 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3693 typedef dsError_t (*dsSetAudioAtmosOutputMode_t)(intptr_t handle,
bool enable);
3694 static dsSetAudioAtmosOutputMode_t func = 0;
3696 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3698 func = (dsSetAudioAtmosOutputMode_t) dlsym(dllib,
"dsSetAudioAtmosOutputMode");
3700 printf(
"dsSetAudioAtmosOutputMode_t (intptr_t handle, bool enable ) is defined and loaded\r\n");
3703 printf(
"dsSetAudioAtmosOutputMode_t (intptr_t handle, bool enable) is not defined\r\n");
3708 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3714 if (func != 0 && param != NULL)
3716 if(func(param->handle, param->enable) ==
dsERR_NONE) {
3717 result = IARM_RESULT_SUCCESS;
3721 IARM_BUS_Unlock(lock);
3725 IARM_Result_t _dsGetSinkDeviceAtmosCapability(
void *arg)
3727 #ifndef RDK_DSHAL_NAME
3728 #warning "RDK_DSHAL_NAME is not defined"
3729 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3732 IARM_BUS_Lock(lock);
3734 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3735 typedef dsError_t (*dsGetSinkDeviceAtmosCapability_t)(intptr_t handle, dsATMOSCapability_t *capability);
3736 static dsGetSinkDeviceAtmosCapability_t func = 0;
3738 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3740 func = (dsGetSinkDeviceAtmosCapability_t) dlsym(dllib,
"dsGetSinkDeviceAtmosCapability");
3742 printf(
"dsGetSinkDeviceAtmosCapability_t (intptr_t handle, dsATMOSCapability_t *capability ) is defined and loaded\r\n");
3745 printf(
"dsGetSinkDeviceAtmosCapability_t (intptr_t handle, dsATMOSCapability_t *capability ) is not defined\r\n");
3750 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3756 if (func != 0 && param != NULL)
3761 if (func(param->handle, &capability) ==
dsERR_NONE)
3763 param->capability = capability;
3764 result = IARM_RESULT_SUCCESS;
3768 IARM_BUS_Unlock(lock);
3772 IARM_Result_t _dsSetAudioCompression(
void *arg)
3774 #ifndef RDK_DSHAL_NAME
3775 #warning "RDK_DSHAL_NAME is not defined"
3776 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3779 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3780 IARM_BUS_Lock(lock);
3782 typedef dsError_t (*dsSetAudioCompression_t)(intptr_t handle,
int compressionLevel);
3783 static dsSetAudioCompression_t func = 0;
3785 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3787 func = (dsSetAudioCompression_t) dlsym(dllib,
"dsSetAudioCompression");
3789 printf(
"dsSetAudioCompression_t(int, int ) is defined and loaded\r\n");
3792 printf(
"dsSetAudioCompression_t(int, int) is not defined\r\n");
3797 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3803 if (func != 0 && param != NULL)
3805 if (func(param->handle, param->compression) ==
dsERR_NONE)
3807 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3808 std::string _Compression = std::to_string(param->compression);
3809 printf(
"%s: persist audio compression: %d\n",__func__, param->compression);
3812 result = IARM_RESULT_SUCCESS;
3816 IARM_BUS_Unlock(lock);
3820 IARM_Result_t _dsGetAudioCompression(
void *arg)
3822 #ifndef RDK_DSHAL_NAME
3823 #warning "RDK_DSHAL_NAME is not defined"
3824 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3827 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3828 IARM_BUS_Lock(lock);
3830 typedef dsError_t (*dsGetAudioCompression_t)(intptr_t handle,
int *compressionLevel);
3831 static dsGetAudioCompression_t func = 0;
3833 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3835 func = (dsGetAudioCompression_t) dlsym(dllib,
"dsGetAudioCompression");
3837 printf(
"dsGetAudioCompression_t(int, int *) is defined and loaded\r\n");
3840 printf(
"dsGetAudioCompression_t(int, int *) is not defined\r\n");
3845 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3851 if (func != 0 && param != NULL)
3853 int compression = 0;
3854 param->compression= 0;
3855 if (func(param->handle, &compression) ==
dsERR_NONE)
3857 param->compression = compression;
3858 result = IARM_RESULT_SUCCESS;
3862 IARM_BUS_Unlock(lock);
3866 IARM_Result_t _dsSetDialogEnhancement(
void *arg)
3868 #ifndef RDK_DSHAL_NAME
3869 #warning "RDK_DSHAL_NAME is not defined"
3870 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3873 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3874 IARM_BUS_Lock(lock);
3877 result = _setDialogEnhancement(param->handle, param->enhancerLevel);
3878 IARM_BUS_Unlock(lock);
3882 static IARM_Result_t _setDialogEnhancement(intptr_t handle,
int enhancerLevel)
3884 typedef dsError_t (*dsSetDialogEnhancement_t)(intptr_t handle,
int enhancerLevel);
3885 static dsSetDialogEnhancement_t func = 0;
3886 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3889 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3891 func = (dsSetDialogEnhancement_t) dlsym(dllib,
"dsSetDialogEnhancement");
3893 printf(
"dsSetDialogEnhancement_t(int, int) is defined and loaded\r\n");
3896 printf(
"dsSetDialogEnhancement_t(int, int ) is not defined\r\n");
3901 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3905 std::string _Property = _dsGetCurrentProfileProperty(
"EnhancerLevel");
3908 if (func(handle, enhancerLevel) ==
dsERR_NONE)
3910 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
3911 std::string _EnhancerLevel = std::to_string(enhancerLevel);
3912 printf(
"%s: persist enhancer level: %d\n",__func__, enhancerLevel);
3915 result = IARM_RESULT_SUCCESS;
3922 IARM_Result_t _dsGetDialogEnhancement(
void *arg)
3924 #ifndef RDK_DSHAL_NAME
3925 #warning "RDK_DSHAL_NAME is not defined"
3926 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3929 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3930 IARM_BUS_Lock(lock);
3932 typedef dsError_t (*dsGetDialogEnhancement_t)(intptr_t handle,
int *enhancerLevel);
3933 static dsGetDialogEnhancement_t func = 0;
3935 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3937 func = (dsGetDialogEnhancement_t) dlsym(dllib,
"dsGetDialogEnhancement");
3939 printf(
"dsGetDialogEnhancement_t(int, int *) is defined and loaded\r\n");
3942 printf(
"dsGetDialogEnhancement_t(int, int *) is not defined\r\n");
3947 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
3953 if (func != 0 && param != NULL)
3955 int enhancerLevel = 0;
3956 param->enhancerLevel = 0;
3957 if (func(param->handle, &enhancerLevel) ==
dsERR_NONE)
3959 param->enhancerLevel = enhancerLevel;
3960 result = IARM_RESULT_SUCCESS;
3964 IARM_BUS_Unlock(lock);
3969 IARM_Result_t _dsSetDolbyVolumeMode(
void *arg)
3971 #ifndef RDK_DSHAL_NAME
3972 #warning "RDK_DSHAL_NAME is not defined"
3973 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
3976 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
3977 IARM_BUS_Lock(lock);
3979 typedef dsError_t (*dsSetDolbyVolumeMode_t)(intptr_t handle,
bool enable);
3980 static dsSetDolbyVolumeMode_t func = 0;
3982 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
3984 func = (dsSetDolbyVolumeMode_t) dlsym(dllib,
"dsSetDolbyVolumeMode");
3986 printf(
"dsSetDolbyVolumeMode_t(int, bool) is defined and loaded\r\n");
3989 printf(
"dsSetDolbyVolumeMode_t(int, bool) is not defined\r\n");
3994 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4000 if (func != 0 && param != NULL)
4002 if (func(param->handle, param->enable) ==
dsERR_NONE)
4004 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4005 printf(
"%s: persist dolby volume mode: %s\n",__func__, param->enable ?
"TRUE":
"FALSE");
4008 result = IARM_RESULT_SUCCESS;
4012 IARM_BUS_Unlock(lock);
4016 IARM_Result_t _dsGetDolbyVolumeMode(
void *arg)
4018 #ifndef RDK_DSHAL_NAME
4019 #warning "RDK_DSHAL_NAME is not defined"
4020 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4023 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4024 IARM_BUS_Lock(lock);
4026 typedef dsError_t (*dsGetDolbyVolumeMode_t)(intptr_t handle,
bool *enable);
4027 static dsGetDolbyVolumeMode_t func = 0;
4029 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4031 func = (dsGetDolbyVolumeMode_t) dlsym(dllib,
"dsGetDolbyVolumeMode");
4033 printf(
"dsGetDolbyVolumeMode_t(int, bool *) is defined and loaded\r\n");
4036 printf(
"dsGetDolbyVolumeMode_t(int, bool *) is not defined\r\n");
4041 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4046 bool enable =
false;
4048 if (func != 0 && param != NULL)
4050 param->enable =
false;
4051 if (func(param->handle, &enable) ==
dsERR_NONE)
4053 param->enable = enable;
4054 result = IARM_RESULT_SUCCESS;
4058 IARM_BUS_Unlock(lock);
4062 IARM_Result_t _dsSetIntelligentEqualizerMode(
void *arg)
4064 #ifndef RDK_DSHAL_NAME
4065 #warning "RDK_DSHAL_NAME is not defined"
4066 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4069 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4070 IARM_BUS_Lock(lock);
4072 typedef dsError_t (*dsSetIntelligentEqualizerMode_t)(intptr_t handle,
int mode);
4073 static dsSetIntelligentEqualizerMode_t func = 0;
4075 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4077 func = (dsSetIntelligentEqualizerMode_t) dlsym(dllib,
"dsSetIntelligentEqualizerMode");
4079 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is defined and loaded\r\n");
4082 printf(
"dsSetIntelligentEqualizerMode_t(int, int) is not defined\r\n");
4087 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4093 if (func != 0 && param != NULL)
4095 if (func(param->handle, param->mode) ==
dsERR_NONE)
4097 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4098 std::string _IntelligentEQ = std::to_string(param->mode);
4099 printf(
"%s: persist intelligent equalizer value: %d\n",__func__, param->mode);
4102 result = IARM_RESULT_SUCCESS;
4106 IARM_BUS_Unlock(lock);
4111 IARM_Result_t _dsGetIntelligentEqualizerMode(
void *arg)
4113 #ifndef RDK_DSHAL_NAME
4114 #warning "RDK_DSHAL_NAME is not defined"
4115 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4118 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4119 IARM_BUS_Lock(lock);
4121 typedef dsError_t (*dsGetIntelligentEqualizerMode_t)(intptr_t handle,
int *mode);
4122 static dsGetIntelligentEqualizerMode_t func = 0;
4124 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4126 func = (dsGetIntelligentEqualizerMode_t) dlsym(dllib,
"dsGetIntelligentEqualizerMode");
4128 printf(
"dsGetIntelligentEqualizerMode_t(int, int *) is defined and loaded\r\n");
4131 printf(
"dsGetIntelligentEqualizerMode_t(int, int *) is not defined\r\n");
4136 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4142 if (func != 0 && param != NULL)
4146 if (func(param->handle, &mode) ==
dsERR_NONE)
4149 result = IARM_RESULT_SUCCESS;
4153 IARM_BUS_Unlock(lock);
4158 IARM_Result_t _dsGetVolumeLeveller(
void *arg)
4160 #ifndef RDK_DSHAL_NAME
4161 #warning "RDK_DSHAL_NAME is not defined"
4162 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4165 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4166 IARM_BUS_Lock(lock);
4169 static dsGetVolumeLeveller_t func = 0;
4171 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4173 func = (dsGetVolumeLeveller_t) dlsym(dllib,
"dsGetVolumeLeveller");
4175 printf(
"dsGetVolumeLeveller_t(int, dsVolumeLeveller_t *) is defined and loaded\r\n");
4178 printf(
"dsGetVolumeLeveller_t(int, dsVolumeLeveller_t *) is not defined\r\n");
4183 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4189 if (func != 0 && param != NULL)
4192 volLeveller.mode = 0;
4193 volLeveller.level = 0;
4194 param->volLeveller.mode = 0;
4195 param->volLeveller.level = 0;
4196 if (func(param->handle, &volLeveller) ==
dsERR_NONE)
4198 param->volLeveller.mode = volLeveller.mode;
4199 param->volLeveller.level = volLeveller.level;
4200 result = IARM_RESULT_SUCCESS;
4204 IARM_BUS_Unlock(lock);
4209 IARM_Result_t _dsSetVolumeLeveller(
void *arg)
4211 #ifndef RDK_DSHAL_NAME
4212 #warning "RDK_DSHAL_NAME is not defined"
4213 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4216 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4217 IARM_BUS_Lock(lock);
4221 result = _setVolumeLeveller(param->handle, param->volLeveller.mode, param->volLeveller.level);
4222 IARM_BUS_Unlock(lock);
4226 static IARM_Result_t _setVolumeLeveller(intptr_t handle,
int volLevellerMode,
int volLevellerLevel)
4229 static dsSetVolumeLeveller_t func = 0;
4230 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4233 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4235 func = (dsSetVolumeLeveller_t) dlsym(dllib,
"dsSetVolumeLeveller");
4237 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is defined and loaded\r\n");
4240 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is not defined\r\n");
4245 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4251 param.handle = handle;
4252 param.volLeveller.mode = volLevellerMode;
4253 param.volLeveller.level = volLevellerLevel;
4257 if (func(param.handle, param.volLeveller) ==
dsERR_NONE)
4259 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4260 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
4261 std::string _Propertylevel = _dsGetCurrentProfileProperty(
"VolumeLeveller.level");
4262 std::string _mode = std::to_string(param.volLeveller.mode);
4263 printf(
"%s: persist volume leveller mode: %d\n",__func__, param.volLeveller.mode);
4266 if((param.volLeveller.mode == 0) || (param.volLeveller.mode == 1)) {
4267 std::string _level = std::to_string(param.volLeveller.level);
4268 printf(
"%s: persist volume leveller value: %d\n",__func__, param.volLeveller.level);
4272 result = IARM_RESULT_SUCCESS;
4280 IARM_Result_t _dsGetBassEnhancer(
void *arg)
4282 #ifndef RDK_DSHAL_NAME
4283 #warning "RDK_DSHAL_NAME is not defined"
4284 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4287 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4288 IARM_BUS_Lock(lock);
4290 typedef dsError_t (*dsGetBassEnhancer_t)(intptr_t handle,
int *boost);
4291 static dsGetBassEnhancer_t func = 0;
4293 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4295 func = (dsGetBassEnhancer_t) dlsym(dllib,
"dsGetBassEnhancer");
4297 printf(
"dsGetBassEnhancer_t(int, int *) is defined and loaded\r\n");
4300 printf(
"dsGetBassEnhancer_t(int, int *) is not defined\r\n");
4305 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4311 if (func != 0 && param != NULL)
4314 if (func(param->handle, &boost) ==
dsERR_NONE)
4316 param->boost = boost;
4317 result = IARM_RESULT_SUCCESS;
4321 IARM_BUS_Unlock(lock);
4326 IARM_Result_t _dsSetBassEnhancer(
void *arg)
4328 #ifndef RDK_DSHAL_NAME
4329 #warning "RDK_DSHAL_NAME is not defined"
4330 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4333 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4334 IARM_BUS_Lock(lock);
4337 result = _setBassEnhancer(param->handle, param->boost);
4338 IARM_BUS_Unlock(lock);
4342 static IARM_Result_t _setBassEnhancer(intptr_t handle ,
int boost)
4344 typedef dsError_t (*dsSetBassEnhancer_t)(intptr_t handle,
int boost);
4345 static dsSetBassEnhancer_t func = 0;
4346 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4349 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4351 func = (dsSetBassEnhancer_t) dlsym(dllib,
"dsSetBassEnhancer");
4353 printf(
"dsSetBassEnhancer_t(int, int) is defined and loaded\r\n");
4356 printf(
"dsSetBassEnhancer_t(int, int) is not defined\r\n");
4361 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4369 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4370 std::string _BassBoost = std::to_string(boost);
4371 printf(
"%s: persist boost value: %d\n",__func__, boost);
4374 result = IARM_RESULT_SUCCESS;
4382 IARM_Result_t _dsIsSurroundDecoderEnabled(
void *arg)
4384 #ifndef RDK_DSHAL_NAME
4385 #warning "RDK_DSHAL_NAME is not defined"
4386 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4389 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4390 IARM_BUS_Lock(lock);
4392 typedef dsError_t (*dsIsSurroundDecoderEnabled_t)(intptr_t handle,
bool *enabled);
4393 static dsIsSurroundDecoderEnabled_t func = 0;
4395 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4397 func = (dsIsSurroundDecoderEnabled_t) dlsym(dllib,
"dsIsSurroundDecoderEnabled");
4399 printf(
"dsIsSurroundDecoderEnabled_t(int, bool *) is defined and loaded\r\n");
4402 printf(
"dsIsSurroundDecoderEnabled_t(int, bool *) is not defined\r\n");
4407 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4412 bool enable =
false;
4414 if (func != 0 && param != NULL)
4416 param->enable =
false;
4417 if (func(param->handle, &enable) ==
dsERR_NONE)
4419 param->enable = enable;
4420 result = IARM_RESULT_SUCCESS;
4425 IARM_BUS_Unlock(lock);
4429 IARM_Result_t _dsEnableSurroundDecoder(
void *arg)
4431 #ifndef RDK_DSHAL_NAME
4432 #warning "RDK_DSHAL_NAME is not defined"
4433 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4436 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4437 IARM_BUS_Lock(lock);
4439 typedef dsError_t (*dsEnableSurroundDecoder_t)(intptr_t handle,
bool enabled);
4440 static dsEnableSurroundDecoder_t func = 0;
4442 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4444 func = (dsEnableSurroundDecoder_t) dlsym(dllib,
"dsEnableSurroundDecoder");
4446 printf(
"dsEnableSurroundDecoder_t(int, bool) is defined and loaded\r\n");
4449 printf(
"dsEnableSurroundDecoder_t(int, bool) is not defined\r\n");
4454 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4460 if (func != 0 && param != NULL)
4462 if (func(param->handle, param->enable) ==
dsERR_NONE)
4464 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4465 printf(
"%s: persist surround decoder value: %s\n",__func__, param->enable ?
"TRUE":
"FALSE");
4468 result = IARM_RESULT_SUCCESS;
4472 IARM_BUS_Unlock(lock);
4477 IARM_Result_t _dsGetDRCMode(
void *arg)
4479 #ifndef RDK_DSHAL_NAME
4480 #warning "RDK_DSHAL_NAME is not defined"
4481 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4484 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4485 IARM_BUS_Lock(lock);
4487 typedef dsError_t (*dsGetDRCMode_t)(intptr_t handle,
int *mode);
4488 static dsGetDRCMode_t func = 0;
4490 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4492 func = (dsGetDRCMode_t) dlsym(dllib,
"dsGetDRCMode");
4494 printf(
"dsGetDRCMode_t(int, int *) is defined and loaded\r\n");
4497 printf(
"dsGetDRCMode_t(int, int *) is not defined\r\n");
4502 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4508 if (func != 0 && param != NULL)
4512 if (func(param->handle, &mode) ==
dsERR_NONE)
4515 result = IARM_RESULT_SUCCESS;
4519 IARM_BUS_Unlock(lock);
4524 IARM_Result_t _dsSetDRCMode(
void *arg)
4526 #ifndef RDK_DSHAL_NAME
4527 #warning "RDK_DSHAL_NAME is not defined"
4528 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4531 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4532 IARM_BUS_Lock(lock);
4534 typedef dsError_t (*dsSetDRCMode_t)(intptr_t handle,
int mode);
4535 static dsSetDRCMode_t func = 0;
4537 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4539 func = (dsSetDRCMode_t) dlsym(dllib,
"dsSetDRCMode");
4541 printf(
"dsSetDRCMode_t(int, int) is defined and loaded\r\n");
4544 printf(
"dsSetDRCMode_t(int, int) is not defined\r\n");
4549 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4555 if (func != 0 && param != NULL)
4557 if (func(param->handle, param->mode) ==
dsERR_NONE)
4559 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4560 printf(
"%s: persist DRC Mode value: %s\n",__func__, param->mode ?
"RF":
"Line");
4563 result = IARM_RESULT_SUCCESS;
4567 IARM_BUS_Unlock(lock);
4571 IARM_Result_t _dsGetSurroundVirtualizer(
void *arg)
4573 #ifndef RDK_DSHAL_NAME
4574 #warning "RDK_DSHAL_NAME is not defined"
4575 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4578 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4579 IARM_BUS_Lock(lock);
4582 static dsGetSurroundVirtualizer_t func = 0;
4584 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4586 func = (dsGetSurroundVirtualizer_t) dlsym(dllib,
"dsGetSurroundVirtualizer");
4588 printf(
"dsGetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t *) is defined and loaded\r\n");
4591 printf(
"dsGetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t *) is not defined\r\n");
4596 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4602 if (func != 0 && param != NULL)
4605 virtualizer.mode = 0;
4606 virtualizer.boost = 0;
4607 param->virtualizer.mode = 0;
4608 param->virtualizer.boost = 0;
4609 if (func(param->handle, &virtualizer) ==
dsERR_NONE)
4611 param->virtualizer.mode = virtualizer.mode;
4612 param->virtualizer.boost = virtualizer.boost;
4613 result = IARM_RESULT_SUCCESS;
4617 IARM_BUS_Unlock(lock);
4622 IARM_Result_t _dsSetSurroundVirtualizer(
void *arg)
4624 #ifndef RDK_DSHAL_NAME
4625 #warning "RDK_DSHAL_NAME is not defined"
4626 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4629 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4630 IARM_BUS_Lock(lock);
4634 result = _setSurroundVirtualizer(param->handle, param->virtualizer.mode, param->virtualizer.boost);
4635 IARM_BUS_Unlock(lock);
4639 static IARM_Result_t _setSurroundVirtualizer(intptr_t handle ,
int virtualizerMode ,
int virtualizerBoost)
4642 static dsSetSurroundVirtualizer_t func = 0;
4643 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4646 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4648 func = (dsSetSurroundVirtualizer_t) dlsym(dllib,
"dsSetSurroundVirtualizer");
4650 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is defined and loaded\r\n");
4653 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is not defined\r\n");
4658 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4663 param.handle = handle;
4664 param.virtualizer.mode = virtualizerMode;
4665 param.virtualizer.boost = virtualizerBoost;
4669 if (func(param.handle, param.virtualizer) ==
dsERR_NONE)
4671 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4672 std::string _mode = std::to_string(param.virtualizer.mode);
4673 printf(
"%s: persist surround virtualizer mode: %d\n",__func__, param.virtualizer.mode);
4674 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
4675 std::string _Propertylevel = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.boost");
4678 if(((param.virtualizer.mode) >= 0) && ((param.virtualizer.mode) <= 2)) {
4679 std::string _boost = std::to_string(param.virtualizer.boost);
4680 printf(
"%s: persist surround virtualizer boost value: %d\n",__func__, param.virtualizer.boost);
4684 result = IARM_RESULT_SUCCESS;
4688 IARM_BUS_Unlock(lock);
4693 IARM_Result_t _dsGetMISteering(
void *arg)
4695 #ifndef RDK_DSHAL_NAME
4696 #warning "RDK_DSHAL_NAME is not defined"
4697 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4700 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4701 IARM_BUS_Lock(lock);
4703 typedef dsError_t (*dsGetMISteering_t)(intptr_t handle,
bool *enabled);
4704 static dsGetMISteering_t func = 0;
4706 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4708 func = (dsGetMISteering_t) dlsym(dllib,
"dsGetMISteering");
4710 printf(
"dsGetMISteering_t(int, bool *) is defined and loaded\r\n");
4713 printf(
"dsGetMISteering_t(int, bool *) is not defined\r\n");
4718 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4723 bool enable =
false;
4724 if (func != 0 && param != NULL)
4726 param->enable =
false;
4727 if (func(param->handle, &enable) ==
dsERR_NONE)
4729 param->enable = enable;
4730 result = IARM_RESULT_SUCCESS;
4734 IARM_BUS_Unlock(lock);
4739 IARM_Result_t _dsSetMISteering(
void *arg)
4741 #ifndef RDK_DSHAL_NAME
4742 #warning "RDK_DSHAL_NAME is not defined"
4743 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4746 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4747 IARM_BUS_Lock(lock);
4749 typedef dsError_t (*dsSetMISteering_t)(intptr_t handle,
bool enabled);
4750 static dsSetMISteering_t func = 0;
4752 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4754 func = (dsSetMISteering_t) dlsym(dllib,
"dsSetMISteering");
4756 printf(
"dsSetMISteering_t(int, bool) is defined and loaded\r\n");
4759 printf(
"dsSetMISteering_t(int, bool) is not defined\r\n");
4764 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4770 if (func != 0 && param != NULL)
4772 if (func(param->handle, param->enable) ==
dsERR_NONE)
4774 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4775 printf(
"%s: persist MISteering value: %s\n", __func__, param->enable ?
"Enabled":
"Disabled");
4778 result = IARM_RESULT_SUCCESS;
4782 IARM_BUS_Unlock(lock);
4787 IARM_Result_t _dsSetGraphicEqualizerMode(
void *arg)
4789 #ifndef RDK_DSHAL_NAME
4790 #warning "RDK_DSHAL_NAME is not defined"
4791 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4794 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4795 IARM_BUS_Lock(lock);
4797 typedef dsError_t (*dsSetGraphicEqualizerMode_t)(intptr_t handle,
int mode);
4798 static dsSetGraphicEqualizerMode_t func = 0;
4800 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4802 func = (dsSetGraphicEqualizerMode_t) dlsym(dllib,
"dsSetGraphicEqualizerMode");
4804 printf(
"dsSetGraphicEqualizerMode_t(int, int) is defined and loaded\r\n");
4807 printf(
"dsSetGraphicEqualizerMode_t(int, int) is not defined\r\n");
4812 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4818 if (func != 0 && param != NULL)
4820 if (func(param->handle, param->mode) ==
dsERR_NONE)
4822 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
4823 std::string _GraphicEQ = std::to_string(param->mode);
4824 printf(
"%s: persist graphic equalizer value: %d\n",__func__, param->mode);
4827 result = IARM_RESULT_SUCCESS;
4831 IARM_BUS_Unlock(lock);
4836 IARM_Result_t _dsGetGraphicEqualizerMode(
void *arg)
4838 #ifndef RDK_DSHAL_NAME
4839 #warning "RDK_DSHAL_NAME is not defined"
4840 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4843 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4844 IARM_BUS_Lock(lock);
4846 typedef dsError_t (*dsGetGraphicEqualizerMode_t)(intptr_t handle,
int *mode);
4847 static dsGetGraphicEqualizerMode_t func = 0;
4849 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4851 func = (dsGetGraphicEqualizerMode_t) dlsym(dllib,
"dsGetGraphicEqualizerMode");
4853 printf(
"dsGetGraphicEqualizerMode_t(int, int *) is defined and loaded\r\n");
4856 printf(
"dsGetGraphicEqualizerMode_t(int, int *) is not defined\r\n");
4861 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4867 if (func != 0 && param != NULL)
4871 if (func(param->handle, &mode) ==
dsERR_NONE)
4874 result = IARM_RESULT_SUCCESS;
4878 IARM_BUS_Unlock(lock);
4883 IARM_Result_t _dsGetMS12AudioProfileList(
void *arg)
4885 #ifndef RDK_DSHAL_NAME
4886 #warning "RDK_DSHAL_NAME is not defined"
4887 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4890 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4891 IARM_BUS_Lock(lock);
4894 static dsGetMS12AudioProfileList_t func = 0;
4896 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4898 func = (dsGetMS12AudioProfileList_t) dlsym(dllib,
"dsGetMS12AudioProfileList");
4900 printf(
"dsGetMS12AudioProfileList_t(int, dsMS12AudioProfileList_t*) is defined and loaded\r\n");
4903 printf(
"dsGetMS12AudioProfileList_t(int, dsMS12AudioProfileList_t*) is not defined\r\n");
4908 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4915 if (func != 0 && param != NULL)
4917 ret = func(param->handle, &pList);
4920 printf(
"%s: Total number of supported profiles: %d\n",__FUNCTION__, pList.audioProfileCount);
4921 printf(
"%s: Profile List: %s\n",__FUNCTION__, pList.audioProfileList);
4923 param->profileList.audioProfileCount = pList.audioProfileCount;
4925 result = IARM_RESULT_SUCCESS;
4929 IARM_BUS_Unlock(lock);
4934 IARM_Result_t _dsGetMS12AudioProfile(
void *arg)
4936 #ifndef RDK_DSHAL_NAME
4937 #warning "RDK_DSHAL_NAME is not defined"
4938 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4942 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4943 IARM_BUS_Lock(lock);
4945 typedef dsError_t (*dsGetMS12AudioProfile_t)(intptr_t handle,
char* profile);
4946 static dsGetMS12AudioProfile_t func = 0;
4948 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4950 func = (dsGetMS12AudioProfile_t) dlsym(dllib,
"dsGetMS12AudioProfile");
4952 printf(
"dsGetMS12AudioProfile_t(int, char* ) is defined and loaded\r\n");
4955 printf(
"dsGetMS12AudioProfile_t(int, char*) is not defined\r\n");
4960 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
4965 char m_profile[MAX_PROFILE_STRING_LEN] = {0};
4966 if (func != 0 && param != NULL)
4968 if (func(param->handle, m_profile) ==
dsERR_NONE)
4970 rc = strcpy_s(param->profile,
sizeof(param->profile), m_profile);
4975 result = IARM_RESULT_SUCCESS;
4979 IARM_BUS_Unlock(lock);
4984 IARM_Result_t _dsSetMS12AudioProfile(
void *arg)
4986 #ifndef RDK_DSHAL_NAME
4987 #warning "RDK_DSHAL_NAME is not defined"
4988 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
4991 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
4992 IARM_BUS_Lock(lock);
4994 typedef dsError_t (*dsSetMS12AudioProfile_t)(intptr_t handle,
const char* profile);
4995 static dsSetMS12AudioProfile_t func = 0;
4997 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
4999 func = (dsSetMS12AudioProfile_t) dlsym(dllib,
"dsSetMS12AudioProfile");
5001 printf(
"dsSetMS12AudioProfile_t(int, const char*) is defined and loaded\r\n");
5004 printf(
"dsSetMS12AudioProfile_t(int, const char*) is not defined\r\n");
5009 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5015 if (func != 0 && param != NULL)
5017 if (func(param->handle, param->profile) ==
dsERR_NONE)
5019 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5020 printf(
"%s: persist MS12 Audio Profile selection : %s\n", __func__, param->profile);
5023 result = IARM_RESULT_SUCCESS;
5027 _dsMS12ProfileSettingOverride(param->handle);
5029 IARM_BUS_Unlock(lock);
5033 IARM_Result_t _dsSetAssociatedAudioMixing(
void *arg)
5035 #ifndef RDK_DSHAL_NAME
5036 #warning "RDK_DSHAL_NAME is not defined"
5037 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5040 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5041 IARM_BUS_Lock(lock);
5043 typedef dsError_t (*dsSetAssociatedAudioMixing_t)(intptr_t handle,
bool mixing);
5044 static dsSetAssociatedAudioMixing_t func = 0;
5046 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5048 func = (dsSetAssociatedAudioMixing_t) dlsym(dllib,
"dsSetAssociatedAudioMixing");
5050 printf(
"dsSetAssociatedAudioMixing_t(int, bool) is defined and loaded\r\n");
5053 printf(
"dsSetMS12AudioProfile_t(int, bool) is not defined\r\n");
5058 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5064 if (func != 0 && param != NULL)
5066 if (func(param->handle, param->mixing) ==
dsERR_NONE)
5068 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5069 printf(
"%s: persist Associated Audio Mixing status : %s\n", __func__, param->mixing ?
"Enabled":
"Disabled");
5073 printf(
"%s: Associated Audio Mixing status changed :%d \r\n", __FUNCTION__, param->mixing);
5074 associated_audio_mixing_event_data.data.AssociatedAudioMixingInfo.mixing = param->mixing;
5078 (
void *)&associated_audio_mixing_event_data,
5079 sizeof(associated_audio_mixing_event_data));
5081 result = IARM_RESULT_SUCCESS;
5085 IARM_BUS_Unlock(lock);
5089 IARM_Result_t _dsGetAssociatedAudioMixing(
void *arg)
5091 #ifndef RDK_DSHAL_NAME
5092 #warning "RDK_DSHAL_NAME is not defined"
5093 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5096 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5097 IARM_BUS_Lock(lock);
5099 typedef dsError_t (*dsGetAssociatedAudioMixing_t)(intptr_t handle,
bool *mixing);
5100 static dsGetAssociatedAudioMixing_t func = 0;
5102 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5104 func = (dsGetAssociatedAudioMixing_t) dlsym(dllib,
"dsGetAssociatedAudioMixing");
5106 printf(
"dsGetAssociatedAudioMixing_t(int, bool *) is defined and loaded\r\n");
5109 printf(
"dsGetAssociatedAudioMixing_t(int, bool *) is not defined\r\n");
5114 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5119 bool mixing =
false;
5120 if (func != 0 && param != NULL)
5122 param->mixing =
false;
5123 if (func(param->handle, &mixing) ==
dsERR_NONE)
5125 param->mixing = mixing;
5126 result = IARM_RESULT_SUCCESS;
5130 IARM_BUS_Unlock(lock);
5134 IARM_Result_t _dsSetFaderControl(
void *arg)
5136 #ifndef RDK_DSHAL_NAME
5137 #warning "RDK_DSHAL_NAME is not defined"
5138 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5141 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5142 IARM_BUS_Lock(lock);
5144 typedef dsError_t (*dsSetFaderControl_t)(intptr_t handle,
int mixerbalance);
5145 static dsSetFaderControl_t func = 0;
5148 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5150 func = (dsSetFaderControl_t) dlsym(dllib,
"dsSetFaderControl");
5152 printf(
"dsSetFaderControl_t(int, int) is defined and loaded\r\n");
5155 printf(
"dsSetFaderControl_t(int, int) is not defined\r\n");
5160 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5166 if (func != 0 && param != NULL)
5168 if (func(param->handle, param->mixerbalance) ==
dsERR_NONE)
5170 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5171 std::string _mixerbalance = std::to_string(param->mixerbalance);
5172 printf(
"%s: persist fader control level: %d\n",__func__, param->mixerbalance);
5176 printf(
"%s: Fader Control changed :%d \r\n", __FUNCTION__, param->mixerbalance);
5177 fader_control_event_data.data.FaderControlInfo.mixerbalance = param->mixerbalance;
5181 (
void *)&fader_control_event_data,
5182 sizeof(fader_control_event_data));
5184 result = IARM_RESULT_SUCCESS;
5188 IARM_BUS_Unlock(lock);
5195 IARM_Result_t _dsGetFaderControl(
void *arg)
5197 #ifndef RDK_DSHAL_NAME
5198 #warning "RDK_DSHAL_NAME is not defined"
5199 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5202 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5203 IARM_BUS_Lock(lock);
5205 typedef dsError_t (*dsGetFaderControl_t)(intptr_t handle,
int *mixerbalance);
5206 static dsGetFaderControl_t func = 0;
5208 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5210 func = (dsGetFaderControl_t) dlsym(dllib,
"dsGetFaderControl");
5212 printf(
"dsGetFaderControl_t(int, int *) is defined and loaded\r\n");
5215 printf(
"dsGetFaderControl_t(int, int *) is not defined\r\n");
5220 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5225 int mixerbalance = 0;
5226 if (func != 0 && param != NULL)
5228 param->mixerbalance = 0;
5229 if (func(param->handle, &mixerbalance) ==
dsERR_NONE)
5231 param->mixerbalance = mixerbalance;
5232 result = IARM_RESULT_SUCCESS;
5236 IARM_BUS_Unlock(lock);
5241 IARM_Result_t _dsSetPrimaryLanguage(
void *arg)
5243 #ifndef RDK_DSHAL_NAME
5244 #warning "RDK_DSHAL_NAME is not defined"
5245 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5248 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5249 IARM_BUS_Lock(lock);
5251 typedef dsError_t (*dsSetPrimaryLanguage_t)(intptr_t handle,
const char* pLang);
5252 static dsSetPrimaryLanguage_t func = 0;
5254 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5256 func = (dsSetPrimaryLanguage_t) dlsym(dllib,
"dsSetPrimaryLanguage");
5258 printf(
"dsSetPrimaryLanguage_t(int, const char*) is defined and loaded\r\n");
5261 printf(
"dsSetPrimaryLanguage_t(int, const char*) is not defined\r\n");
5266 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5272 if (func != 0 && param != NULL)
5274 if (func(param->handle, param->primaryLanguage) ==
dsERR_NONE)
5276 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5277 printf(
"%s: persist Primary Language : %s\n", __func__, param->primaryLanguage);
5281 printf(
"%s: Primary Language changed :%s \r\n", __FUNCTION__, param->primaryLanguage);
5282 memset(primary_language_event_data.data.AudioLanguageInfo.audioLanguage,
'\0',MAX_LANGUAGE_LEN);
5283 strncpy(primary_language_event_data.data.AudioLanguageInfo.audioLanguage, param->primaryLanguage, MAX_LANGUAGE_LEN-1);
5287 (
void *)&primary_language_event_data,
5288 sizeof(primary_language_event_data));
5290 result = IARM_RESULT_SUCCESS;
5294 IARM_BUS_Unlock(lock);
5299 IARM_Result_t _dsGetPrimaryLanguage(
void *arg)
5301 #ifndef RDK_DSHAL_NAME
5302 #warning "RDK_DSHAL_NAME is not defined"
5303 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5307 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5308 IARM_BUS_Lock(lock);
5310 typedef dsError_t (*dsGetPrimaryLanguage_t)(intptr_t handle,
char* pLang);
5311 static dsGetPrimaryLanguage_t func = 0;
5313 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5315 func = (dsGetPrimaryLanguage_t) dlsym(dllib,
"dsGetPrimaryLanguage");
5317 printf(
"dsGetPrimaryLanguage_t(int, char* ) is defined and loaded\r\n");
5320 printf(
"dsGetPrimaryLanguage_t(int, char*) is not defined\r\n");
5325 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5330 char primaryLanguage[MAX_LANGUAGE_LEN] = {0};
5331 if (func != 0 && param != NULL)
5333 if (func(param->handle, primaryLanguage) ==
dsERR_NONE)
5335 rc = strcpy_s(param->primaryLanguage,
sizeof(param->primaryLanguage), primaryLanguage);
5340 result = IARM_RESULT_SUCCESS;
5344 IARM_BUS_Unlock(lock);
5349 IARM_Result_t _dsSetSecondaryLanguage(
void *arg)
5351 #ifndef RDK_DSHAL_NAME
5352 #warning "RDK_DSHAL_NAME is not defined"
5353 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5356 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5357 IARM_BUS_Lock(lock);
5359 typedef dsError_t (*dsSetSecondaryLanguage_t)(intptr_t handle,
const char* sLang);
5360 static dsSetSecondaryLanguage_t func = 0;
5362 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5364 func = (dsSetSecondaryLanguage_t) dlsym(dllib,
"dsSetSecondaryLanguage");
5366 printf(
"dsSetSecondaryLanguage_t(int, const char*) is defined and loaded\r\n");
5369 printf(
"dsSetSecondaryLanguage_t(int, const char*) is not defined\r\n");
5374 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5380 if (func != 0 && param != NULL)
5382 if (func(param->handle, param->secondaryLanguage) ==
dsERR_NONE)
5384 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5385 printf(
"%s: persist Secondary Language : %s\n", __func__, param->secondaryLanguage);
5389 printf(
"%s: Secondary Language changed :%s \r\n", __FUNCTION__, param->secondaryLanguage);
5390 memset(secondary_language_event_data.data.AudioLanguageInfo.audioLanguage,
'\0',MAX_LANGUAGE_LEN);
5391 strncpy(secondary_language_event_data.data.AudioLanguageInfo.audioLanguage, param->secondaryLanguage, MAX_LANGUAGE_LEN-1);
5395 (
void *)&secondary_language_event_data,
5396 sizeof(secondary_language_event_data));
5398 result = IARM_RESULT_SUCCESS;
5402 IARM_BUS_Unlock(lock);
5407 IARM_Result_t _dsGetSecondaryLanguage(
void *arg)
5409 #ifndef RDK_DSHAL_NAME
5410 #warning "RDK_DSHAL_NAME is not defined"
5411 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5415 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5416 IARM_BUS_Lock(lock);
5418 typedef dsError_t (*dsGetSecondaryLanguage_t)(intptr_t handle,
char* sLang);
5419 static dsGetSecondaryLanguage_t func = 0;
5421 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5423 func = (dsGetSecondaryLanguage_t) dlsym(dllib,
"dsGetSecondaryLanguage");
5425 printf(
"dsGetSecondaryLanguage_t(int, char* ) is defined and loaded\r\n");
5428 printf(
"dsGetSecondaryLanguage_t(int, char*) is not defined\r\n");
5433 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5438 char secondaryLanguage[MAX_LANGUAGE_LEN] = {0};
5439 if (func != 0 && param != NULL)
5441 if (func(param->handle, secondaryLanguage) ==
dsERR_NONE)
5443 rc = strcpy_s(param->secondaryLanguage,
sizeof(param->secondaryLanguage), secondaryLanguage);
5448 result = IARM_RESULT_SUCCESS;
5452 IARM_BUS_Unlock(lock);
5456 IARM_Result_t _dsSetMS12SetttingsOverride(
void *arg)
5458 #ifndef RDK_DSHAL_NAME
5459 #warning "RDK_DSHAL_NAME is not defined"
5460 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5463 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5464 IARM_BUS_Lock(lock);
5466 std::string _hostProperty;
5468 std::string _AProfile(
"Off");
5469 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
5470 if(!(_dsMs12ProfileSupported(param->handle,param->profileName))) {
5471 printf(
"%s: Unknow MS12 profile %s \n",__func__, param->profileName);
5472 IARM_BUS_Unlock(lock);
5480 printf(
"audio.MS12Profile not found in persistence store. Try system default\n");
5488 if(strcmp(param->profileName,_AProfile.c_str()) == 0) {
5489 if(strcmp(param->profileSettingsName,
"DialogEnhance") == 0) {
5490 if(strcmp(param->profileState,
"ADD") == 0) {
5491 result = _setDialogEnhancement(param->handle,atoi(param->profileSettingValue));
5493 else if(strcmp(param->profileState,
"REMOVE") == 0) {
5494 result = _resetDialogEnhancerLevel(param->handle);
5497 else if(strcmp(param->profileSettingsName,
"VolumeLevellerMode") == 0) {
5498 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
5499 if((atoi(param->profileSettingValue) == 0) || (atoi(param->profileSettingValue) == 1)) {
5501 result = IARM_RESULT_SUCCESS;
5503 printf(
"%s: Unknow MS12 property value %s %s \n",__func__, param->profileSettingsName,param->profileSettingValue);
5504 result = IARM_RESULT_INVALID_STATE;
5507 else if(strcmp(param->profileSettingsName,
"VolumeLevellerLevel") == 0) {
5508 if(strcmp(param->profileState,
"ADD") == 0) {
5509 std::string _volLevellerMode(
"0");
5510 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
5512 result = _setVolumeLeveller(param->handle,atoi(_volLevellerMode.c_str()),atoi(param->profileSettingValue));
5514 else if(strcmp(param->profileState,
"REMOVE") == 0) {
5515 result = _resetVolumeLeveller(param->handle);
5518 else if(strcmp(param->profileSettingsName,
"BassEnhancer") == 0) {
5519 if(strcmp(param->profileState,
"ADD") == 0) {
5520 result = _setBassEnhancer(param->handle,atoi(param->profileSettingValue));
5522 else if(strcmp(param->profileState,
"REMOVE") == 0) {
5523 result = _resetBassEnhancer(param->handle);
5526 else if(strcmp(param->profileSettingsName,
"SurroundVirtualizerMode") == 0) {
5527 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
5528 if((atoi(param->profileSettingValue) >= 0) && (atoi(param->profileSettingValue) <= 2)) {
5530 result = IARM_RESULT_SUCCESS;
5533 printf(
"%s: Unknow MS12 property value %s %s \n",__func__, param->profileSettingsName,param->profileSettingValue);
5534 result = IARM_RESULT_INVALID_STATE;
5537 else if(strcmp(param->profileSettingsName,
"SurroundVirtualizerLevel") == 0) {
5538 if(strcmp(param->profileState,
"ADD") == 0) {
5539 std::string _SVMode(
"0");
5540 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
5542 result = _setSurroundVirtualizer(param->handle,atoi(_SVMode.c_str()),atoi(param->profileSettingValue));
5544 else if(strcmp(param->profileState,
"REMOVE") == 0) {
5545 result = _resetSurroundVirtualizer(param->handle);
5549 printf(
"%s: Unknow MS12 property %s \n",__func__, param->profileSettingsName);
5550 result = IARM_RESULT_INVALID_STATE;
5552 if(result != IARM_RESULT_SUCCESS)
5554 IARM_BUS_Unlock(lock);
5559 if(strcmp(param->profileSettingsName,
"DialogEnhance") == 0) {
5560 _hostProperty = _dsGenerateProfileProperty(param->profileName,
"EnhancerLevel");
5562 else if(strcmp(param->profileSettingsName,
"VolumeLevellerMode") == 0) {
5563 _hostProperty = _dsGenerateProfileProperty(param->profileName,
"VolumeLeveller.mode");
5565 else if(strcmp(param->profileSettingsName,
"VolumeLevellerLevel") == 0) {
5566 _hostProperty = _dsGenerateProfileProperty(param->profileName,
"VolumeLeveller.level");
5568 else if(strcmp(param->profileSettingsName,
"BassEnhancer") == 0) {
5569 _hostProperty =
"audio.BassBoost";
5571 else if(strcmp(param->profileSettingsName,
"SurroundVirtualizerMode") == 0) {
5572 _hostProperty = _dsGenerateProfileProperty(param->profileName,
"SurroundVirtualizer.mode");
5574 else if(strcmp(param->profileSettingsName,
"SurroundVirtualizerLevel") == 0) {
5575 _hostProperty = _dsGenerateProfileProperty(param->profileName,
"SurroundVirtualizer.boost");
5578 printf(
"%s: Unknow MS12 property %s \n",__func__, param->profileSettingsName);
5579 IARM_BUS_Unlock(lock);
5582 if(strcmp(param->profileState,
"ADD") == 0) {
5583 printf(
"%s: Profile %s property %s persist value: %s\n",__func__,param->profileName, param->profileSettingsName , param->profileSettingValue);
5586 else if(strcmp(param->profileState,
"REMOVE") == 0) {
5593 printf(
"%s: Profile %s property %s persist value: %s\n",__func__,param->profileName, param->profileSettingsName , _value.c_str());
5597 printf(
"%s: Unknow State %s \n",__func__, param->profileState);
5598 IARM_BUS_Unlock(lock);
5602 result = IARM_RESULT_SUCCESS;
5604 IARM_BUS_Unlock(lock);
5608 IARM_Result_t _dsGetSupportedARCTypes(
void *arg)
5610 #ifndef RDK_DSHAL_NAME
5611 #warning "RDK_DSHAL_NAME is not defined"
5612 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5615 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5616 IARM_BUS_Lock(lock);
5618 typedef dsError_t (*dsGetSupportedARCTypes_t)(intptr_t handle,
int *types);
5619 static dsGetSupportedARCTypes_t func = 0;
5621 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5623 func = (dsGetSupportedARCTypes_t) dlsym(dllib,
"dsGetSupportedARCTypes");
5625 printf(
"dsGetSupportedARCTypes_t(int, int*) is defined and loaded\r\n");
5628 printf(
"dsGetSupportedARCTypes_t(int, int*) is not defined\r\n");
5633 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5638 int types = dsAUDIOARCSUPPORT_NONE;
5640 if (func != 0 && param != NULL)
5642 param->types = dsAUDIOARCSUPPORT_NONE;
5643 if (func(param->handle, &types) ==
dsERR_NONE)
5645 param->types = types;
5646 result = IARM_RESULT_SUCCESS;
5650 IARM_BUS_Unlock(lock);
5655 IARM_Result_t _dsAudioSetSAD(
void *arg)
5657 #ifndef RDK_DSHAL_NAME
5658 #warning "RDK_DSHAL_NAME is not defined"
5659 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5662 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5663 IARM_BUS_Lock(lock);
5666 static dsAudioSetSAD_t func = 0;
5668 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5670 func = (dsAudioSetSAD_t) dlsym(dllib,
"dsAudioSetSAD");
5672 printf(
"dsAudioSetSAD_t(int, dsAudioSADList_t) is defined and loaded\r\n");
5675 printf(
"dsAudioSetSAD_t(int, dsAudioSADList_t) is not defined\r\n");
5680 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5686 if (func != 0 && param != NULL)
5688 if (func(param->handle, param->list) ==
dsERR_NONE)
5690 result = IARM_RESULT_SUCCESS;
5694 IARM_BUS_Unlock(lock);
5698 IARM_Result_t _dsAudioEnableARC(
void *arg)
5700 #ifndef RDK_DSHAL_NAME
5701 #warning "RDK_DSHAL_NAME is not defined"
5702 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5705 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5706 IARM_BUS_Lock(lock);
5709 std::string _isEnabledAudoARCPortKey(
"audio.hdmiArc0.isEnabled");
5710 std::string _audoARCPortTypeKey(
"audio.hdmiArc0.type");
5712 std::string _audoARCPortiCapVal(
"eARC");
5716 static dsAudioEnableARC_t func = 0;
5718 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5720 func = (dsAudioEnableARC_t) dlsym(dllib,
"dsAudioEnableARC");
5722 printf(
"dsAudioEnableARC_t(int, dsAudioARCStatus_t) is defined and loaded\r\n");
5725 printf(
"dsAudioEnableARC_t(int, dsAudioARCStatus_t) is not defined\r\n");
5730 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5736 if (func != 0 && param != NULL)
5738 if (func(param->handle, param->arcStatus) ==
dsERR_NONE)
5740 result = IARM_RESULT_SUCCESS;
5747 bool bAudioPortEnableVerify =
false;
5750 if (bAudioPortEnableVerify != param->arcStatus.status) {
5751 printf(
"Init: %s : %s Audio port status:%s verification failed. bAudioPortEnable: %d bAudioPortEnableVerify:%d\n",
5752 __FUNCTION__, _audoARCPortTypeKey.c_str(), _isEnabledAudoARCPortKey.c_str(), param->arcStatus.status, bAudioPortEnableVerify);
5755 printf(
"%s : %s Audio port status verification passed. status %d\n",
5756 __FUNCTION__, _isEnabledAudoARCPortKey.c_str(), param->arcStatus.status);
5760 printf(
"Init: %s : %s Audio port status:%s verification step: dsIsAudioPortEnabled call failed\n",
5761 __FUNCTION__, _audoARCPortTypeKey.c_str(), _isEnabledAudoARCPortKey.c_str());
5766 IARM_BUS_Unlock(lock);
5770 IARM_Result_t _dsEnableLEConfig(
void *arg)
5773 #ifndef RDK_DSHAL_NAME
5774 #warning "RDK_DSHAL_NAME is not defined"
5775 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5778 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5780 IARM_BUS_Lock(lock);
5782 typedef dsError_t (*dsEnableLEConfig_t)(intptr_t handle,
const bool enable);
5783 static dsEnableLEConfig_t func = NULL;
5785 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5787 func = (dsEnableLEConfig_t) dlsym(dllib,
"dsEnableLEConfig");
5789 __TIMESTAMP();printf(
"dsEnableLEConfig(int, bool) is defined and loaded\r\n");
5792 __TIMESTAMP();printf(
"dsEnableLEConfig(int, bool) is not defined\r\n");
5797 __TIMESTAMP();printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5803 __TIMESTAMP();printf(
"LE: %s enable status:%d \r\n",__FUNCTION__,param->enable);
5805 if(param->enable != m_LEEnabled)
5807 m_LEEnabled = param->enable;
5814 dsError_t ret = func(param->handle, param->enable);
5816 result = IARM_RESULT_SUCCESS;
5821 __TIMESTAMP();printf(
"LE: %s Current enable status is same as requested:%d \r\n",__FUNCTION__,param->enable);
5822 result = IARM_RESULT_SUCCESS;
5826 IARM_BUS_Unlock(lock);
5831 IARM_Result_t _dsGetLEConfig(
void *arg)
5834 #ifndef RDK_DSHAL_NAME
5835 #warning "RDK_DSHAL_NAME is not defined"
5836 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
5840 IARM_BUS_Lock(lock);
5842 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
5843 typedef dsError_t (*dsGetLEConfig_t)(intptr_t handle,
bool *enable);
5844 static dsGetLEConfig_t func = NULL;
5846 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5848 func = (dsGetLEConfig_t) dlsym(dllib,
"dsGetLEConfig");
5850 __TIMESTAMP();printf(
"dsGetLEConfig(int , bool *) is defined and loaded\r\n");
5853 __TIMESTAMP();printf(
"dsGetLEConfig(int , bool *) is not defined\r\n");
5858 __TIMESTAMP();printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5863 if (param != NULL) {
5867 param->result = func(param->handle, ¶m->enable);
5869 result = IARM_RESULT_SUCCESS;
5875 IARM_BUS_Unlock(lock);
5881 static void _GetAudioModeFromPersistent(
void *arg)
5890 std::string _AudioModeSettings(
"STEREO");
5895 __TIMESTAMP();printf(
"The SPDIF Audio Mode Setting From Persistent is %s \r\n",_AudioModeSettings.c_str());
5899 __TIMESTAMP();printf(
"The HDMI Audio Mode Setting From Persistent is %s \r\n",_AudioModeSettings.c_str());
5901 else if (_APortType == dsAUDIOPORT_TYPE_HDMI_ARC){
5903 __TIMESTAMP();printf(
"The HDMI_ARC Audio Mode Setting From Persistent is %s \r\n",_AudioModeSettings.c_str());
5906 if (_AudioModeSettings.compare(
"SURROUND") == 0)
5910 else if (_AudioModeSettings.compare(
"PASSTHRU") == 0)
5914 else if (_AudioModeSettings.compare(
"DOLBYDIGITAL") == 0)
5918 else if (_AudioModeSettings.compare(
"DOLBYDIGITALPLUS") == 0)
5929 IARM_Result_t _dsGetAudioCapabilities(
void *arg)
5933 IARM_BUS_Lock(lock);
5935 typedef dsError_t (*dsGetAudioCapabilitiesFunc_t)(intptr_t handle,
int *capabilities);
5936 static dsGetAudioCapabilitiesFunc_t func = 0;
5938 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5940 func = (dsGetAudioCapabilitiesFunc_t)dlsym(dllib,
"dsGetAudioCapabilities");
5942 printf(
"dsGetAudioCapabilities() is defined and loaded\r\n");
5945 printf(
"dsGetAudioCapabilities() is not defined\r\n");
5950 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5955 param->result = func(param->handle, ¶m->capabilities);
5958 param->capabilities = dsAUDIOSUPPORT_NONE;
5961 IARM_BUS_Unlock(lock);
5962 return IARM_RESULT_SUCCESS;
5966 IARM_Result_t _dsGetMS12Capabilities(
void *arg)
5970 IARM_BUS_Lock(lock);
5972 typedef dsError_t (*dsGetMS12CapabilitiesFunc_t)(intptr_t handle,
int *capabilities);
5973 static dsGetMS12CapabilitiesFunc_t func = 0;
5975 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
5977 func = (dsGetMS12CapabilitiesFunc_t)dlsym(dllib,
"dsGetMS12Capabilities");
5979 printf(
"dsGetMS12Capabilities() is defined and loaded\r\n");
5982 printf(
"dsGetMS12Capabilities() is not defined\r\n");
5987 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
5992 param->result = func(param->handle, ¶m->capabilities);
5995 param->capabilities = dsMS12SUPPORT_NONE;
5998 IARM_BUS_Unlock(lock);
5999 return IARM_RESULT_SUCCESS;
6002 void _dsAudioOutPortConnectCB(
dsAudioPortType_t portType,
unsigned int uiPortNo,
bool isPortConnected)
6005 printf(
"%s: AudioOutPort type:%d portNo:%d Hotplug happened\r\n",
6006 __FUNCTION__, portType, uiPortNo);
6007 audio_out_hpd_eventData.data.audio_out_connect.portType = portType;
6008 audio_out_hpd_eventData.data.audio_out_connect.uiPortNo = uiPortNo;
6009 audio_out_hpd_eventData.data.audio_out_connect.isPortConnected = isPortConnected;
6013 (
void *)&audio_out_hpd_eventData,
6014 sizeof(audio_out_hpd_eventData));
6015 printf (
"%s portType%d uiPortNo:%d isPortConnected:%d",
6016 __FUNCTION__, portType, uiPortNo, isPortConnected);
6019 static dsError_t _dsAudioOutRegisterConnectCB (dsAudioOutPortConnectCB_t cbFun) {
6021 printf(
"%s: %d - Inside \n", __FUNCTION__, __LINE__);
6023 typedef dsError_t (*dsAudioOutRegisterConnectCB_t)(dsAudioOutPortConnectCB_t cbFunArg);
6024 static dsAudioOutRegisterConnectCB_t dsAudioOutRegisterConnectCBFun = 0;
6025 if (dsAudioOutRegisterConnectCBFun == 0) {
6026 printf(
"%s: %d - dlerror: %s\n", __FUNCTION__, __LINE__, dlerror());
6027 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6029 dsAudioOutRegisterConnectCBFun = (dsAudioOutRegisterConnectCB_t) dlsym(dllib,
"dsAudioOutRegisterConnectCB");
6030 if(dsAudioOutRegisterConnectCBFun == 0) {
6031 printf(
"%s: dsAudioOutRegisterConnectCB (int) is not defined %s\r\n", __FUNCTION__, dlerror());
6035 printf(
"%s: dsAudioOutRegisterConnectCB is loaded\r\n", __FUNCTION__);
6040 printf(
"%s: Opening RDK_DSHAL_NAME [%s] failed %s\r\n",
6041 __FUNCTION__, RDK_DSHAL_NAME, dlerror());
6045 if (0 != dsAudioOutRegisterConnectCBFun) {
6046 eRet = dsAudioOutRegisterConnectCBFun (cbFun);
6047 printf(
"%s: dsAudioOutRegisterConnectCBFun registered\r\n", __FUNCTION__);
6050 printf(
"%s: dsAudioOutRegisterConnectCBFun NULL\r\n", __FUNCTION__);
6055 IARM_Result_t _dsAudioOutIsConnected (
void *arg) {
6057 IARM_BUS_Lock(lock);
6059 IARM_Result_t eIarmRet = IARM_RESULT_INVALID_PARAM;
6063 bool isConnected =
true;
6064 param->isCon =
true;
6066 printf(
"%s: %d - Inside \n", __FUNCTION__, __LINE__);
6068 typedef dsError_t (*dsAudioOutIsConnected_t)(intptr_t handleArg,
bool* pisConArg);
6069 static dsAudioOutIsConnected_t dsAudioOutIsConFunc = 0;
6070 if (dsAudioOutIsConFunc == 0) {
6071 printf(
"%s: %d - dlerror:%s\n", __FUNCTION__, __LINE__, dlerror());
6072 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6074 dsAudioOutIsConFunc = (dsAudioOutIsConnected_t) dlsym(dllib,
"dsAudioOutIsConnected");
6075 if(dsAudioOutIsConFunc == 0) {
6076 printf(
"%s: dsAudioOutIsConnected is not defined %s\r\n", __FUNCTION__, dlerror());
6080 printf(
"%s: dsAudioOutIsConnected is loaded\r\n", __FUNCTION__);
6085 printf(
"%s: Opening RDK_DSHAL_NAME [%s] failed %s\r\n",
6086 __FUNCTION__, RDK_DSHAL_NAME, dlerror());
6090 if (0 != dsAudioOutIsConFunc) {
6091 eRet = dsAudioOutIsConFunc (param->handle, &isConnected);
6092 printf(
"%s: pisCon:%d eRet:%04x\r\n",
6093 __FUNCTION__, isConnected, eRet);
6096 printf(
"%s: dsAudioOutIsConFunc NULL\n", __FUNCTION__);
6099 param->result = eRet;
6101 param->isCon = isConnected;
6102 eIarmRet = IARM_RESULT_SUCCESS;
6106 IARM_BUS_Unlock(lock);
6113 printf(
"%s: AudioOutPort format:%d \r\n", __FUNCTION__, audioFormat);
6114 audio_format_event_data.data.AudioFormatInfo.audioFormat = audioFormat;
6118 (
void *)&audio_format_event_data,
6119 sizeof(audio_format_event_data));
6124 printf(
"%s: %d - Inside \n", __FUNCTION__, __LINE__);
6127 static dsAudioFormatUpdateRegisterCB_t dsAudioFormatUpdateRegisterCBFun = 0;
6128 if (dsAudioFormatUpdateRegisterCBFun == 0) {
6129 printf(
"%s: %d - dlerror: %s\n", __FUNCTION__, __LINE__, dlerror());
6130 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6132 dsAudioFormatUpdateRegisterCBFun = (dsAudioFormatUpdateRegisterCB_t) dlsym(dllib,
"dsAudioFormatUpdateRegisterCB");
6133 if(dsAudioFormatUpdateRegisterCBFun == 0) {
6134 printf(
"%s: dsAudioFormatUpdateRegisterCB is not defined %s\r\n", __FUNCTION__, dlerror());
6138 printf(
"%s: dsAudioFormatUpdateRegisterCB is loaded\r\n", __FUNCTION__);
6143 printf(
"%s: Opening RDK_DSHAL_NAME [%s] failed %s\r\n",
6144 __FUNCTION__, RDK_DSHAL_NAME, dlerror());
6148 if (0 != dsAudioFormatUpdateRegisterCBFun) {
6149 eRet = dsAudioFormatUpdateRegisterCBFun (cbFun);
6150 printf(
"%s: dsAudioFormatUpdateRegisterCBFun registered\r\n", __FUNCTION__);
6153 printf(
"%s: dsAudioFormatUpdateRegisterCBFun NULL\r\n", __FUNCTION__);
6159 IARM_Result_t _dsResetBassEnhancer(
void *arg)
6162 IARM_BUS_Lock(lock);
6164 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6165 intptr_t *handle = (intptr_t*)arg;
6166 result = _resetBassEnhancer(*handle);
6167 IARM_BUS_Unlock(lock);
6172 static IARM_Result_t _resetBassEnhancer(intptr_t handle)
6174 typedef dsError_t (*dsSetBassEnhancer_t)(intptr_t handle,
int boost);
6175 static dsSetBassEnhancer_t func = 0;
6176 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6178 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6180 func = (dsSetBassEnhancer_t) dlsym(dllib,
"dsSetBassEnhancer");
6182 printf(
"dsSetBassEnhancer_t(int, int) is defined and loaded\r\n");
6185 printf(
"dsSetBassEnhancer_t(int, int) is not defined\r\n");
6190 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6194 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
6196 std::string _Property = _dsGetCurrentProfileProperty(
"BassBoost");
6197 std::string _BassBoost(
"0");
6198 int m_bassBoost = 0;
6205 m_bassBoost = atoi(_BassBoost.c_str());
6207 if (func(handle,m_bassBoost) ==
dsERR_NONE) {
6208 printf(
"%s:%s Initialized Bass Boost : %d\n",__func__, _Property.c_str(), m_bassBoost);
6210 result = IARM_RESULT_SUCCESS;
6217 IARM_Result_t _dsResetVolumeLeveller(
void *arg)
6220 IARM_BUS_Lock(lock);
6221 intptr_t *handle = (intptr_t*)arg;
6222 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6224 result = _resetVolumeLeveller(*handle);
6225 IARM_BUS_Unlock(lock);
6229 static IARM_Result_t _resetVolumeLeveller(intptr_t handle)
6232 static dsSetVolumeLeveller_t func = 0;
6233 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6236 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6238 func = (dsSetVolumeLeveller_t) dlsym(dllib,
"dsSetVolumeLeveller");
6240 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is defined and loaded\r\n");
6243 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is not defined\r\n");
6248 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6251 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
6253 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
6254 std::string _Propertylevel = _dsGetCurrentProfileProperty(
"VolumeLeveller.level");
6255 std::string _volLevellerMode(
"0");
6256 std::string _volLevellerLevel(
"0");
6263 _volLevellerMode =
"0";
6264 _volLevellerLevel =
"0";
6266 m_volumeLeveller.mode = atoi(_volLevellerMode.c_str());
6267 m_volumeLeveller.level = atoi(_volLevellerLevel.c_str());
6268 if (func(handle, m_volumeLeveller) ==
dsERR_NONE) {
6269 printf(
"%s %s %s Default Volume Leveller : Mode: %d, Level: %d\n",__func__,_PropertyMode.c_str(),_Propertylevel.c_str(), m_volumeLeveller.mode, m_volumeLeveller.level);
6272 result = IARM_RESULT_SUCCESS;
6276 IARM_BUS_Unlock(lock);
6280 IARM_Result_t _dsResetSurroundVirtualizer(
void *arg)
6283 IARM_BUS_Lock(lock);
6284 intptr_t *handle = (intptr_t*)arg;
6285 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6287 result = _resetSurroundVirtualizer(*handle);
6288 IARM_BUS_Unlock(lock);
6292 static IARM_Result_t _resetSurroundVirtualizer(intptr_t handle)
6295 static dsSetSurroundVirtualizer_t func = 0;
6296 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6298 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6300 func = (dsSetSurroundVirtualizer_t) dlsym(dllib,
"dsSetSurroundVirtualizer");
6302 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is defined and loaded\r\n");
6305 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is not defined\r\n");
6310 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6313 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
6315 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
6316 std::string _Propertylevel = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.boost");
6317 std::string _SVMode(
"0");
6318 std::string _SVBoost(
"0");
6328 m_virtualizer.mode = atoi(_SVMode.c_str());
6329 m_virtualizer.boost = atoi(_SVBoost.c_str());
6330 if (func(handle, m_virtualizer) ==
dsERR_NONE) {
6331 printf(
"%s %s %s Default Surround Virtualizer : Mode: %d, Boost : %d\n",__func__,_PropertyMode.c_str(),_Propertylevel.c_str(), m_virtualizer.mode, m_virtualizer.boost);
6334 result = IARM_RESULT_SUCCESS;
6341 IARM_Result_t _dsResetDialogEnhancement(
void *arg)
6344 IARM_BUS_Lock(lock);
6345 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6346 intptr_t *handle = (intptr_t*)arg;
6348 result = _resetDialogEnhancerLevel(*handle);
6349 IARM_BUS_Unlock(lock);
6353 static IARM_Result_t _resetDialogEnhancerLevel(intptr_t handle)
6355 typedef dsError_t (*dsSetDialogEnhancement_t)(intptr_t handle,
int enhancerLevel);
6356 static dsSetDialogEnhancement_t func = 0;
6357 IARM_Result_t result = IARM_RESULT_INVALID_STATE;
6359 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6361 func = (dsSetDialogEnhancement_t) dlsym(dllib,
"dsSetDialogEnhancement");
6363 printf(
"dsSetDialogEnhancement_t(int, int) is defined and loaded\r\n");
6366 printf(
"dsSetDialogEnhancement_t(int, int ) is not defined\r\n");
6371 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6375 #ifdef DS_AUDIO_SETTINGS_PERSISTENCE
6376 std::string _Property = _dsGetCurrentProfileProperty(
"EnhancerLevel");
6378 std::string _EnhancerLevel(
"0");
6379 int m_enhancerLevel = 0;
6384 _EnhancerLevel =
"0";
6386 m_enhancerLevel = atoi(_EnhancerLevel.c_str());
6387 if (func(handle, m_enhancerLevel) ==
dsERR_NONE) {
6388 printf(
"%s %s Default dialog enhancement level : %d\n",__func__,_Property.c_str(), m_enhancerLevel);
6390 result = IARM_RESULT_SUCCESS;
6397 std::string _dsGetCurrentProfileProperty(std::string property)
6399 std::string _AProfile(
"Off");
6400 std::string _AProfileSupport(
"FALSE");
6405 _AProfileSupport =
"FALSE";
6406 printf(
"audio.MS12Profile.supported setting not found in hostDataDeafult \r\n");
6408 printf(
" audio.MS12Profile.supported = %s ..... \r\n",_AProfileSupport.c_str());
6410 if(_AProfileSupport ==
"TRUE") {
6416 printf(
"audio.MS12Profile not found in persistence store. Try system default\n");
6424 std::string profileProperty(
"audio.");
6425 if(_AProfileSupport ==
"TRUE") {
6426 profileProperty.append (_AProfile);
6427 profileProperty.append (
".");
6429 profileProperty.append (property);
6430 return profileProperty;
6433 static std::string _dsGenerateProfileProperty(std::string profile,std::string property)
6435 std::string profileProperty(
"audio.");
6436 profileProperty.append (profile);
6437 profileProperty.append (
".");
6438 profileProperty.append (property);
6439 return profileProperty;
6442 void _dsMS12ProfileSettingOverride(intptr_t handle)
6445 typedef dsError_t (*dsSetDialogEnhancement_t)(intptr_t handle,
int enhancerLevel);
6446 static dsSetDialogEnhancement_t dsSetDialogEnhancementfunc = 0;
6447 if (dsSetDialogEnhancementfunc == 0) {
6448 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6450 dsSetDialogEnhancementfunc = (dsSetDialogEnhancement_t) dlsym(dllib,
"dsSetDialogEnhancement");
6451 if (dsSetDialogEnhancementfunc) {
6452 printf(
"dsSetDialogEnhancement_t(int, int) is defined and loaded\r\n");
6455 printf(
"dsSetDialogEnhancement_t(int, int ) is not defined\r\n");
6460 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6464 if (dsSetDialogEnhancementfunc) {
6465 std::string _EnhancerLevel(
"0");
6466 int m_enhancerLevel = 0;
6467 std::string _Property = _dsGetCurrentProfileProperty(
"EnhancerLevel");
6473 printf(
"audio.EnhancerLevel not found in persistence store. Try system default\n");
6477 _EnhancerLevel =
"0";
6480 m_enhancerLevel = atoi(_EnhancerLevel.c_str());
6481 if (dsSetDialogEnhancementfunc(handle, m_enhancerLevel) ==
dsERR_NONE) {
6483 printf(
"%s: persist enhancer level: %d\n",__func__,m_enhancerLevel );
6487 typedef dsError_t (*dsSetBassEnhancer_t)(intptr_t handle,
int boost);
6488 static dsSetBassEnhancer_t dsSetBassEnhancerFunc = 0;
6489 if (dsSetBassEnhancerFunc == 0) {
6490 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6492 dsSetBassEnhancerFunc = (dsSetBassEnhancer_t) dlsym(dllib,
"dsSetBassEnhancer");
6493 if (dsSetBassEnhancerFunc) {
6494 printf(
"dsSetBassEnhancer_t(int, int) is defined and loaded\r\n");
6497 printf(
"dsSetBassEnhancer_t(int, int) is not defined\r\n");
6502 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6505 if (dsSetBassEnhancerFunc != 0)
6507 std::string _BassBoost(
"0");
6508 int m_bassBoost = 0;
6509 std::string _Property = _dsGetCurrentProfileProperty(
"BassBoost");
6515 printf(
"audio.EnhancerLevel not found in persistence store. Try system default\n");
6522 m_bassBoost = atoi(_BassBoost.c_str());
6523 if (dsSetBassEnhancerFunc(handle, m_bassBoost) ==
dsERR_NONE)
6525 printf(
"%s: persist boost value: %d\n",__func__, m_bassBoost);
6531 static dsSetVolumeLeveller_t dsSetVolumeLevellerfunc = 0;
6532 if (dsSetVolumeLevellerfunc == 0) {
6533 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6535 dsSetVolumeLevellerfunc = (dsSetVolumeLeveller_t) dlsym(dllib,
"dsSetVolumeLeveller");
6536 if (dsSetVolumeLevellerfunc) {
6537 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is defined and loaded\r\n");
6540 printf(
"dsSetVolumeLeveller_t(int, dsVolumeLeveller_t) is not defined\r\n");
6545 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6549 if (dsSetVolumeLevellerfunc != 0 )
6551 std::string _volLevellerMode(
"0");
6552 std::string _volLevellerLevel(
"0");
6554 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"VolumeLeveller.mode");
6555 std::string _PropertyLevel = _dsGetCurrentProfileProperty(
"VolumeLeveller.level");
6566 _volLevellerMode =
"0";
6567 _volLevellerLevel =
"0";
6570 m_volumeLeveller.mode = atoi(_volLevellerMode.c_str());
6571 m_volumeLeveller.level = atoi(_volLevellerLevel.c_str());
6572 if (dsSetVolumeLevellerfunc(handle, m_volumeLeveller) ==
dsERR_NONE)
6574 printf(
"%s: persist volume leveller mode: %d\n",__func__, m_volumeLeveller.mode);
6576 printf(
"%s: persist volume leveller value: %d\n",__func__, m_volumeLeveller.level);
6582 static dsSetSurroundVirtualizer_t dsSetSurroundVirtualizerfunc = 0;
6583 if (dsSetSurroundVirtualizerfunc == 0) {
6584 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6586 dsSetSurroundVirtualizerfunc = (dsSetSurroundVirtualizer_t) dlsym(dllib,
"dsSetSurroundVirtualizer");
6587 if (dsSetSurroundVirtualizerfunc) {
6588 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is defined and loaded\r\n");
6591 printf(
"dsSetSurroundVirtualizer_t(int, dsSurroundVirtualizer_t) is not defined\r\n");
6596 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6600 if (dsSetSurroundVirtualizerfunc != 0 )
6602 std::string _SVMode(
"0");
6603 std::string _SVBoost(
"0");
6605 std::string _PropertyMode = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.mode");
6606 std::string _PropertyBoost = _dsGetCurrentProfileProperty(
"SurroundVirtualizer.boost");
6621 m_virtualizer.mode = atoi(_SVMode.c_str());
6622 m_virtualizer.boost = atoi(_SVBoost.c_str());
6624 if (dsSetSurroundVirtualizerfunc(handle,m_virtualizer) ==
dsERR_NONE)
6626 printf(
"%s: persist surround virtualizer mode: %d\n",__func__, m_virtualizer.mode);
6628 printf(
"%s: persist surround virtualizer boost value: %d\n",__func__, m_virtualizer.boost);
6634 bool _dsMs12ProfileSupported(intptr_t handle,std::string profile)
6637 static dsGetMS12AudioProfileList_t func = 0;
6639 void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY);
6641 func = (dsGetMS12AudioProfileList_t) dlsym(dllib,
"dsGetMS12AudioProfileList");
6643 printf(
"dsGetMS12AudioProfileList_t(int, dsMS12AudioProfileList_t*) is defined and loaded\r\n");
6646 printf(
"dsGetMS12AudioProfileList_t(int, dsMS12AudioProfileList_t*) is not defined\r\n");
6651 printf(
"Opening RDK_DSHAL_NAME [%s] failed\r\n", RDK_DSHAL_NAME);
6660 ret = func(handle, &pProfilesStr);
6663 if(strstr(pProfilesStr.audioProfileList,profile.c_str()))
6672 IARM_Result_t _dsGetHDMIARCPortId(
void *arg)
6674 #ifndef RDK_DSHAL_NAME
6675 #warning "RDK_DSHAL_NAME is not defined"
6676 #define RDK_DSHAL_NAME "RDK_DSHAL_NAME is not defined"
6680 IARM_BUS_Lock(lock);
6681 std::string _HDMIARCPortId(
"0");
6687 _HDMIARCPortId =
"-1";
6689 param->portId = atoi(_HDMIARCPortId.c_str());
6690 printf(
"The HDMI ARC Port Id is %d \r\n",param->portId);
6691 IARM_BUS_Unlock(lock);
6692 return IARM_RESULT_SUCCESS;