RDK Documentation (Open Sourced RDK Components)
dsAudio.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 
22 /**
23 * @defgroup devicesettings
24 * @{
25 * @defgroup rpc
26 * @{
27 **/
28 
29 
30 #include "dsAudio.h"
31 
32 #include <sys/types.h>
33 #include <stdint.h>
34 #include "dsError.h"
35 #include "dsUtl.h"
36 #include "dsRpc.h"
37 #include "dsMgr.h"
38 #include "iarmUtil.h"
39 #include "libIARM.h"
40 #include "libIBus.h"
41 #include "dsTypes.h"
42 #include "dsclientlogger.h"
43 #include <string.h>
44 
45 #include "safec_lib.h"
46 
48 {
49  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
50 
51  printf("<<<<< AOP is initialized in Multi-App Mode >>>>>>>>\r\n");
52 
53  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
54  (char *)IARM_BUS_DSMGR_API_dsAudioPortInit,
55  NULL,
56  0);
57 
58  if (IARM_RESULT_SUCCESS == rpcRet)
59  {
60  return dsERR_NONE;
61  }
62 
63  return dsERR_GENERAL;
64 }
65 
66 dsError_t dsGetAudioPort(dsAudioPortType_t type, int index, intptr_t *handle)
67 {
69  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
70 
71  _DEBUG_ENTER();
72  _RETURN_IF_ERROR(dsAudioType_isValid(type), dsERR_INVALID_PARAM);
73  _RETURN_IF_ERROR((handle) != NULL, dsERR_INVALID_PARAM);
74 
75  param.type = type;
76  param.index = index;
77  param.handle = NULL;
78 
79  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
80  (char *)IARM_BUS_DSMGR_API_dsGetAudioPort,
81  (void *)&param,
82  sizeof(param));
83 
84 
85  if (IARM_RESULT_SUCCESS == rpcRet)
86  {
87  *handle = param.handle;
88  return dsERR_NONE;
89  }
90 
91  return dsERR_GENERAL ;
92 }
93 
94 
95 dsError_t dsGetAudioEncoding(intptr_t handle, dsAudioEncoding_t *encoding)
96 {
97  dsError_t ret = dsERR_NONE;
99 
100  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
101 
102 
103  param.handle = handle;
104  param.encoding = dsAUDIO_ENC_PCM; /* Default to stereo */
105 
106  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
107  (char *)IARM_BUS_DSMGR_API_dsGetEncoding,
108  (void *)&param,
109  sizeof(param));
110 
111  if (IARM_RESULT_SUCCESS == rpcRet)
112  {
113  *encoding = param.encoding;
114  return dsERR_NONE;
115  }
116 
117  return dsERR_GENERAL;
118 }
119 
120 
121 dsError_t dsGetAudioFormat(intptr_t handle, dsAudioFormat_t *audioFormat)
122 {
123  dsError_t ret = dsERR_GENERAL;
124  _DEBUG_ENTER();
125 
126  dsAudioFormatParam_t param;
127  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
128 
129  param.handle = handle;
130  param.audioFormat = dsAUDIO_FORMAT_NONE;
131 
132  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
133  (char *)IARM_BUS_DSMGR_API_dsGetAudioFormat,
134  (void *)&param,
135  sizeof(param));
136 
137  if (IARM_RESULT_SUCCESS == rpcRet)
138  {
139  *audioFormat = param.audioFormat;
140  ret = dsERR_NONE;
141  }
142 
143  return ret;
144 }
145 
146 
147 dsError_t dsGetStereoMode(intptr_t handle, dsAudioStereoMode_t *stereoMode, bool isPersist);
148 dsError_t dsGetStereoMode(intptr_t handle, dsAudioStereoMode_t *stereoMode, bool isPersist)
149 {
150  dsError_t ret = dsERR_NONE;
152 
153  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
154 
155  param.handle = handle;
156  param.mode = dsAUDIO_STEREO_STEREO; /* Default to stereo */
157  param.toPersist = isPersist;
158 
159  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
160  (char *)IARM_BUS_DSMGR_API_dsGetStereoMode,
161  (void *)&param,
162  sizeof(param));
163 
164  if (IARM_RESULT_SUCCESS == rpcRet)
165  {
166  *stereoMode = param.mode;
167  return dsERR_NONE;
168  }
169 
170  return dsERR_NONE;
171 }
172 
173 dsError_t dsGetStereoAuto(intptr_t handle, int *autoMode)
174 {
175  dsError_t ret = dsERR_NONE;
177 
178  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
179 
180  param.handle = handle;
181  param.autoMode = 1; /* Default to auto */
182 
183  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
184  (char *)IARM_BUS_DSMGR_API_dsGetStereoAuto,
185  (void *)&param,
186  sizeof(param));
187 
188  if (IARM_RESULT_SUCCESS == rpcRet)
189  {
190  *autoMode = param.autoMode;
191  return dsERR_NONE;
192  }
193 
194  return dsERR_NONE;
195 }
196 
197 dsError_t dsGetAudioGain(intptr_t handle, float *gain)
198 {
199  dsError_t ret = dsERR_GENERAL;
200  _DEBUG_ENTER();
201 
202  dsAudioGainParam_t param;
203  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
204 
205  param.handle = handle;
206  param.gain = 0;
207 
208  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
209  (char *)IARM_BUS_DSMGR_API_dsGetAudioGain,
210  (void *)&param,
211  sizeof(param));
212 
213  if (IARM_RESULT_SUCCESS == rpcRet)
214  {
215  *gain = param.gain;
216  ret = dsERR_NONE;
217  }
218 
219  return ret;
220 }
221 
222 dsError_t dsGetAudioDB(intptr_t handle, float *db)
223 {
224  dsError_t ret = dsERR_NONE;
226  return ret;
227 }
228 
229 dsError_t dsGetAudioLevel(intptr_t handle, float *level)
230 {
231  dsError_t ret = dsERR_GENERAL;
232  _DEBUG_ENTER();
233 
235  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
236 
237  param.handle = handle;
238  param.level = 0;
239 
240  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
241  (char *)IARM_BUS_DSMGR_API_dsGetAudioLevel,
242  (void *)&param,
243  sizeof(param));
244 
245  if (IARM_RESULT_SUCCESS == rpcRet)
246  {
247  *level = param.level;
248  ret = dsERR_NONE;
249  }
250 
251  return ret;
252 
253 }
254 
255 dsError_t dsGetAudioMaxDB(intptr_t handle, float *maxDb)
256 {
257  dsError_t ret = dsERR_NONE;
258  *maxDb = 180.0;
259  return ret;
260 }
261 
262 dsError_t dsGetAudioMinDB(intptr_t handle, float *minDb)
263 {
264  dsError_t ret = dsERR_NONE;
265  *minDb = -1450;
266  return ret;
267 }
268 
269 dsError_t dsGetAudioOptimalLevel(intptr_t handle, float *optimalLevel)
270 {
271  dsError_t ret = dsERR_NONE;
273  return ret;
274 }
275 
276 dsError_t dsIsAudioLoopThru(intptr_t handle, bool *loopThru)
277 {
278  dsError_t ret = dsERR_NONE;
280  return ret;
281 
282 }
283 
284 dsError_t dsIsAudioMute(intptr_t handle, bool *muted)
285 {
287  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
288 
289  param.handle = handle;
290  param.mute = false;
291  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
292  (char *)IARM_BUS_DSMGR_API_dsIsAudioMute,
293  (void *)&param,
294  sizeof(param));
295  if (IARM_RESULT_SUCCESS == rpcRet)
296  {
297  *muted = param.mute;
298  return dsERR_NONE;
299  }
300  return dsERR_GENERAL ;
301 }
302 
303 dsError_t dsIsAudioPortEnabled(intptr_t handle, bool *enabled)
304 {
306  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
307 
308  param.handle = handle;
309  param.enabled = false;
310 
311  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
312  (char *)IARM_BUS_DSMGR_API_dsIsAudioPortEnabled,
313  (void *)&param,
314  sizeof(param));
315 
316  if (IARM_RESULT_SUCCESS == rpcRet)
317  {
318  *enabled = param.enabled;
319  return dsERR_NONE;
320  }
321 
322  return dsERR_NONE;
323 }
324 
325 dsError_t dsEnableAudioPort(intptr_t handle, bool enabled, const char* portName)
326 {
327  _DEBUG_ENTER();
328 
330  param.handle = handle;
331  param.enabled = enabled;
332  memset(param.portName, '\0', sizeof(param.portName));
333  errno_t rc = -1;
334  rc = strcpy_s (param.portName,sizeof(param.portName), portName);
335  if(rc!=EOK)
336  {
337  ERR_CHK(rc);
338  }
339  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
340 
341  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
342  (char *)IARM_BUS_DSMGR_API_dsEnableAudioPort,
343  (void *)&param,
344  sizeof(param));
345 
346  if (IARM_RESULT_SUCCESS == rpcRet)
347  {
348  return dsERR_NONE;
349  }
350 
351  return dsERR_GENERAL ;
352 }
353 
354 dsError_t dsGetEnablePersist(intptr_t handle, const char* portName, bool *enabled)
355 {
357  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
358 
359  param.handle = handle;
360  /*By default all port values are true*/
361  param.enabled = true;
362  memset(param.portName, '\0', sizeof(param.portName));
363  errno_t rc = -1;
364  rc = strcpy_s (param.portName,sizeof(param.portName), portName);
365  if(rc!=EOK)
366  {
367  ERR_CHK(rc);
368  }
369  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
370  (char *)IARM_BUS_DSMGR_API_dsGetEnablePersist,
371  (void *)&param,
372  sizeof(param));
373  if (IARM_RESULT_SUCCESS == rpcRet)
374  {
375  *enabled = param.enabled;
376  return dsERR_NONE;
377  }
378  printf ("dsGetEnablePersist cli portName:%s rpcRet:%d param.enabled:%d enabled:%d\n",
379  portName, rpcRet, param.enabled, *enabled);
380 
381  return dsERR_NONE;
382 }
383 
384 dsError_t dsSetEnablePersist(intptr_t handle, const char* portName, bool enabled)
385 {
386  _DEBUG_ENTER();
387 
389  param.handle = handle;
390  param.enabled = enabled;
391  memset(param.portName, '\0', sizeof(param.portName));
392  errno_t rc = -1;
393  rc = strcpy_s (param.portName,sizeof(param.portName), portName);
394  if(rc!=EOK)
395  {
396  ERR_CHK(rc);
397  }
398  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
399 
400  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
401  (char *)IARM_BUS_DSMGR_API_dsSetEnablePersist,
402  (void *)&param,
403  sizeof(param));
404 
405  if (IARM_RESULT_SUCCESS == rpcRet)
406  {
407  return dsERR_NONE;
408  }
409 
410  return dsERR_GENERAL ;
411 }
412 
414 {
415  dsError_t ret = dsERR_NONE;
416  /* This is a empty operation in RNG150 */
417  return ret;
418 }
419 
420 
421 dsError_t dsSetStereoMode(intptr_t handle, dsAudioStereoMode_t mode,bool isPersist);
422 dsError_t dsSetStereoMode(intptr_t handle, dsAudioStereoMode_t mode,bool isPersist)
423 {
424  _DEBUG_ENTER();
425  _RETURN_IF_ERROR(dsAudioStereoMode_isValid(mode), dsERR_INVALID_PARAM);
426 
428 
429  param.handle = handle;
430  param.mode = mode;
431  param.rpcResult = dsERR_NONE;
432  param.toPersist = isPersist;
433 
434  IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
435  (char *)IARM_BUS_DSMGR_API_dsSetStereoMode,
436  (void *)&param,
437  sizeof(param));
438 
439  if (dsERR_NONE == param.rpcResult)
440  {
441  return dsERR_NONE;
442  }
443 
444  return dsERR_GENERAL ;
445 }
446 
447 dsError_t dsSetStereoAuto(intptr_t handle, int autoMode, bool isPersist);
448 dsError_t dsSetStereoAuto(intptr_t handle, int autoMode, bool isPersist)
449 {
450  _DEBUG_ENTER();
451 
453  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
454 
455  param.handle = handle;
456  param.autoMode = autoMode;
457  param.toPersist = isPersist;
458 
459 
460  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
461  (char *)IARM_BUS_DSMGR_API_dsSetStereoAuto,
462  (void *)&param,
463  sizeof(param));
464 
465 
466  if (IARM_RESULT_SUCCESS == rpcRet)
467  {
468  return dsERR_NONE;
469  }
470 
471  return dsERR_GENERAL ;
472 }
473 
474 dsError_t dsSetAudioGain(intptr_t handle, float gain)
475 {
476  dsError_t ret = dsERR_GENERAL;
477  _DEBUG_ENTER();
478 
479  dsAudioGainParam_t param;
480  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
481 
482  param.handle = handle;
483  param.gain = gain;
484 
485  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
486  (char *)IARM_BUS_DSMGR_API_dsSetAudioGain,
487  (void *)&param,
488  sizeof(param));
489 
490  if (IARM_RESULT_SUCCESS == rpcRet)
491  {
492  ret = dsERR_NONE;
493  }
494 
495  return ret;
496 }
497 
498 
499 dsError_t dsSetAudioDB(intptr_t handle, float db)
500 {
501  dsError_t ret = dsERR_NONE;
502  /* This is a empty operation in RNG150 */
503  return ret;
504 }
505 
506 
507 dsError_t dsSetAudioLevel(intptr_t handle, float level)
508 {
509  dsError_t ret = dsERR_GENERAL;
510  _DEBUG_ENTER();
511 
513  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
514 
515  param.handle = handle;
516  param.level = level;
517 
518  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
519  (char *)IARM_BUS_DSMGR_API_dsSetAudioLevel,
520  (void *)&param,
521  sizeof(param));
522 
523  if (IARM_RESULT_SUCCESS == rpcRet)
524  {
525  ret = dsERR_NONE;
526  }
527 
528  return ret;
529 }
530 
531 dsError_t dsSetAudioDucking(intptr_t handle,dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level)
532 {
533  dsError_t ret = dsERR_GENERAL;
534  _DEBUG_ENTER();
535 
537  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
538 
539  param.handle = handle;
540  param.action = action;
541  param.type = type;
542  param.level = level;
543 
544 
545  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
546  (char *)IARM_BUS_DSMGR_API_dsSetAudioDucking,
547  (void *)&param,
548  sizeof(param));
549 
550  if (IARM_RESULT_SUCCESS == rpcRet)
551  {
552  ret = dsERR_NONE;
553  }
554 
555  return ret;
556 }
557 
558 dsError_t dsEnableLoopThru(intptr_t handle, bool loopThru)
559 {
560  dsError_t ret = dsERR_NONE;
561  /* This is a empty operation in RNG150 */
562  return ret;
563 }
564 
565 dsError_t dsSetAudioMute(intptr_t handle, bool mute)
566 {
567 
568  _DEBUG_ENTER();
569 
571  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
572 
573  param.handle = handle;
574  param.mute = mute;
575 
576 
577 
578  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
579  (char *)IARM_BUS_DSMGR_API_dsSetAudioMute,
580  (void *)&param,
581  sizeof(param));
582 
583  if (IARM_RESULT_SUCCESS == rpcRet)
584  {
585  return dsERR_NONE;
586  }
587 
588  return dsERR_GENERAL ;
589 }
590 
592 {
593  _DEBUG_ENTER();
594  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
595 
596  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
597  (char *)IARM_BUS_DSMGR_API_dsAudioPortTerm,
598  NULL,
599  0);
600 
601  if (IARM_RESULT_SUCCESS == rpcRet)
602  {
603  return dsERR_NONE;
604  }
605  return dsERR_GENERAL ;
606 }
607 
608 dsError_t dsIsAudioMSDecode(intptr_t handle, bool *HasMS11Decode)
609 {
610  dsAudioGetMS11Param_t param;
611  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
612 
613  param.handle = handle;
614  param.ms11Enabled = false;
615 
616  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
617  (char *)IARM_BUS_DSMGR_API_dsIsAudioMSDecode,
618  (void *)&param,
619  sizeof(param));
620 
621  if (IARM_RESULT_SUCCESS == rpcRet)
622  {
623  *HasMS11Decode = param.ms11Enabled;
624  return dsERR_NONE;
625  }
626 
627  return dsERR_NONE;
628 }
629 
630 dsError_t dsIsAudioMS12Decode(intptr_t handle, bool *HasMS12Decode)
631 {
632  dsAudioGetMS12Param_t param;
633  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
634  param.handle = handle;
635  param.ms12Enabled = false;
636 
637  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
638  (char *)IARM_BUS_DSMGR_API_dsIsAudioMS12Decode,
639  (void *)&param,
640  sizeof(param));
641 
642  if (IARM_RESULT_SUCCESS == rpcRet)
643  {
644  *HasMS12Decode = param.ms12Enabled;
645  return dsERR_NONE;
646  }
647 
648  return dsERR_NONE;
649 }
650 
651 
652 
653 dsError_t dsEnableMS12Config(intptr_t handle, dsMS12FEATURE_t feature,const bool enable)
654 {
655  _dsMS12ConfigParam_t param;
656  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
657 
658  param.handle = handle;
659  param.feature = feature;
660  param.enable = enable;
661 
662 
663  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
664  (char *)IARM_BUS_DSMGR_API_dsEnableMS12Config,
665  (void *)&param,
666  sizeof(param));
667 
668  if (IARM_RESULT_SUCCESS != rpcRet)
669  {
670  return dsERR_GENERAL;
671  }
672 
673  return dsERR_NONE;
674 }
675 
676 dsError_t dsSetAudioDelay(intptr_t handle, const uint32_t audioDelayMs)
677 {
678  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
680  param.handle = handle;
681  param.audioDelayMs = audioDelayMs;
682 
683  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
684  (char *)IARM_BUS_DSMGR_API_dsSetAudioDelay,
685  (void *)&param,
686  sizeof(param));
687 
688  if (IARM_RESULT_SUCCESS != rpcRet)
689  {
690  return dsERR_GENERAL;
691  }
692 
693  return dsERR_NONE;
694 
695 }
696 
697 dsError_t dsSetAudioDelayOffset(intptr_t handle, const uint32_t audioDelayOffsetMs)
698 {
699  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
701  param.handle = handle;
702  param.audioDelayOffsetMs = audioDelayOffsetMs;
703 
704  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
705  (char *)IARM_BUS_DSMGR_API_dsSetAudioDelayOffset,
706  (void *)&param,
707  sizeof(param));
708 
709  if (IARM_RESULT_SUCCESS != rpcRet)
710  {
711  return dsERR_GENERAL;
712  }
713 
714  return dsERR_NONE;
715 
716 }
717 
718 
719 dsError_t dsSetDialogEnhancement(intptr_t handle, int level)
720 {
721  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
723  param.handle = handle;
724  param.enhancerLevel = level;
725 
726  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
727  (char *)IARM_BUS_DSMGR_API_dsSetDialogEnhancement,
728  (void *)&param,
729  sizeof(param));
730  if (IARM_RESULT_SUCCESS != rpcRet)
731  {
732  return dsERR_GENERAL;
733  }
734  return dsERR_NONE;
735 }
736 
737 dsError_t dsSetAudioCompression(intptr_t handle, int compression)
738 {
739  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
741  param.handle = handle;
742  param.compression = compression;
743 
744  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
745  (char *)IARM_BUS_DSMGR_API_dsSetAudioCompression,
746  (void *)&param,
747  sizeof(param));
748  if (IARM_RESULT_SUCCESS != rpcRet)
749  {
750  return dsERR_GENERAL;
751  }
752  return dsERR_NONE;
753 }
754 
755 dsError_t dsSetDolbyVolumeMode(intptr_t handle, bool mode)
756 {
757  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
759  param.handle = handle;
760  param.enable = mode;
761 
762  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
763  (char *)IARM_BUS_DSMGR_API_dsSetDolbyVolumeMode,
764  (void *)&param,
765  sizeof(param));
766  if (IARM_RESULT_SUCCESS != rpcRet)
767  {
768  return dsERR_GENERAL;
769  }
770  return dsERR_NONE;
771 }
772 
773 dsError_t dsSetIntelligentEqualizerMode(intptr_t handle, int mode)
774 {
775  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
777  param.handle = handle;
778  param.mode = mode;
779 
780  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
781  (char *)IARM_BUS_DSMGR_API_dsSetIntelligentEqualizerMode,
782  (void *)&param,
783  sizeof(param));
784 
785  if (IARM_RESULT_SUCCESS != rpcRet)
786  {
787  return dsERR_GENERAL;
788  }
789  return dsERR_NONE;
790 }
791 
792 dsError_t dsGetAudioCompression(intptr_t handle, int *compression)
793 {
794  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
796 
797  param.handle = handle;
798  param.compression = 0;
799 
800  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
801  (char *)IARM_BUS_DSMGR_API_dsGetAudioCompression,
802  (void *)&param,
803  sizeof(param));
804 
805  if (IARM_RESULT_SUCCESS != rpcRet)
806  {
807  printf("%s: AudioCompression (GET) GENERAL ERROR\n", __FUNCTION__);
808  return dsERR_GENERAL;
809  }
810 
811  *compression = param.compression;
812  return dsERR_NONE;
813 }
814 
815 dsError_t dsGetDialogEnhancement(intptr_t handle, int *level)
816 {
817  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
819 
820  param.handle = handle;
821  param.enhancerLevel = 0;
822 
823  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
824  (char *)IARM_BUS_DSMGR_API_dsGetDialogEnhancement,
825  (void *)&param,
826  sizeof(param));
827 
828  if (IARM_RESULT_SUCCESS != rpcRet)
829  {
830  printf("%s: DialogEnhancement (GET) GENERAL ERROR\n", __FUNCTION__);
831  return dsERR_GENERAL;
832  }
833 
834  *level = param.enhancerLevel;
835  return dsERR_NONE;
836 }
837 
838 dsError_t dsGetDolbyVolumeMode(intptr_t handle, bool *mode)
839 {
840  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
842 
843  param.handle = handle;
844  param.enable = false;
845 
846  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
847  (char *)IARM_BUS_DSMGR_API_dsGetDolbyVolumeMode,
848  (void *)&param,
849  sizeof(param));
850 
851  if (IARM_RESULT_SUCCESS != rpcRet)
852  {
853  printf("%s: IntelligentEqualizerMode (GET) GENERAL ERROR\n", __FUNCTION__);
854  return dsERR_GENERAL;
855  }
856 
857  *mode = param.enable;
858  return dsERR_NONE;
859 }
860 
861 dsError_t dsGetIntelligentEqualizerMode(intptr_t handle, int *mode)
862 {
863  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
865 
866  param.handle = handle;
867  param.mode = 0;
868 
869  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
870  (char *)IARM_BUS_DSMGR_API_dsGetIntelligentEqualizerMode,
871  (void *)&param,
872  sizeof(param));
873 
874  if (IARM_RESULT_SUCCESS != rpcRet)
875  {
876  printf("%s: IntelligentEqualizerMode (GET) GENERAL ERROR\n", __FUNCTION__);
877  return dsERR_GENERAL;
878  }
879 
880  *mode = param.mode;
881  return dsERR_NONE;
882 }
883 
884 dsError_t dsGetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t *volLeveller)
885 {
886  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
888 
889  param.handle = handle;
890  param.volLeveller.mode = 0;
891  param.volLeveller.level = 0;
892 
893  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
894  (char *)IARM_BUS_DSMGR_API_dsGetVolumeLeveller,
895  (void *)&param,
896  sizeof(param));
897 
898  if (IARM_RESULT_SUCCESS != rpcRet)
899  {
900  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
901  return dsERR_GENERAL;
902  }
903 
904  volLeveller->mode = param.volLeveller.mode;
905  volLeveller->level = param.volLeveller.level;
906  return dsERR_NONE;
907 }
908 
909 dsError_t dsSetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t volLeveller)
910 {
911  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
913  param.handle = handle;
914  param.volLeveller.mode = volLeveller.mode;
915  param.volLeveller.level = volLeveller.level;
916 
917  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
918  (char *)IARM_BUS_DSMGR_API_dsSetVolumeLeveller,
919  (void *)&param,
920  sizeof(param));
921  if (IARM_RESULT_SUCCESS != rpcRet)
922  {
923  return dsERR_GENERAL;
924  }
925  return dsERR_NONE;
926 }
927 
928 dsError_t dsGetBassEnhancer(intptr_t handle, int *boost)
929 {
930  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
931  dsBassEnhancerParam_t param;
932 
933  param.handle = handle;
934  param.boost = 0;
935 
936  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
937  (char *)IARM_BUS_DSMGR_API_dsGetBassEnhancer,
938  (void *)&param,
939  sizeof(param));
940 
941  if (IARM_RESULT_SUCCESS != rpcRet)
942  {
943  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
944  return dsERR_GENERAL;
945  }
946 
947  *boost = param.boost;
948  return dsERR_NONE;
949 }
950 
951 dsError_t dsSetBassEnhancer(intptr_t handle, int boost)
952 {
953  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
954  dsBassEnhancerParam_t param;
955  param.handle = handle;
956  param.boost = boost;
957 
958  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
959  (char *)IARM_BUS_DSMGR_API_dsSetBassEnhancer,
960  (void *)&param,
961  sizeof(param));
962  if (IARM_RESULT_SUCCESS != rpcRet)
963  {
964  return dsERR_GENERAL;
965  }
966  return dsERR_NONE;
967 }
968 
969 dsError_t dsIsSurroundDecoderEnabled(intptr_t handle, bool *enabled)
970 {
971  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
973 
974  param.handle = handle;
975  param.enable = false;
976 
977  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
978  (char *)IARM_BUS_DSMGR_API_dsIsSurroundDecoderEnabled,
979  (void *)&param,
980  sizeof(param));
981 
982  if (IARM_RESULT_SUCCESS != rpcRet)
983  {
984  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
985  return dsERR_GENERAL;
986  }
987 
988  *enabled = param.enable;
989  return dsERR_NONE;
990 }
991 
992 dsError_t dsEnableSurroundDecoder(intptr_t handle, bool enabled)
993 {
994  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
996  param.handle = handle;
997  param.enable = enabled;
998 
999  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1000  (char *)IARM_BUS_DSMGR_API_dsEnableSurroundDecoder,
1001  (void *)&param,
1002  sizeof(param));
1003  if (IARM_RESULT_SUCCESS != rpcRet)
1004  {
1005  return dsERR_GENERAL;
1006  }
1007  return dsERR_NONE;
1008 }
1009 
1010 dsError_t dsGetDRCMode(intptr_t handle, int *mode)
1011 {
1012  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1013  dsDRCModeParam_t param;
1014 
1015  param.handle = handle;
1016  param.mode = 0;
1017 
1018  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1019  (char *)IARM_BUS_DSMGR_API_dsGetDRCMode,
1020  (void *)&param,
1021  sizeof(param));
1022 
1023  if (IARM_RESULT_SUCCESS != rpcRet)
1024  {
1025  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1026  return dsERR_GENERAL;
1027  }
1028 
1029  *mode = param.mode;
1030  return dsERR_NONE;
1031 }
1032 
1033 dsError_t dsSetDRCMode(intptr_t handle, int mode)
1034 {
1035  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1036  dsDRCModeParam_t param;
1037  param.handle = handle;
1038  param.mode = mode;
1039 
1040  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1041  (char *)IARM_BUS_DSMGR_API_dsSetDRCMode,
1042  (void *)&param,
1043  sizeof(param));
1044  if (IARM_RESULT_SUCCESS != rpcRet)
1045  {
1046  return dsERR_GENERAL;
1047  }
1048  return dsERR_NONE;
1049 }
1050 
1052 {
1053  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1055 
1056  param.handle = handle;
1057  param.virtualizer.mode = 0;
1058  param.virtualizer.boost = 0;
1059 
1060  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1061  (char *)IARM_BUS_DSMGR_API_dsGetSurroundVirtualizer,
1062  (void *)&param,
1063  sizeof(param));
1064 
1065  if (IARM_RESULT_SUCCESS != rpcRet)
1066  {
1067  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1068  return dsERR_GENERAL;
1069  }
1070 
1071  virtualizer->mode = param.virtualizer.mode;
1072  virtualizer->boost = param.virtualizer.boost;
1073  return dsERR_NONE;
1074 }
1075 
1077 {
1078  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1080  param.handle = handle;
1081  param.virtualizer.mode = virtualizer.mode;
1082  param.virtualizer.boost = virtualizer.boost;
1083 
1084  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1085  (char *)IARM_BUS_DSMGR_API_dsSetSurroundVirtualizer,
1086  (void *)&param,
1087  sizeof(param));
1088  if (IARM_RESULT_SUCCESS != rpcRet)
1089  {
1090  return dsERR_GENERAL;
1091  }
1092  return dsERR_NONE;
1093 }
1094 
1095 dsError_t dsGetMISteering(intptr_t handle, bool *enabled)
1096 {
1097  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1098  dsMISteeringParam_t param;
1099 
1100  param.handle = handle;
1101  param.enable = false;
1102 
1103  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1104  (char *)IARM_BUS_DSMGR_API_dsGetMISteering,
1105  (void *)&param,
1106  sizeof(param));
1107 
1108  if (IARM_RESULT_SUCCESS != rpcRet)
1109  {
1110  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1111  return dsERR_GENERAL;
1112  }
1113 
1114  *enabled = param.enable;
1115  return dsERR_NONE;
1116 }
1117 
1118 dsError_t dsSetMISteering(intptr_t handle, bool enabled)
1119 {
1120  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1121  dsMISteeringParam_t param;
1122  param.handle = handle;
1123  param.enable = enabled;
1124 
1125  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1126  (char *)IARM_BUS_DSMGR_API_dsSetMISteering,
1127  (void *)&param,
1128  sizeof(param));
1129  if (IARM_RESULT_SUCCESS != rpcRet)
1130  {
1131  return dsERR_GENERAL;
1132  }
1133  return dsERR_NONE;
1134 }
1135 
1136 dsError_t dsGetGraphicEqualizerMode(intptr_t handle, int *mode)
1137 {
1138  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1140 
1141  param.handle = handle;
1142  param.mode = 0;
1143 
1144  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1145  (char *)IARM_BUS_DSMGR_API_dsGetGraphicEqualizerMode,
1146  (void *)&param,
1147  sizeof(param));
1148 
1149  if (IARM_RESULT_SUCCESS != rpcRet)
1150  {
1151  printf("%s: GraphicEqualizerMode (GET) GENERAL ERROR\n", __FUNCTION__);
1152  return dsERR_GENERAL;
1153  }
1154 
1155  *mode = param.mode;
1156  return dsERR_NONE;
1157 }
1158 
1159 dsError_t dsSetGraphicEqualizerMode(intptr_t handle, int mode)
1160 {
1161  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1163  param.handle = handle;
1164  param.mode = mode;
1165 
1166  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1167  (char *)IARM_BUS_DSMGR_API_dsSetGraphicEqualizerMode,
1168  (void *)&param,
1169  sizeof(param));
1170 
1171  if (IARM_RESULT_SUCCESS != rpcRet)
1172  {
1173  return dsERR_GENERAL;
1174  }
1175  return dsERR_NONE;
1176 }
1177 
1179 {
1180  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1182 
1183  param.handle = handle;
1184 
1185  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1186  (char *)IARM_BUS_DSMGR_API_dsGetMS12AudioProfileList,
1187  (void *)&param,
1188  sizeof(param));
1189 
1190  if (IARM_RESULT_SUCCESS != rpcRet)
1191  {
1192  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1193  return dsERR_GENERAL;
1194  }
1195 
1196  profiles->audioProfileCount = param.profileList.audioProfileCount;
1197  strncpy(profiles->audioProfileList, param.profileList.audioProfileList, MAX_PROFILE_LIST_BUFFER_LEN);
1198  return dsERR_NONE;
1199 }
1200 
1201 dsError_t dsGetMS12AudioProfile(intptr_t handle, char *profile)
1202 {
1203  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1205 
1206  param.handle = handle;
1207 
1208  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1209  (char *)IARM_BUS_DSMGR_API_dsGetMS12AudioProfile,
1210  (void *)&param,
1211  sizeof(param));
1212 
1213  if (IARM_RESULT_SUCCESS != rpcRet)
1214  {
1215  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1216  return dsERR_GENERAL;
1217  }
1218 
1219 
1220  strncpy(profile, param.profile, MAX_PROFILE_STRING_LEN);
1221  return dsERR_NONE;
1222 }
1223 
1224 dsError_t dsSetMS12AudioProfile(intptr_t handle, const char* profile)
1225 {
1226  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1228  param.handle = handle;
1229 
1230  memset( param.profile, 0, sizeof(param.profile) );
1231  errno_t rc = -1;
1232  rc = strcpy_s (param.profile,sizeof(param.profile), profile );
1233  if(rc!=EOK)
1234  {
1235  ERR_CHK(rc);
1236  }
1237  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1238  (char *)IARM_BUS_DSMGR_API_dsSetMS12AudioProfile,
1239  (void *)&param,
1240  sizeof(param));
1241  if (IARM_RESULT_SUCCESS != rpcRet)
1242  {
1243  return dsERR_GENERAL;
1244  }
1245  return dsERR_NONE;
1246 }
1247 
1248 dsError_t dsSetAssociatedAudioMixing(intptr_t handle, bool mixing)
1249 {
1250  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1252  param.handle = handle;
1253  param.mixing = mixing;
1254 
1255  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1256  (char *)IARM_BUS_DSMGR_API_dsSetAssociatedAudioMixing,
1257  (void *)&param,
1258  sizeof(param));
1259  if (IARM_RESULT_SUCCESS != rpcRet)
1260  {
1261  return dsERR_GENERAL;
1262  }
1263  return dsERR_NONE;
1264 }
1265 
1266 
1267 dsError_t dsGetAssociatedAudioMixing(intptr_t handle, bool *mixing)
1268 {
1269  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1271 
1272  param.handle = handle;
1273  param.mixing = false;
1274 
1275  if(mixing == NULL) {
1276  printf("%s: (GET) Invalid Param error\n", __FUNCTION__);
1277  return dsERR_INVALID_PARAM;
1278  }
1279  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1280  (char *)IARM_BUS_DSMGR_API_dsGetAssociatedAudioMixing,
1281  (void *)&param,
1282  sizeof(param));
1283 
1284  if (IARM_RESULT_SUCCESS != rpcRet)
1285  {
1286  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1287  return dsERR_GENERAL;
1288  }
1289 
1290  *mixing = param.mixing;
1291  return dsERR_NONE;
1292 }
1293 
1294 dsError_t dsSetFaderControl(intptr_t handle, int mixerbalance)
1295 {
1296  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1297  dsFaderControlParam_t param;
1298  param.handle = handle;
1299  param.mixerbalance = mixerbalance;
1300 
1301  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1302  (char *)IARM_BUS_DSMGR_API_dsSetFaderControl,
1303  (void *)&param,
1304  sizeof(param));
1305 
1306  if (IARM_RESULT_SUCCESS != rpcRet)
1307  {
1308  return dsERR_GENERAL;
1309  }
1310  return dsERR_NONE;
1311 }
1312 
1313 
1314 dsError_t dsGetFaderControl(intptr_t handle, int *mixerbalance)
1315 {
1316  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1317  dsFaderControlParam_t param;
1318 
1319  param.handle = handle;
1320  param.mixerbalance = 0;
1321 
1322  if(mixerbalance == NULL) {
1323  printf("%s: (GET) Invalid Param error\n", __FUNCTION__);
1324  return dsERR_INVALID_PARAM;
1325  }
1326 
1327  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1328  (char *)IARM_BUS_DSMGR_API_dsGetFaderControl,
1329  (void *)&param,
1330  sizeof(param));
1331 
1332  if (IARM_RESULT_SUCCESS != rpcRet)
1333  {
1334  printf("%s: mixerbalance (GET) GENERAL ERROR\n", __FUNCTION__);
1335  return dsERR_GENERAL;
1336  }
1337 
1338  *mixerbalance = param.mixerbalance;
1339  return dsERR_NONE;
1340 }
1341 
1342 dsError_t dsSetPrimaryLanguage(intptr_t handle, const char* pLang)
1343 {
1344  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1346  param.handle = handle;
1347 
1348  if(pLang == NULL) {
1349  printf("%s: (SET) Invalid Param error\n", __FUNCTION__);
1350  return dsERR_INVALID_PARAM;
1351  }
1352 
1353  memset(param.primaryLanguage, '\0', sizeof(param.primaryLanguage));
1354  errno_t rc = -1;
1355  rc = strcpy_s (param.primaryLanguage,sizeof(param.primaryLanguage), pLang);
1356  if(rc!=EOK)
1357  {
1358  ERR_CHK(rc);
1359  }
1360  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1361  (char *)IARM_BUS_DSMGR_API_dsSetPrimaryLanguage,
1362  (void *)&param,
1363  sizeof(param));
1364  if (IARM_RESULT_SUCCESS != rpcRet)
1365  {
1366  return dsERR_GENERAL;
1367  }
1368  return dsERR_NONE;
1369 }
1370 
1371 dsError_t dsGetPrimaryLanguage(intptr_t handle, char *pLang)
1372 {
1373  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1375 
1376  param.handle = handle;
1377 
1378  if(pLang == NULL) {
1379  printf("%s: (GET) Invalid Param error\n", __FUNCTION__);
1380  return dsERR_INVALID_PARAM;
1381  }
1382 
1383  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1384  (char *)IARM_BUS_DSMGR_API_dsGetPrimaryLanguage,
1385  (void *)&param,
1386  sizeof(param));
1387 
1388  if (IARM_RESULT_SUCCESS != rpcRet)
1389  {
1390  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1391  return dsERR_GENERAL;
1392  }
1393 
1394 
1395  strcpy_s(pLang, sizeof(param.primaryLanguage), param.primaryLanguage);
1396  return dsERR_NONE;
1397 }
1398 
1399 dsError_t dsSetSecondaryLanguage(intptr_t handle, const char* sLang)
1400 {
1401  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1403  param.handle = handle;
1404 
1405  if(sLang == NULL) {
1406  printf("%s: (SET) Invalid Param error\n", __FUNCTION__);
1407  return dsERR_INVALID_PARAM;
1408  }
1409 
1410  memset(param.secondaryLanguage, '\0', sizeof(param.secondaryLanguage));
1411  errno_t rc = -1;
1412  rc = strcpy_s (param.secondaryLanguage,sizeof(param.secondaryLanguage), sLang);
1413  if(rc!=EOK)
1414  {
1415  ERR_CHK(rc);
1416  }
1417  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1418  (char *)IARM_BUS_DSMGR_API_dsSetSecondaryLanguage,
1419  (void *)&param,
1420  sizeof(param));
1421  if (IARM_RESULT_SUCCESS != rpcRet)
1422  {
1423  return dsERR_GENERAL;
1424  }
1425  return dsERR_NONE;
1426 }
1427 
1428 dsError_t dsGetSecondaryLanguage(intptr_t handle, char *sLang)
1429 {
1430  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1432 
1433  param.handle = handle;
1434 
1435  if(sLang == NULL) {
1436  printf("%s: (GET) Invalid Param error\n", __FUNCTION__);
1437  return dsERR_INVALID_PARAM;
1438  }
1439 
1440  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1441  (char *)IARM_BUS_DSMGR_API_dsGetSecondaryLanguage,
1442  (void *)&param,
1443  sizeof(param));
1444 
1445  if (IARM_RESULT_SUCCESS != rpcRet)
1446  {
1447  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1448  return dsERR_GENERAL;
1449  }
1450 
1451 
1452  strcpy_s(sLang, sizeof(param.secondaryLanguage), param.secondaryLanguage);
1453  return dsERR_NONE;
1454 }
1455 
1456 dsError_t dsSetMS12AudioProfileSetttingsOverride(intptr_t handle,const char* profileState,const char* profileName,
1457  const char* profileSettingsName,const char* profileSettingValue)
1458 {
1459  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1461  param.handle = handle;
1462 
1463  memset( param.profileState, 0, sizeof(param.profileState) );
1464  errno_t rc = -1;
1465  rc = strcpy_s (param.profileState,sizeof(param.profileState), profileState );
1466  if(rc!=EOK)
1467  {
1468  ERR_CHK(rc);
1469  }
1470 
1471  memset( param.profileName, 0, sizeof(param.profileName) );
1472  rc = strcpy_s (param.profileName,sizeof(param.profileName), profileName );
1473  if(rc!=EOK)
1474  {
1475  ERR_CHK(rc);
1476  }
1477 
1478  memset( param.profileSettingsName, 0, sizeof(param.profileSettingsName) );
1479  rc = strcpy_s (param.profileSettingsName,sizeof(param.profileSettingsName), profileSettingsName );
1480  if(rc!=EOK)
1481  {
1482  ERR_CHK(rc);
1483  }
1484 
1485  memset( param.profileSettingValue, 0, sizeof(param.profileSettingValue) );
1486  rc = strcpy_s (param.profileSettingValue,sizeof(param.profileSettingValue),profileSettingValue);
1487  if(rc!=EOK)
1488  {
1489  ERR_CHK(rc);
1490  }
1491 
1492  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1493  (char *)IARM_BUS_DSMGR_API_dsSetMS12SetttingsOverride,
1494  (void *)&param,
1495  sizeof(param));
1496  if (IARM_RESULT_SUCCESS != rpcRet)
1497  {
1498  return dsERR_GENERAL;
1499  }
1500  return dsERR_NONE;
1501 
1502 }
1503 
1504 dsError_t dsGetSupportedARCTypes(intptr_t handle, int *types)
1505 {
1506  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1508 
1509  param.handle = handle;
1510  param.types = dsAUDIOARCSUPPORT_NONE;
1511 
1512  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1513  (char *)IARM_BUS_DSMGR_API_dsGetSupportedARCTypes,
1514  (void *)&param,
1515  sizeof(param));
1516 
1517  if (IARM_RESULT_SUCCESS != rpcRet)
1518  {
1519  printf("%s: (GET) GENERAL ERROR\n", __FUNCTION__);
1520  return dsERR_GENERAL;
1521  }
1522 
1523  *types = param.types;
1524  return dsERR_NONE;
1525 }
1526 
1527 dsError_t dsAudioSetSAD(intptr_t handle, dsAudioSADList_t sad_list)
1528 {
1529  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1530  dsAudioSetSADParam_t param;
1531  param.handle = handle;
1532  param.list.count = sad_list.count;
1533 
1534  for(int i=0;i<sad_list.count;i++) {
1535  param.list.sad[i] = sad_list.sad[i];
1536  }
1537 
1538  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1539  (char *)IARM_BUS_DSMGR_API_dsAudioSetSAD,
1540  (void *)&param,
1541  sizeof(param));
1542 
1543  if (IARM_RESULT_SUCCESS != rpcRet)
1544  {
1545  printf("%s: (SET) GENERAL ERROR\n", __FUNCTION__);
1546  return dsERR_GENERAL;
1547  }
1548 
1549  return dsERR_NONE;
1550 }
1551 
1552 dsError_t dsAudioEnableARC(intptr_t handle, dsAudioARCStatus_t arcStatus)
1553 {
1554  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1556  param.handle = handle;
1557  param.arcStatus.type = arcStatus.type;
1558  param.arcStatus.status = arcStatus.status;
1559 
1560  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1561  (char *)IARM_BUS_DSMGR_API_dsAudioEnableARC,
1562  (void *)&param,
1563  sizeof(param));
1564  if (IARM_RESULT_SUCCESS != rpcRet)
1565  {
1566  printf("%s: (SET) GENERAL ERROR\n", __FUNCTION__);
1567  return dsERR_GENERAL;
1568  }
1569  return dsERR_NONE;
1570 }
1571 
1572 dsError_t dsGetAudioDelay(intptr_t handle, uint32_t *audioDelayMs)
1573 {
1574  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1575  dsGetAudioDelayParam_t param;
1576 
1577  param.handle = handle;
1578  param.audioDelayMs = 0;
1579 
1580  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1581  (char *)IARM_BUS_DSMGR_API_dsGetAudioDelay,
1582  (void *)&param,
1583  sizeof(param));
1584 
1585  if (IARM_RESULT_SUCCESS != rpcRet)
1586  {
1587  INT_ERROR("%s: AUDIODELAY CLIENT (GET) GENERAL ERROR\n", __FUNCTION__);
1588  return dsERR_GENERAL;
1589  }
1590 
1591  *audioDelayMs = param.audioDelayMs;
1592  return dsERR_NONE;
1593 }
1594 
1595 dsError_t dsGetAudioDelayOffset(intptr_t handle, uint32_t *audioDelayOffsetMs)
1596 {
1597  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1599 
1600  param.handle = handle;
1601  param.audioDelayOffsetMs = 0;
1602 
1603  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1604  (char *)IARM_BUS_DSMGR_API_dsGetAudioDelayOffset,
1605  (void *)&param,
1606  sizeof(param));
1607 
1608  if (IARM_RESULT_SUCCESS != rpcRet)
1609  {
1610  printf("%s: AUDIODELAY CLIENT (GET) GENERAL ERROR\n", __FUNCTION__);
1611  return dsERR_GENERAL;
1612  }
1613 
1614  *audioDelayOffsetMs = param.audioDelayOffsetMs;
1615  return dsERR_NONE;
1616 }
1617 
1618 
1619 dsError_t dsSetAudioAtmosOutputMode(intptr_t handle, bool enable)
1620 {
1621  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1623 
1624  param.handle = handle;
1625  param.enable = enable;
1626 
1627  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1628  (char *)IARM_BUS_DSMGR_API_dsSetAudioAtmosOutputMode,
1629  (void *)&param,
1630  sizeof(param));
1631 
1632  if (IARM_RESULT_SUCCESS != rpcRet)
1633  {
1634  printf("%s: AUDIODELAY CLIENT (GET) GENERAL ERROR\n", __FUNCTION__);
1635  return dsERR_GENERAL;
1636  }
1637 
1638  return dsERR_NONE;
1639 }
1640 dsError_t dsGetSinkDeviceAtmosCapability(intptr_t handle, dsATMOSCapability_t *capability)
1641 {
1642  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1644 
1645  param.handle = handle;
1646  param.capability= dsAUDIO_ATMOS_NOTSUPPORTED;
1647 
1648  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1649  (char *)IARM_BUS_DSMGR_API_dsGetSinkDeviceAtmosCapability,
1650  (void *)&param,
1651  sizeof(param));
1652 
1653  if (IARM_RESULT_SUCCESS != rpcRet)
1654  {
1655  printf("%s: AUDIODELAY CLIENT (GET) GENERAL ERROR\n", __FUNCTION__);
1656  return dsERR_GENERAL;
1657  }
1658 
1659  *capability = param.capability;
1660  return dsERR_NONE;
1661 }
1662 
1663 dsError_t dsEnableLEConfig(intptr_t handle, const bool enable)
1664 {
1665  _dsLEConfigParam_t param;
1666  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1667 
1668  param.handle = handle;
1669  param.enable = enable;
1670 
1671 
1672  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1673  (char *)IARM_BUS_DSMGR_API_dsEnableLEConfig,
1674  (void *)&param,
1675  sizeof(param));
1676 
1677  if (IARM_RESULT_SUCCESS != rpcRet)
1678  {
1679  return dsERR_GENERAL;
1680  }
1681 
1682  return dsERR_NONE;
1683 }
1684 
1685 dsError_t dsGetLEConfig(intptr_t handle, bool *enable)
1686 {
1687  dsGetLEConfigParam_t param;
1688  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1689 
1690  param.handle = handle;
1691  param.enable = false;
1692 
1693 
1694  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1695  (char *)IARM_BUS_DSMGR_API_dsGetLEConfig,
1696  (void *)&param,
1697  sizeof(param));
1698 
1699  if (IARM_RESULT_SUCCESS != rpcRet)
1700  {
1701  return dsERR_GENERAL;
1702  }
1703 
1704  *enable = param.enable;
1705  return dsERR_NONE;
1706 }
1707 
1708 dsError_t dsGetAudioCapabilities(intptr_t handle, int *capabilities)
1709 {
1710  _DEBUG_ENTER();
1711 
1713  param.handle = handle;
1714 
1715  IARM_Result_t rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1716  (char *) IARM_BUS_DSMGR_API_dsGetAudioCapabilities,
1717  (void *) &param,
1718  sizeof(param));
1719 
1720  if (IARM_RESULT_SUCCESS == rpcRet)
1721  {
1722  *capabilities = param.capabilities;
1723  return param.result;
1724  }
1725 
1726  return dsERR_GENERAL ;
1727 }
1728 
1729 dsError_t dsGetMS12Capabilities(intptr_t handle, int *capabilities)
1730 {
1731  _DEBUG_ENTER();
1732 
1734  param.handle = handle;
1735 
1736  IARM_Result_t rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1737  (char *) IARM_BUS_DSMGR_API_dsGetMS12Capabilities,
1738  (void *) &param,
1739  sizeof(param));
1740 
1741  if (IARM_RESULT_SUCCESS == rpcRet)
1742  {
1743  *capabilities = param.capabilities;
1744  return param.result;
1745  }
1746 
1747  return dsERR_GENERAL ;
1748 }
1749 
1750 dsError_t dsAudioOutIsConnected(intptr_t handle, bool* pisCon)
1751 {
1753  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1754 
1755  param.handle = handle;
1756  param.isCon = true;
1757  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1758  (char *) IARM_BUS_DSMGR_API_dsAudioOutIsConnected,
1759  (void *)&param,
1760  sizeof(param));
1761  if (IARM_RESULT_SUCCESS == rpcRet)
1762  {
1763  *pisCon = param.isCon;
1764  return dsERR_NONE;
1765  }
1766  return dsERR_GENERAL ;
1767 }
1768 
1770 {
1771  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1772  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1773  (char *) IARM_BUS_DSMGR_API_dsResetDialogEnhancement,
1774  (void *)&handle,
1775  sizeof(intptr_t));
1776  if (IARM_RESULT_SUCCESS == rpcRet)
1777  {
1778  return dsERR_NONE;
1779  }
1780  return dsERR_GENERAL ;
1781 
1782 }
1783 
1784 
1786 {
1787  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1788  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1789  (char *) IARM_BUS_DSMGR_API_dsResetBassEnhancer,
1790  (void *)&handle,
1791  sizeof(intptr_t));
1792  if (IARM_RESULT_SUCCESS == rpcRet)
1793  {
1794  return dsERR_NONE;
1795  }
1796  return dsERR_GENERAL ;
1797 
1798 }
1799 
1801 {
1802  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1803  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1804  (char *) IARM_BUS_DSMGR_API_dsResetSurroundVirtualizer,
1805  (void *)&handle,
1806  sizeof(intptr_t));
1807  if (IARM_RESULT_SUCCESS == rpcRet)
1808  {
1809  return dsERR_NONE;
1810  }
1811  return dsERR_GENERAL ;
1812 
1813 }
1814 
1816 {
1817  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1818  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1819  (char *) IARM_BUS_DSMGR_API_dsResetVolumeLeveller,
1820  (void *)&handle,
1821  sizeof(intptr_t));
1822  if (IARM_RESULT_SUCCESS == rpcRet)
1823  {
1824  return dsERR_NONE;
1825  }
1826  return dsERR_GENERAL ;
1827 
1828 }
1829 
1831 {
1833  IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
1834 
1835  param.portId = -1;
1836  rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
1837  (char *)IARM_BUS_DSMGR_API_dsGetHDMIARCPortId,
1838  (void *)&param,
1839  sizeof(param));
1840  if (IARM_RESULT_SUCCESS == rpcRet)
1841  {
1842  *portId = param.portId;
1843  return dsERR_NONE;
1844  }
1845  return dsERR_GENERAL ;
1846 }
1847 /** @} */
1848 /** @} */
_dsGrpahicEqualizerModeParam_t
Definition: dsRpc.h:458
dsAudioSetSAD
dsError_t dsAudioSetSAD(intptr_t handle, dsAudioSADList_t sad_list)
Set Short Audio Descriptor retrieved from CEC for the connected ARC device.
Definition: dsAudio.c:1527
_dsDRCModeParam_t
Definition: dsRpc.h:443
_dsSurroundDecoderParam_t
Definition: dsRpc.h:438
dsSetGraphicEqualizerMode
dsError_t dsSetGraphicEqualizerMode(intptr_t handle, int mode)
Get the Graphic Equalizer Mode.
Definition: dsAudio.c:1159
dsEnableLEConfig
dsError_t dsEnableLEConfig(intptr_t handle, const bool enable)
This function is used to enable or disable Loudness Equivalence feature.
Definition: dsAudio.c:1663
_dsAudioARCStatus_t
Structure that defines ARC status for the HDMI ARC/EARC port.
Definition: dsTypes.h:307
dsIsAudioMS12Decode
dsError_t dsIsAudioMS12Decode(intptr_t handle, bool *HasMS12Decode)
This function is used to check whether the audio port supports Dolby MS12 Multistream Decode.
Definition: dsAudio.c:630
_dsAudioSetLevelParam_t
Definition: dsRpc.h:346
dsSetAudioAtmosOutputMode
dsError_t dsSetAudioAtmosOutputMode(intptr_t handle, bool enable)
Set the audio ATMOS outout mode.
Definition: dsAudio.c:1619
_dsAudioSADList_t
Definition: dsTypes.h:299
dsGetAudioMinDB
dsError_t dsGetAudioMinDB(intptr_t handle, float *minDb)
Get the minimum audio dB level of an audio port.
Definition: dsAudio.c:262
_dsAssociatedAudioMixingParam_t
Definition: dsRpc.h:463
dsGetAssociatedAudioMixing
dsError_t dsGetAssociatedAudioMixing(intptr_t handle, bool *mixing)
To get the Associated Audio Mixing status - enabled/disabled.
Definition: dsAudio.c:1267
_dsSetDolbyVolumeParam_t
Definition: dsRpc.h:418
dsSetAudioGain
dsError_t dsSetAudioGain(intptr_t handle, float gain)
Set the audio gain of an audio port.
Definition: dsAudio.c:474
_dsAudioSetStereoAutoParam_t
Definition: dsRpc.h:330
_dsAudioCompressionParam_t
Definition: dsRpc.h:408
dsEnableSurroundDecoder
dsError_t dsEnableSurroundDecoder(intptr_t handle, bool enabled)
To set the audio Surround Decoder.
Definition: dsAudio.c:992
_dsAudioEnableARCParam_t
Definition: dsRpc.h:318
_dsBassEnhancerParam_t
Definition: dsRpc.h:433
_dsMS12SetttingsOverrideParam_t
Definition: dsRpc.h:490
dsGetAudioEncoding
dsError_t dsGetAudioEncoding(intptr_t handle, dsAudioEncoding_t *encoding)
Get the encoding type of an audio port.
Definition: dsAudio.c:95
_dsAudioSetStereoModeParam_t
Definition: dsRpc.h:323
dsSetStereoMode
dsError_t dsSetStereoMode(intptr_t handle, dsAudioStereoMode_t mode)
Set the stereo mode of an audio port.
_dsVolumeLevellerParam_t
Definition: dsRpc.h:428
_dsGetAudioDelayParam_t
Definition: dsRpc.h:383
_dsGetSupportedARCTypesParam_t
Definition: dsRpc.h:308
dsGetAudioCapabilities
dsError_t dsGetAudioCapabilities(intptr_t handle, int *capabilities)
To find the HDR capabilities of SoC.
Definition: dsAudio.c:1708
dsEnableAudioPort
dsError_t dsEnableAudioPort(intptr_t handle, bool enabled)
This function is used to enable or disable the specified Audio port.
dsAUDIO_ATMOS_NOTSUPPORTED
@ dsAUDIO_ATMOS_NOTSUPPORTED
Definition: dsTypes.h:387
dsSetDialogEnhancement
dsError_t dsSetDialogEnhancement(intptr_t handle, int level)
Get the Dialog Enhancement level of an audio port.
Definition: dsAudio.c:719
dsEnableMS12Config
dsError_t dsEnableMS12Config(intptr_t handle, dsMS12FEATURE_t feature, const bool enable)
This function is used to enable or disable MS12 DAPV2 and DE feature.
Definition: dsAudio.c:653
dsGetSecondaryLanguage
dsError_t dsGetSecondaryLanguage(intptr_t handle, char *sLang)
To get AC4 Secondary language.
Definition: dsAudio.c:1428
_dsVolumeLeveller_t
Definition: dsTypes.h:352
dsAudioDuckingType_t
enum _dsAudioDuckingType_t dsAudioDuckingType_t
dsAudioPortType_t
enum _dsAudioPortType_t dsAudioPortType_t
dsGetStereoMode
dsError_t dsGetStereoMode(intptr_t handle, dsAudioStereoMode_t *stereoMode)
Get the stereo mode of an audio port.
dsIsAudioMSDecode
dsError_t dsIsAudioMSDecode(intptr_t handle, bool *HasMS11Decode)
This function is used to check whether the audio port supports Dolby MS11 Multistream Decode.
Definition: dsAudio.c:608
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
dsTypes.h
Device Settings HAL types.
_dsIntelligentEqualizerModeParam_t
Definition: dsRpc.h:423
dsSetMISteering
dsError_t dsSetMISteering(intptr_t handle, bool enabled)
To set the audio Media intelligent Steering.
Definition: dsAudio.c:1118
dsGetAudioDelayOffset
dsError_t dsGetAudioDelayOffset(intptr_t handle, uint32_t *audioDelayOffsetMs)
Get the audio delay offset in milliseconds.
Definition: dsAudio.c:1595
_dsAudioGetMS12Param_t
Definition: dsRpc.h:378
_dsGetLEConfigParam_t
Definition: dsRpc.h:869
dsGetGraphicEqualizerMode
dsError_t dsGetGraphicEqualizerMode(intptr_t handle, int *mode)
Get the Graphic Equalizer Mode.
Definition: dsAudio.c:1136
dsAUDIO_STEREO_STEREO
@ dsAUDIO_STEREO_STEREO
Definition: dsTypes.h:376
_dsSetAudioDelayParam_t
Definition: dsRpc.h:398
dsAudioStereoMode_isValid
#define dsAudioStereoMode_isValid(t)
Definition: dsTypes.h:395
dsSetVolumeLeveller
dsError_t dsSetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t volLeveller)
To set the Dolby volume leveller.
Definition: dsAudio.c:909
dsMS12FEATURE_t
enum _dsMS12FEATURE_t dsMS12FEATURE_t
dsSetMS12AudioProfile
dsError_t dsSetMS12AudioProfile(intptr_t handle, const char *profile)
To set the ms12 audio profile.
Definition: dsAudio.c:1224
dsGetHDMIARCPortId
dsError_t dsGetHDMIARCPortId(int *portId)
Get the audio HDMI ARC port ID for each platform.
Definition: dsAudio.c:1830
dsError.h
Device Settings HAL error codes.
dsResetBassEnhancer
dsError_t dsResetBassEnhancer(intptr_t handle)
to reset the reset the audio Bass
Definition: dsAudio.c:1785
_dsVideoPortEnabledParam_t
Definition: dsRpc.h:509
dsIsSurroundDecoderEnabled
dsError_t dsIsSurroundDecoderEnabled(intptr_t handle, bool *enabled)
To get the audio Surround Decoder.
Definition: dsAudio.c:969
dsAUDIO_ENC_PCM
@ dsAUDIO_ENC_PCM
Definition: dsTypes.h:186
_dsAudioGetHandleParam_t
Definition: dsRpc.h:302
dsUtl.h
Device Settings HAL utilities.
dsERR_GENERAL
@ dsERR_GENERAL
Definition: dsError.h:86
dsSetMS12AudioProfileSetttingsOverride
dsError_t dsSetMS12AudioProfileSetttingsOverride(intptr_t handle, const char *profileState, const char *profileName, const char *profileSettingsName, const char *profileSettingValue)
To Set/override a specific audio setting in a specific profile.
Definition: dsAudio.c:1456
_dsDialogEnhancementParam_t
Definition: dsRpc.h:413
dsGetSinkDeviceAtmosCapability
dsError_t dsGetSinkDeviceAtmosCapability(intptr_t handle, dsATMOSCapability_t *capability)
Get the sink device ATMOS capability.
Definition: dsAudio.c:1640
_dsSurroundVirtualizer_t
Definition: dsTypes.h:360
dsSetSecondaryLanguage
dsError_t dsSetSecondaryLanguage(intptr_t handle, const char *sLang)
To set AC4 Secondary language.
Definition: dsAudio.c:1399
dsERR_NONE
@ dsERR_NONE
Definition: dsError.h:85
dsGetAudioLevel
dsError_t dsGetAudioLevel(intptr_t handle, float *level)
Get the current audio volume level of an audio port.
Definition: dsAudio.c:229
dsGetIntelligentEqualizerMode
dsError_t dsGetIntelligentEqualizerMode(intptr_t handle, int *mode)
Get the Intelligent Equalizer Mode.
Definition: dsAudio.c:861
dsIsAudioPortEnabled
dsError_t dsIsAudioPortEnabled(intptr_t handle, bool *enabled)
This function indicates whether the specified Audio port is enabled or not.
Definition: dsAudio.c:303
dsResetSurroundVirtualizer
dsError_t dsResetSurroundVirtualizer(intptr_t handle)
to reset the audio Surround Virtualizer level
Definition: dsAudio.c:1800
_dsMISteeringParam_t
Definition: dsRpc.h:453
_dsAudioSetDuckingParam_t
Definition: dsRpc.h:351
dsGetSurroundVirtualizer
dsError_t dsGetSurroundVirtualizer(intptr_t handle, dsSurroundVirtualizer_t *virtualizer)
To get the audio Surround Virtualizer level.
Definition: dsAudio.c:1051
dsAudioPortTerm
dsError_t dsAudioPortTerm(void)
Terminate the Audio Port sub-system.
Definition: dsAudio.c:591
dsSetDRCMode
dsError_t dsSetDRCMode(intptr_t handle, int mode)
To set the DRC Mode.
Definition: dsAudio.c:1033
_dsAudioGetEncodingModeParam_t
Definition: dsRpc.h:368
libIBus.h
RDK IARM-Bus API Declarations.
dsIsAudioMute
dsError_t dsIsAudioMute(intptr_t handle, bool *muted)
Get the audio mute status of an audio port.
Definition: dsAudio.c:284
_dsFaderControlParam_t
Definition: dsRpc.h:468
_dsAudioSetAtmosOutputModeParam_t
Definition: dsRpc.h:388
dsSetAudioDB
dsError_t dsSetAudioDB(intptr_t handle, float db)
This function sets the dB level to be used on the specified audio port.
Definition: dsAudio.c:499
dsGetAudioDB
dsError_t dsGetAudioDB(intptr_t handle, float *db)
Get the current audio dB level of an audio port.
Definition: dsAudio.c:222
dsGetAudioOptimalLevel
dsError_t dsGetAudioOptimalLevel(intptr_t handle, float *optimalLevel)
Get the optimal audio level of an audio port.
Definition: dsAudio.c:269
dsAudioStereoMode_t
enum StereoMode dsAudioStereoMode_t
dsSetAudioDelayOffset
dsError_t dsSetAudioDelayOffset(intptr_t handle, const uint32_t audioDelayOffsetMs)
Set the audio delay offset in milliseconds.
Definition: dsAudio.c:697
dsResetVolumeLeveller
dsError_t dsResetVolumeLeveller(intptr_t handle)
to reset the Dolby volume leveller
Definition: dsAudio.c:1815
dsGetMS12AudioProfile
dsError_t dsGetMS12AudioProfile(intptr_t handle, char *profile)
To get current audio profile selection.
Definition: dsAudio.c:1201
_dsMS12AudioProfileParam_t
Definition: dsRpc.h:485
dsSetAudioMute
dsError_t dsSetAudioMute(intptr_t handle, bool mute)
Mute or un-mute an audio port.
Definition: dsAudio.c:565
_dsGetHDRCapabilitiesParam_t
Definition: dsRpc.h:774
_dsAudioGainParam_t
Definition: dsRpc.h:358
dsSetSurroundVirtualizer
dsError_t dsSetSurroundVirtualizer(intptr_t handle, dsSurroundVirtualizer_t virtualizer)
To set the audio Surround Virtualizer level.
Definition: dsAudio.c:1076
dsSetBassEnhancer
dsError_t dsSetBassEnhancer(intptr_t handle, int boost)
To set the audio Bass.
Definition: dsAudio.c:951
_dsSurroundVirtualizerParam_t
Definition: dsRpc.h:448
dsGetDolbyVolumeMode
dsError_t dsGetDolbyVolumeMode(intptr_t handle, bool *mode)
Get the dolby audio mode status.
Definition: dsAudio.c:838
dsGetMS12AudioProfileList
dsError_t dsGetMS12AudioProfileList(intptr_t handle, dsMS12AudioProfileList_t *profiles)
To get the supported MS12 audio profiles.
Definition: dsAudio.c:1178
dsAudio.h
dsGetMS12Capabilities
dsError_t dsGetMS12Capabilities(intptr_t handle, int *capabilities)
To find the HDR capabilities of SoC.
Definition: dsAudio.c:1729
dsGetVolumeLeveller
dsError_t dsGetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t *volLeveller)
To get the Dolby volume leveller.
Definition: dsAudio.c:884
_dsAudioSetSADParam_t
Definition: dsRpc.h:313
dsGetAudioCompression
dsError_t dsGetAudioCompression(intptr_t handle, int *compression)
Get the audio compressionof an audio port.
Definition: dsAudio.c:792
dsSetAudioCompression
dsError_t dsSetAudioCompression(intptr_t handle, int compression)
Set the audio compression of an audio port.
Definition: dsAudio.c:737
dsGetFaderControl
dsError_t dsGetFaderControl(intptr_t handle, int *mixerbalance)
To get the mixerbalance betweeen main and associated audio.
Definition: dsAudio.c:1314
dsGetSupportedARCTypes
dsError_t dsGetSupportedARCTypes(intptr_t handle, int *types)
Get the supported ARC types of the connected ARC/eARC device.
Definition: dsAudio.c:1504
dsAudioPortInit
dsError_t dsAudioPortInit()
Initialize the underlying Audio Port sub-system.
Definition: dsAudio.c:47
dsGetLEConfig
dsError_t dsGetLEConfig(intptr_t handle, bool *enable)
To Get LE configuration.
Definition: dsAudio.c:1685
dsSetIntelligentEqualizerMode
dsError_t dsSetIntelligentEqualizerMode(intptr_t handle, int mode)
Set the Intelligent Equalizer Mode.
Definition: dsAudio.c:773
dsSetPrimaryLanguage
dsError_t dsSetPrimaryLanguage(intptr_t handle, const char *pLang)
To set AC4 Primary language.
Definition: dsAudio.c:1342
_dsLEConfigParam_t
Definition: dsRpc.h:809
dsGetAudioGain
dsError_t dsGetAudioGain(intptr_t handle, float *gain)
Get the audio gain of an audio port.
Definition: dsAudio.c:197
dsERR_OPERATION_NOT_SUPPORTED
@ dsERR_OPERATION_NOT_SUPPORTED
Definition: dsError.h:89
dsSetFaderControl
dsError_t dsSetFaderControl(intptr_t handle, int mixerbalance)
To set the mixerbalance betweeen main and associated audio.
Definition: dsAudio.c:1294
dsGetDRCMode
dsError_t dsGetDRCMode(intptr_t handle, int *mode)
To get the DRC Mode.
Definition: dsAudio.c:1010
_dsSecondaryLanguageParam_t
Definition: dsRpc.h:478
dsGetAudioDelay
dsError_t dsGetAudioDelay(intptr_t handle, uint32_t *audioDelayMs)
Get the audio delay in milliseconds.
Definition: dsAudio.c:1572
dsGetAudioFormat
dsError_t dsGetAudioFormat(intptr_t handle, dsAudioFormat_t *audioFormat)
Get the current audio format.
Definition: dsAudio.c:121
dsGetAudioMaxDB
dsError_t dsGetAudioMaxDB(intptr_t handle, float *maxDb)
Get the maximum audio dB level of an audio port.
Definition: dsAudio.c:255
dsIsAudioLoopThru
dsError_t dsIsAudioLoopThru(intptr_t handle, bool *loopThru)
Get the loop-through mode of an audio port.
Definition: dsAudio.c:276
dsGetBassEnhancer
dsError_t dsGetBassEnhancer(intptr_t handle, int *boost)
To get the audio Bass.
Definition: dsAudio.c:928
dsGetAudioPort
dsError_t dsGetAudioPort(dsAudioPortType_t type, int index, intptr_t *handle)
Get the audio port handle.
Definition: dsAudio.c:66
_dsAudioOutIsConnectedParam_t
Definition: dsRpc.h:932
_dsAudioFormatParam_t
Definition: dsRpc.h:363
_dsGetMS12CapabilitiesParam_t
Definition: dsRpc.h:795
dsEnableLoopThru
dsError_t dsEnableLoopThru(intptr_t handle, bool loopThru)
Set loop-through mode of an audio port.
Definition: dsAudio.c:558
_dsPrimaryLanguageParam_t
Definition: dsRpc.h:473
dsGetStereoAuto
dsError_t dsGetStereoAuto(intptr_t handle, int *autoMode)
This function is used to get the current auto mode setting of the specified audio port.
Definition: dsAudio.c:173
dsAudioFormat_t
enum _dsAudioFormat_t dsAudioFormat_t
dsAudioEnableARC
dsError_t dsAudioEnableARC(intptr_t handle, dsAudioARCStatus_t arcStatus)
enable/disable ARC/EARC and route audio to connected device
Definition: dsAudio.c:1552
_dsGetHDMIARCPortIdParam_t
Definition: dsRpc.h:973
dsSetAudioDelay
dsError_t dsSetAudioDelay(intptr_t handle, const uint32_t audioDelayMs)
Set the audio delay in milliseconds.
Definition: dsAudio.c:676
dsAudioType_isValid
#define dsAudioType_isValid(t)
Definition: dsTypes.h:178
dsAudioDuckingAction_t
enum _dsAudioDuckingAction_t dsAudioDuckingAction_t
dsERR_INVALID_PARAM
@ dsERR_INVALID_PARAM
Definition: dsError.h:87
MAX_PROFILE_LIST_BUFFER_LEN
#define MAX_PROFILE_LIST_BUFFER_LEN
Structure that captures MS12 Audio Profile list.
Definition: dsTypes.h:333
dsSetDolbyVolumeMode
dsError_t dsSetDolbyVolumeMode(intptr_t handle, bool mode)
Get the dolby audio mode status.
Definition: dsAudio.c:755
_dsAudioSetMutedParam_t
Definition: dsRpc.h:336
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
dsGetDialogEnhancement
dsError_t dsGetDialogEnhancement(intptr_t handle, int *level)
Get the Dialog Enhancement level of an audio port.
Definition: dsAudio.c:815
_dsMS12AudioProfileList_t
Definition: dsTypes.h:334
dsSetAudioLevel
dsError_t dsSetAudioLevel(intptr_t handle, float level)
This function sets the audio volume level to be used on the specified audio port.
Definition: dsAudio.c:507
dsSetAudioDucking
dsError_t dsSetAudioDucking(intptr_t handle, dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level)
This function sets the audio ducking level to be used on the specified audio port based on the audio ...
Definition: dsAudio.c:531
dsGetMISteering
dsError_t dsGetMISteering(intptr_t handle, bool *enabled)
To get the audio Media intelligent Steering.
Definition: dsAudio.c:1095
dsGetPrimaryLanguage
dsError_t dsGetPrimaryLanguage(intptr_t handle, char *pLang)
To get AC4 Primary language.
Definition: dsAudio.c:1371
_dsMS12AudioProfileListParam_t
Definition: dsRpc.h:498
dsResetDialogEnhancement
dsError_t dsResetDialogEnhancement(intptr_t handle)
to reset the Dialog Enhancement
Definition: dsAudio.c:1769
dsSetAssociatedAudioMixing
dsError_t dsSetAssociatedAudioMixing(intptr_t handle, bool mixing)
Enable/Disable Associated Audio Mixing.
Definition: dsAudio.c:1248
dsSetStereoAuto
dsError_t dsSetStereoAuto(intptr_t handle, int autoMode)
This function sets the auto mode to be used on the specified audio port.
dsSetAudioEncoding
dsError_t dsSetAudioEncoding(intptr_t handle, dsAudioEncoding_t encoding)
Set the encoding type of an audio port.
Definition: dsAudio.c:413
_dsAudioDelayOffsetParam_t
Definition: dsRpc.h:403
_dsAudioGetMS11Param_t
Definition: dsRpc.h:373
_dsGetAudioAtmosCapabilityParam_t
Definition: dsRpc.h:393
_dsMS12ConfigParam_t
Definition: dsRpc.h:802
dsAudioEncoding_t
enum _dsAudioEncoding_t dsAudioEncoding_t