blob: f32d21721d1315feaaa0140b5f257550518f8f13 [file] [log] [blame]
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -07001/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
3 * Not a Contribution.
4 *
5 * Copyright (C) 2013 The Android Open Source Project
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#define LOG_TAG "audio_hw_ssr"
21/*#define LOG_NDEBUG 0*/
22#define LOG_NDDEBUG 0
23
24#include <errno.h>
25#include <cutils/properties.h>
26#include <stdlib.h>
27#include <dlfcn.h>
28#include <cutils/str_parms.h>
29#include <cutils/log.h>
30
31#include "audio_hw.h"
32#include "platform.h"
33#include "platform_api.h"
34#include "surround_filters_interface.h"
35
36#ifdef SSR_ENABLED
Mingming Yin49be8032013-12-19 12:51:25 -080037#define COEFF_ARRAY_SIZE 4
38#define FILT_SIZE ((512+1)* 6) /* # ((FFT bins)/2+1)*numOutputs */
39#define SSR_CHANNEL_INPUT_NUM 4
40#define SSR_CHANNEL_OUTPUT_NUM 6
41#define SSR_PERIOD_COUNT 8
42#define SSR_PERIOD_SIZE 512
43#define SSR_INPUT_FRAME_SIZE (SSR_PERIOD_SIZE * SSR_PERIOD_COUNT)
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070044
45#define SURROUND_FILE_1R "/system/etc/surround_sound/filter1r.pcm"
46#define SURROUND_FILE_2R "/system/etc/surround_sound/filter2r.pcm"
47#define SURROUND_FILE_3R "/system/etc/surround_sound/filter3r.pcm"
48#define SURROUND_FILE_4R "/system/etc/surround_sound/filter4r.pcm"
49
50#define SURROUND_FILE_1I "/system/etc/surround_sound/filter1i.pcm"
51#define SURROUND_FILE_2I "/system/etc/surround_sound/filter2i.pcm"
52#define SURROUND_FILE_3I "/system/etc/surround_sound/filter3i.pcm"
53#define SURROUND_FILE_4I "/system/etc/surround_sound/filter4i.pcm"
Mingming Yin49be8032013-12-19 12:51:25 -080054
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070055#define LIB_SURROUND_PROC "libsurround_proc.so"
56
57typedef int (*surround_filters_init_t)(void *, int, int, Word16 **,
58 Word16 **, int, int, int, Profiler *);
59typedef void (*surround_filters_release_t)(void *);
60typedef int (*surround_filters_set_channel_map_t)(void *, const int *);
61typedef void (*surround_filters_intl_process_t)(void *, Word16 *, Word16 *);
62
63struct ssr_module {
64 FILE *fp_4ch;
65 FILE *fp_6ch;
66 int16_t **real_coeffs;
67 int16_t **imag_coeffs;
68 void *surround_obj;
Mingming Yin49be8032013-12-19 12:51:25 -080069 int16_t *surround_raw_buffer;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070070 bool is_ssr_enabled;
71
72 void *surround_filters_handle;
73 surround_filters_init_t surround_filters_init;
74 surround_filters_release_t surround_filters_release;
75 surround_filters_set_channel_map_t surround_filters_set_channel_map;
76 surround_filters_intl_process_t surround_filters_intl_process;
77};
78
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070079static struct ssr_module ssrmod = {
80 .fp_4ch = NULL,
Mingming Yin49be8032013-12-19 12:51:25 -080081 .fp_6ch = NULL,
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070082 .real_coeffs = NULL,
83 .imag_coeffs = NULL,
84 .surround_obj = NULL,
Mingming Yin49be8032013-12-19 12:51:25 -080085 .surround_raw_buffer = NULL,
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070086 .is_ssr_enabled = 0,
87
88 .surround_filters_handle = NULL,
89 .surround_filters_init = NULL,
90 .surround_filters_release = NULL,
91 .surround_filters_set_channel_map = NULL,
92 .surround_filters_intl_process = NULL,
93};
94
95/* Use AAC/DTS channel mapping as default channel mapping: C,FL,FR,Ls,Rs,LFE */
96static const int chan_map[] = { 1, 2, 4, 3, 0, 5};
97
98/* Rotine to read coeffs from File and updates real and imaginary
99 coeff array member variable */
100static int32_t ssr_read_coeffs_from_file()
101{
102 FILE *flt1r;
103 FILE *flt2r;
104 FILE *flt3r;
105 FILE *flt4r;
106 FILE *flt1i;
107 FILE *flt2i;
108 FILE *flt3i;
109 FILE *flt4i;
110 int i;
111
112 if ( (flt1r = fopen(SURROUND_FILE_1R, "rb")) == NULL ) {
113 ALOGE("%s: Cannot open filter co-efficient "
114 "file %s", __func__, SURROUND_FILE_1R);
115 return -EINVAL;
116 }
117
118 if ( (flt2r = fopen(SURROUND_FILE_2R, "rb")) == NULL ) {
119 ALOGE("%s: Cannot open filter "
120 "co-efficient file %s", __func__, SURROUND_FILE_2R);
121 return -EINVAL;
122 }
123
124 if ( (flt3r = fopen(SURROUND_FILE_3R, "rb")) == NULL ) {
125 ALOGE("%s: Cannot open filter "
126 "co-efficient file %s", __func__, SURROUND_FILE_3R);
127 return -EINVAL;
128 }
129
130 if ( (flt4r = fopen(SURROUND_FILE_4R, "rb")) == NULL ) {
131 ALOGE("%s: Cannot open filter "
132 "co-efficient file %s", __func__, SURROUND_FILE_4R);
133 return -EINVAL;
134 }
135
136 if ( (flt1i = fopen(SURROUND_FILE_1I, "rb")) == NULL ) {
137 ALOGE("%s: Cannot open filter "
138 "co-efficient file %s", __func__, SURROUND_FILE_1I);
139 return -EINVAL;
140 }
141
142 if ( (flt2i = fopen(SURROUND_FILE_2I, "rb")) == NULL ) {
143 ALOGE("%s: Cannot open filter "
144 "co-efficient file %s", __func__, SURROUND_FILE_2I);
145 return -EINVAL;
146 }
147
148 if ( (flt3i = fopen(SURROUND_FILE_3I, "rb")) == NULL ) {
149 ALOGE("%s: Cannot open filter "
150 "co-efficient file %s", __func__, SURROUND_FILE_3I);
151 return -EINVAL;
152 }
153
154 if ( (flt4i = fopen(SURROUND_FILE_4I, "rb")) == NULL ) {
155 ALOGE("%s: Cannot open filter "
156 "co-efficient file %s", __func__, SURROUND_FILE_4I);
157 return -EINVAL;
158 }
159 ALOGV("%s: readCoeffsFromFile all filter "
160 "files opened", __func__);
161
162 for (i=0; i<COEFF_ARRAY_SIZE; i++) {
163 ssrmod.real_coeffs[i] = (Word16 *)calloc(FILT_SIZE, sizeof(Word16));
164 }
165 for (i=0; i<COEFF_ARRAY_SIZE; i++) {
166 ssrmod.imag_coeffs[i] = (Word16 *)calloc(FILT_SIZE, sizeof(Word16));
167 }
168
169 /* Read real co-efficients */
170 if (NULL != ssrmod.real_coeffs[0]) {
171 fread(ssrmod.real_coeffs[0], sizeof(int16), FILT_SIZE, flt1r);
172 }
173 if (NULL != ssrmod.real_coeffs[0]) {
174 fread(ssrmod.real_coeffs[1], sizeof(int16), FILT_SIZE, flt2r);
175 }
176 if (NULL != ssrmod.real_coeffs[0]) {
177 fread(ssrmod.real_coeffs[2], sizeof(int16), FILT_SIZE, flt3r);
178 }
179 if (NULL != ssrmod.real_coeffs[0]) {
180 fread(ssrmod.real_coeffs[3], sizeof(int16), FILT_SIZE, flt4r);
181 }
182
183 /* read imaginary co-efficients */
184 if (NULL != ssrmod.imag_coeffs[0]) {
185 fread(ssrmod.imag_coeffs[0], sizeof(int16), FILT_SIZE, flt1i);
186 }
187 if (NULL != ssrmod.imag_coeffs[0]) {
188 fread(ssrmod.imag_coeffs[1], sizeof(int16), FILT_SIZE, flt2i);
189 }
190 if (NULL != ssrmod.imag_coeffs[0]) {
191 fread(ssrmod.imag_coeffs[2], sizeof(int16), FILT_SIZE, flt3i);
192 }
193 if (NULL != ssrmod.imag_coeffs[0]) {
194 fread(ssrmod.imag_coeffs[3], sizeof(int16), FILT_SIZE, flt4i);
195 }
196
197 fclose(flt1r);
198 fclose(flt2r);
199 fclose(flt3r);
200 fclose(flt4r);
201 fclose(flt1i);
202 fclose(flt2i);
203 fclose(flt3i);
204 fclose(flt4i);
205
206 return 0;
207}
208
209static int32_t ssr_init_surround_sound_lib(unsigned long buffersize)
210{
211 /* sub_woofer channel assignment: default as first
212 microphone input channel */
213 int sub_woofer = 0;
214 /* frequency upper bound for sub_woofer:
215 frequency=(low_freq-1)/FFT_SIZE*samplingRate, default as 4 */
216 int low_freq = 4;
217 /* frequency upper bound for spatial processing:
218 frequency=(high_freq-1)/FFT_SIZE*samplingRate, default as 100 */
219 int high_freq = 100;
220 int i, ret = 0;
221
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700222 if ( ssrmod.surround_obj ) {
223 ALOGE("%s: ola filter library is already initialized", __func__);
224 return 0;
225 }
226
227 /* Allocate memory for input buffer */
Mingming Yin49be8032013-12-19 12:51:25 -0800228 ssrmod.surround_raw_buffer = (Word16 *) calloc(buffersize,
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700229 sizeof(Word16));
Mingming Yin49be8032013-12-19 12:51:25 -0800230 if ( !ssrmod.surround_raw_buffer ) {
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700231 ALOGE("%s: Memory allocation failure. Not able to allocate "
232 "memory for surroundInputBuffer", __func__);
233 goto init_fail;
234 }
235
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700236 /* Allocate memory for real and imag coeffs array */
237 ssrmod.real_coeffs = (Word16 **) calloc(COEFF_ARRAY_SIZE, sizeof(Word16 *));
238 if ( !ssrmod.real_coeffs ) {
239 ALOGE("%s: Memory allocation failure during real "
240 "Coefficient array", __func__);
241 goto init_fail;
242 }
243
244 ssrmod.imag_coeffs = (Word16 **) calloc(COEFF_ARRAY_SIZE, sizeof(Word16 *));
245 if ( !ssrmod.imag_coeffs ) {
246 ALOGE("%s: Memory allocation failure during imaginary "
247 "Coefficient array", __func__);
248 goto init_fail;
249 }
250
251 if( ssr_read_coeffs_from_file() != 0) {
252 ALOGE("%s: Error while loading coeffs from file", __func__);
253 goto init_fail;
254 }
255
256 ssrmod.surround_filters_handle = dlopen(LIB_SURROUND_PROC, RTLD_NOW);
257 if (ssrmod.surround_filters_handle == NULL) {
258 ALOGE("%s: DLOPEN failed for %s", __func__, LIB_SURROUND_PROC);
259 } else {
260 ALOGV("%s: DLOPEN successful for %s", __func__, LIB_SURROUND_PROC);
261 ssrmod.surround_filters_init = (surround_filters_init_t)
262 dlsym(ssrmod.surround_filters_handle, "surround_filters_init");
263
264 ssrmod.surround_filters_release = (surround_filters_release_t)
265 dlsym(ssrmod.surround_filters_handle, "surround_filters_release");
266
267 ssrmod.surround_filters_set_channel_map = (surround_filters_set_channel_map_t)
268 dlsym(ssrmod.surround_filters_handle, "surround_filters_set_channel_map");
269
270 ssrmod.surround_filters_intl_process = (surround_filters_intl_process_t)
271 dlsym(ssrmod.surround_filters_handle, "surround_filters_intl_process");
272
273 if (!ssrmod.surround_filters_init ||
274 !ssrmod.surround_filters_release ||
275 !ssrmod.surround_filters_set_channel_map ||
276 !ssrmod.surround_filters_intl_process){
277 ALOGW("%s: Could not find the one of the symbols from %s",
278 __func__, LIB_SURROUND_PROC);
279 goto init_fail;
280 }
281 }
282
283 /* calculate the size of data to allocate for surround_obj */
284 ret = ssrmod.surround_filters_init(NULL,
285 6, // Num output channel
286 4, // Num input channel
287 ssrmod.real_coeffs, // Coeffs hardcoded in header
288 ssrmod.imag_coeffs, // Coeffs hardcoded in header
289 sub_woofer,
290 low_freq,
291 high_freq,
292 NULL);
293
294 if ( ret > 0 ) {
295 ALOGV("%s: Allocating surroundObj size is %d", __func__, ret);
296 ssrmod.surround_obj = (void *)malloc(ret);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700297 if (NULL != ssrmod.surround_obj) {
Haynes Mathew Georgeb51ceb12014-06-30 13:56:18 -0700298 memset(ssrmod.surround_obj,0,ret);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700299 /* initialize after allocating the memory for surround_obj */
300 ret = ssrmod.surround_filters_init(ssrmod.surround_obj,
301 6,
302 4,
303 ssrmod.real_coeffs,
304 ssrmod.imag_coeffs,
305 sub_woofer,
306 low_freq,
307 high_freq,
308 NULL);
309 if (0 != ret) {
310 ALOGE("%s: surround_filters_init failed with ret:%d",__func__, ret);
311 ssrmod.surround_filters_release(ssrmod.surround_obj);
312 goto init_fail;
313 }
314 } else {
315 ALOGE("%s: Allocationg surround_obj failed", __func__);
316 goto init_fail;
317 }
318 } else {
319 ALOGE("%s: surround_filters_init(surround_obj=Null) "
320 "failed with ret: %d", __func__, ret);
321 goto init_fail;
322 }
323
324 (void) ssrmod.surround_filters_set_channel_map(ssrmod.surround_obj, chan_map);
325
326 return 0;
327
328init_fail:
329 if (ssrmod.surround_obj) {
330 free(ssrmod.surround_obj);
331 ssrmod.surround_obj = NULL;
332 }
Mingming Yin49be8032013-12-19 12:51:25 -0800333 if (ssrmod.surround_raw_buffer) {
334 free(ssrmod.surround_raw_buffer);
335 ssrmod.surround_raw_buffer = NULL;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700336 }
337 if (ssrmod.real_coeffs){
338 for (i =0; i<COEFF_ARRAY_SIZE; i++ ) {
339 if (ssrmod.real_coeffs[i]) {
340 free(ssrmod.real_coeffs[i]);
341 ssrmod.real_coeffs[i] = NULL;
342 }
343 }
344 free(ssrmod.real_coeffs);
345 ssrmod.real_coeffs = NULL;
346 }
347 if (ssrmod.imag_coeffs){
348 for (i =0; i<COEFF_ARRAY_SIZE; i++ ) {
349 if (ssrmod.imag_coeffs[i]) {
350 free(ssrmod.imag_coeffs[i]);
351 ssrmod.imag_coeffs[i] = NULL;
352 }
353 }
354 free(ssrmod.imag_coeffs);
355 ssrmod.imag_coeffs = NULL;
356 }
357
358 return -ENOMEM;
359}
360
Mingming Yin49be8032013-12-19 12:51:25 -0800361void audio_extn_ssr_update_enabled()
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700362{
363 char ssr_enabled[PROPERTY_VALUE_MAX] = "false";
364
365 property_get("ro.qc.sdk.audio.ssr",ssr_enabled,"0");
366 if (!strncmp("true", ssr_enabled, 4)) {
367 ALOGD("%s: surround sound recording is supported", __func__);
368 ssrmod.is_ssr_enabled = true;
369 } else {
370 ALOGD("%s: surround sound recording is not supported", __func__);
371 ssrmod.is_ssr_enabled = false;
372 }
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700373}
374
375bool audio_extn_ssr_get_enabled()
376{
377 ALOGV("%s: is_ssr_enabled:%d", __func__, ssrmod.is_ssr_enabled);
378 return (ssrmod.is_ssr_enabled ? true: false);
379}
380
381int32_t audio_extn_ssr_init(struct audio_device *adev,
382 struct stream_in *in)
383{
384 uint32_t ret;
385 char c_multi_ch_dump[128] = {0};
386 uint32_t buffer_size;
387
388 ALOGD("%s: ssr case ", __func__);
Mingming Yin49be8032013-12-19 12:51:25 -0800389 in->config.channels = SSR_CHANNEL_INPUT_NUM;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700390 in->config.period_size = SSR_PERIOD_SIZE;
391 in->config.period_count = SSR_PERIOD_COUNT;
392
Mingming Yin49be8032013-12-19 12:51:25 -0800393 /* use 4k hardcoded buffer size for ssr*/
394 buffer_size = SSR_INPUT_FRAME_SIZE;
395 ALOGV("%s: buffer_size: %d", __func__, buffer_size);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700396
397 ret = ssr_init_surround_sound_lib(buffer_size);
398 if (0 != ret) {
399 ALOGE("%s: initSurroundSoundLibrary failed: %d "
400 "handle->bufferSize:%d", __func__, ret, buffer_size);
401 return ret;
402 }
403
404 property_get("ssr.pcmdump",c_multi_ch_dump,"0");
Mingming Yin49be8032013-12-19 12:51:25 -0800405 if (0 == strncmp("true", c_multi_ch_dump, sizeof("ssr.dump-pcm"))) {
406 /* Remember to change file system permission of data(e.g. chmod 777 data/),
407 otherwise, fopen may fail */
408 if ( !ssrmod.fp_4ch)
409 ssrmod.fp_4ch = fopen("/data/4ch.pcm", "wb");
410 if ( !ssrmod.fp_6ch)
411 ssrmod.fp_6ch = fopen("/data/6ch.pcm", "wb");
412 if ((!ssrmod.fp_4ch) || (!ssrmod.fp_6ch))
413 ALOGE("%s: mfp_4ch or mfp_6ch open failed: mfp_4ch:%p mfp_6ch:%p",
414 __func__, ssrmod.fp_4ch, ssrmod.fp_6ch);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700415 }
416
417 return 0;
418}
419
420int32_t audio_extn_ssr_deinit()
421{
422 int i;
423
424 if (ssrmod.surround_obj) {
Mingming Yin49be8032013-12-19 12:51:25 -0800425 ALOGV("%s: entry", __func__);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700426 ssrmod.surround_filters_release(ssrmod.surround_obj);
427 if (ssrmod.surround_obj)
428 free(ssrmod.surround_obj);
429 ssrmod.surround_obj = NULL;
430 if (ssrmod.real_coeffs){
431 for (i =0; i<COEFF_ARRAY_SIZE; i++ ) {
432 if (ssrmod.real_coeffs[i]) {
433 free(ssrmod.real_coeffs[i]);
434 ssrmod.real_coeffs[i] = NULL;
435 }
436 }
437 free(ssrmod.real_coeffs);
438 ssrmod.real_coeffs = NULL;
439 }
440 if (ssrmod.imag_coeffs){
441 for (i =0; i<COEFF_ARRAY_SIZE; i++ ) {
442 if (ssrmod.imag_coeffs[i]) {
443 free(ssrmod.imag_coeffs[i]);
444 ssrmod.imag_coeffs[i] = NULL;
445 }
446 }
447 free(ssrmod.imag_coeffs);
448 ssrmod.imag_coeffs = NULL;
449 }
Mingming Yin49be8032013-12-19 12:51:25 -0800450 if (ssrmod.surround_raw_buffer) {
451 free(ssrmod.surround_raw_buffer);
452 ssrmod.surround_raw_buffer = NULL;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700453 }
Mingming Yin49be8032013-12-19 12:51:25 -0800454 if (ssrmod.fp_4ch)
455 fclose(ssrmod.fp_4ch);
456 if (ssrmod.fp_6ch)
457 fclose(ssrmod.fp_6ch);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700458 }
459
Mingming Yin49be8032013-12-19 12:51:25 -0800460 if(ssrmod.surround_filters_handle) {
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700461 dlclose(ssrmod.surround_filters_handle);
462 ssrmod.surround_filters_handle = NULL;
463 }
Mingming Yin49be8032013-12-19 12:51:25 -0800464 ALOGV("%s: exit", __func__);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700465
466 return 0;
467}
468
469int32_t audio_extn_ssr_read(struct audio_stream_in *stream,
470 void *buffer, size_t bytes)
471{
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700472 struct stream_in *in = (struct stream_in *)stream;
473 struct audio_device *adev = in->dev;
Mingming Yin49be8032013-12-19 12:51:25 -0800474 size_t peroid_bytes;
475 int32_t ret;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700476
Mingming Yin49be8032013-12-19 12:51:25 -0800477 /* Convert bytes for 6ch to 4ch*/
478 peroid_bytes = (bytes / SSR_CHANNEL_OUTPUT_NUM) * SSR_CHANNEL_INPUT_NUM;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700479
Mingming Yin49be8032013-12-19 12:51:25 -0800480 if (!ssrmod.surround_obj) {
481 ALOGE("%s: surround_obj not initialized", __func__);
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700482 return -ENOMEM;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700483 }
Mingming Yin49be8032013-12-19 12:51:25 -0800484
485 ret = pcm_read(in->pcm, ssrmod.surround_raw_buffer, peroid_bytes);
486 if (ret < 0) {
487 ALOGE("%s: %s ret:%d", __func__, pcm_get_error(in->pcm),ret);
488 return ret;
489 }
490
491 /* apply ssr libs to conver 4ch to 6ch */
492 ssrmod.surround_filters_intl_process(ssrmod.surround_obj,
493 buffer, ssrmod.surround_raw_buffer);
494
495 /*dump for raw pcm data*/
496 if (ssrmod.fp_4ch)
497 fwrite(ssrmod.surround_raw_buffer, 1, peroid_bytes, ssrmod.fp_4ch);
498 if (ssrmod.fp_6ch)
499 fwrite(buffer, 1, bytes, ssrmod.fp_6ch);
500
501 return ret;
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700502}
Mingming Yin49be8032013-12-19 12:51:25 -0800503
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -0700504#endif /* SSR_ENABLED */