fix ql audio

Change-Id: I9cf7fb13ce9d8762603d401df4384a72796865d7
diff --git a/mbtk/libql_lib/src/ql_audio.c b/mbtk/libql_lib/src/ql_audio.c
index 41e6325..c5449d3 100755
--- a/mbtk/libql_lib/src/ql_audio.c
+++ b/mbtk/libql_lib/src/ql_audio.c
@@ -1,5 +1,7 @@
+
 #include "ql/ql_audio.h"
 #include "mbtk_log.h"
+#include "mbtk_audio2.h"
 
 typedef enum {
     AUDIO_PLAY_STATE_STOP,
@@ -34,6 +36,11 @@
     play_exit = 0;
     int data_send = 0;
 
+    if (mbtk_audio_pcm_play_start()) {
+        printf("%s: error opening output device.", __FUNCTION__);
+        return -1;
+    }
+
     if(pData && length > 0) {
         while (play_state != AUDIO_PLAY_STATE_STOP) {
             if(play_state == AUDIO_PLAY_STATE_RUNNING) {
@@ -86,6 +93,13 @@
         if(offset > 0) {
             lseek(fd, offset, SEEK_SET);
         }
+        
+        if (mbtk_audio_pcm_play_start()) {
+            printf("%s: error opening output device.", __FUNCTION__);
+            return -1;
+        }
+
+        
         while (play_state != AUDIO_PLAY_STATE_STOP) {
             if(play_state == AUDIO_PLAY_STATE_RUNNING) {
                 memset(buf, 0x00, sizeof(buf));
@@ -567,7 +581,7 @@
 
 int Ql_Rxgain_Set(int value)
 {
-
+    mbtk_dsp_gain_set(1, value);
     return 0;
 }
 
@@ -586,8 +600,10 @@
     if(samprate == 1)
     {
         sample_rate = 16000;
+        mbtk_audio_pcm_sample_rate_set(MBTK_AUDIO_SAMPLE_RATE_16000);
     }
     else{
+        mbtk_audio_pcm_sample_rate_set(MBTK_AUDIO_SAMPLE_RATE_8000);
         sample_rate = 8000;
     }
 
@@ -780,4 +796,4 @@
 {
 
     return 0;
-}
\ No newline at end of file
+}