hal-manager: Add pcm APIs that are the wrappers of HAL pcm functions 70/49570/8
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 15 Oct 2015 02:49:14 +0000 (11:49 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 20 Oct 2015 10:47:03 +0000 (19:47 +0900)
[Version] 5.0.4
[Profile] Common
[Issue Type] Enhance feature

Change-Id: I62f71f005f5b104349f9606de2364aed0245dce4

packaging/pulseaudio-modules-tizen.spec
src/hal-manager.c
src/hal-manager.h
src/stream-manager.c
src/tizen-audio.h

index bb549a99f2abc352719a5014579a639d29db5465..c8e2a4ccef9a45ebb82db644b65c9187333912ad 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Improved Linux sound server
-Version:          5.0.3
+Version:          5.0.4
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index da159f79d1ccac4773e005436987553fb4108f65..f23e8aa042f4abdd23402c3800513eb7603539cc 100644 (file)
@@ -62,6 +62,10 @@ pa_hal_manager* pa_hal_manager_get(pa_core *core, void *user_data) {
         h->intf.get_volume_value = dlsym(h->dl_handle, "audio_get_volume_value");
         h->intf.get_volume_mute = dlsym(h->dl_handle, "audio_get_volume_mute");
         h->intf.set_volume_mute = dlsym(h->dl_handle, "audio_set_volume_mute");
+        h->intf.do_route = dlsym(h->dl_handle, "audio_do_route");
+        h->intf.update_route_option = dlsym(h->dl_handle, "audio_update_route_option");
+        h->intf.update_stream_connection_info  = dlsym(h->dl_handle, "audio_update_stream_connection_info");
+        h->intf.get_buffer_attr = dlsym(h->dl_handle, "audio_get_buffer_attr");
         h->intf.alsa_pcm_open = dlsym(h->dl_handle, "audio_alsa_pcm_open");
         h->intf.alsa_pcm_close = dlsym(h->dl_handle, "audio_alsa_pcm_close");
         h->intf.pcm_open = dlsym(h->dl_handle, "audio_pcm_open");
@@ -71,10 +75,6 @@ pa_hal_manager* pa_hal_manager_get(pa_core *core, void *user_data) {
         h->intf.pcm_avail = dlsym(h->dl_handle, "audio_pcm_avail");
         h->intf.pcm_write = dlsym(h->dl_handle, "audio_pcm_write");
         h->intf.pcm_read = dlsym(h->dl_handle, "audio_pcm_read");
-        h->intf.do_route = dlsym(h->dl_handle, "audio_do_route");
-        h->intf.update_route_option = dlsym(h->dl_handle, "audio_update_route_option");
-        h->intf.update_stream_connection_info  = dlsym(h->dl_handle, "audio_update_stream_connection_info");
-        h->intf.get_buffer_attr = dlsym(h->dl_handle, "audio_get_buffer_attr");
         if (h->intf.init) {
             /* TODO : no need to pass platform_data as second param. need to fix hal. */
             if (h->intf.init(&h->data, user_data) != AUDIO_RET_OK) {
@@ -127,27 +127,7 @@ void pa_hal_manager_unref(pa_hal_manager *h) {
     pa_xfree(h);
 }
 
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, io_direction_t direction, const char *latency, void *new_data, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize) {
-    int32_t ret = 0;
-    audio_return_t hal_ret = AUDIO_RET_OK;
-    pa_sample_spec *sample_spec = NULL;
-
-    pa_assert(h);
-    pa_assert(new_data);
-
-    sample_spec = (direction==DIRECTION_OUT)?(&((pa_sink_input_new_data*)new_data)->sample_spec):(&((pa_source_output_new_data*)new_data)->sample_spec);
-    pa_log_info("latency:%s, rate:%u, format:%d, channels:%u", latency, sample_spec->rate, sample_spec->format, sample_spec->channels);
-
-    if (AUDIO_IS_ERROR(hal_ret = h->intf.get_buffer_attr(h->data, direction, latency, sample_spec->rate, sample_spec->format, sample_spec->channels, maxlength, tlength, prebuf, minreq, fragsize))) {
-        pa_log_error("get_buffer_attr returns error:0x%x", hal_ret);
-        ret = -1;
-    } else
-        pa_log_info("maxlength:%d, tlength:%d, prebuf:%d, minreq:%d, fragsize:%d", *maxlength, *tlength, *prebuf, *minreq, *fragsize);
-
-    return ret;
-}
-
-int32_t pa_hal_manager_get_volume_level_max (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -166,7 +146,7 @@ int32_t pa_hal_manager_get_volume_level_max (pa_hal_manager *h, const char *volu
     return ret;
 }
 
-int32_t pa_hal_manager_get_volume_level (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -185,7 +165,7 @@ int32_t pa_hal_manager_get_volume_level (pa_hal_manager *h, const char *volume_t
     return ret;
 }
 
-int32_t pa_hal_manager_set_volume_level (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level) {
+int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -204,7 +184,7 @@ int32_t pa_hal_manager_set_volume_level (pa_hal_manager *h, const char *volume_t
     return ret;
 }
 
-int32_t pa_hal_manager_get_volume_value (pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
+int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -225,7 +205,7 @@ int32_t pa_hal_manager_get_volume_value (pa_hal_manager *h, const char *volume_t
     return ret;
 }
 
-int32_t pa_hal_manager_get_mute (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
+int32_t pa_hal_manager_get_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -244,7 +224,7 @@ int32_t pa_hal_manager_get_mute (pa_hal_manager *h, const char *volume_type, io_
     return ret;
 }
 
-int32_t pa_hal_manager_set_mute (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
+int32_t pa_hal_manager_set_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -262,7 +242,7 @@ int32_t pa_hal_manager_set_mute (pa_hal_manager *h, const char *volume_type, io_
     return ret;
 }
 
-int32_t pa_hal_manager_do_route (pa_hal_manager *h, hal_route_info *info) {
+int32_t pa_hal_manager_do_route(pa_hal_manager *h, hal_route_info *info) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -276,7 +256,7 @@ int32_t pa_hal_manager_do_route (pa_hal_manager *h, hal_route_info *info) {
     return ret;
 }
 
-int32_t pa_hal_manager_update_route_option (pa_hal_manager *h, hal_route_option *option) {
+int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -290,7 +270,7 @@ int32_t pa_hal_manager_update_route_option (pa_hal_manager *h, hal_route_option
     return ret;
 }
 
-int32_t pa_hal_manager_update_stream_connection_info (pa_hal_manager *h, hal_stream_connection_info *info) {
+int32_t pa_hal_manager_update_stream_connection_info(pa_hal_manager *h, hal_stream_connection_info *info) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_stream_info_t hal_info;
@@ -308,3 +288,126 @@ int32_t pa_hal_manager_update_stream_connection_info (pa_hal_manager *h, hal_str
     }
     return ret;
 }
+
+int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info,
+                                            uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(info);
+
+    pa_log_info("latency:%s, rate:%u, format:%d, channels:%u",
+        info->latency, info->sample_spec->rate, info->sample_spec->format, info->sample_spec->channels);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.get_buffer_attr(h->data, info->direction, info->latency, info->sample_spec->rate, info->sample_spec->format,
+                                                         info->sample_spec->channels, maxlength, tlength, prebuf, minreq, fragsize))) {
+        pa_log_error("get_buffer_attr returns error:0x%x", hal_ret);
+        ret = -1;
+    } else
+        pa_log_info("maxlength:%d, tlength:%d, prebuf:%d, minreq:%d, fragsize:%d", *maxlength, *tlength, *prebuf, *minreq, *fragsize);
+
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+    pa_assert(sample_spec);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_open(h->data, pcm_h, sample_spec, direction))) {
+        pa_log_error("pcm_open returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_start(h->data, pcm_h))) {
+        pa_log_error("pcm_start returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_stop(h->data, pcm_h))) {
+        pa_log_error("pcm_stop returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_close(h->data, pcm_h))) {
+        pa_log_error("pcm_close returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+    pa_assert(available);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_avail(h->data, pcm_h, available))) {
+        pa_log_error("pcm_avail returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+    pa_assert(buffer);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_write(h->data, pcm_h, buffer, frames))) {
+        pa_log_error("pcm_write returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
+
+int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames) {
+    int32_t ret = 0;
+    audio_return_t hal_ret = AUDIO_RET_OK;
+
+    pa_assert(h);
+    pa_assert(pcm_h);
+    pa_assert(buffer);
+
+    if (AUDIO_IS_ERROR(hal_ret = h->intf.pcm_read(h->data, pcm_h, buffer, frames))) {
+        pa_log_error("pcm_read returns error:0x%x", hal_ret);
+        ret = -1;
+    }
+    return ret;
+}
index 38d8427ba1947fd20f955a7af598309564a99271..40822a154aff99c932a8493522037094dd16c7a4 100644 (file)
@@ -35,18 +35,33 @@ typedef struct _hal_stream_connection_info {
     pa_bool_t is_connected;
 } hal_stream_connection_info;
 
+typedef struct _hal_stream_info {
+    io_direction_t direction;
+    const char *latency;
+    pa_sample_spec *sample_spec;
+} hal_stream_info;
+
+typedef void* pcm_handle;
+
 pa_hal_manager* pa_hal_manager_get(pa_core *core, void *user_data);
 pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h);
 void pa_hal_manager_unref(pa_hal_manager *h);
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, io_direction_t direction, const char *latency, void *new_data, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-int32_t pa_hal_manager_get_volume_level_max (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_get_volume_level (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_set_volume_level (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level);
-int32_t pa_hal_manager_get_volume_value (pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
-int32_t pa_hal_manager_get_mute (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
-int32_t pa_hal_manager_set_mute (pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute);
-int32_t pa_hal_manager_do_route (pa_hal_manager *h, hal_route_info *info);
-int32_t pa_hal_manager_update_route_option (pa_hal_manager *h, hal_route_option *option);
-int32_t pa_hal_manager_update_stream_connection_info (pa_hal_manager *h, hal_stream_connection_info *info);
+int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level);
+int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
+int32_t pa_hal_manager_get_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
+int32_t pa_hal_manager_set_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute);
+int32_t pa_hal_manager_do_route(pa_hal_manager *h, hal_route_info *info);
+int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option);
+int32_t pa_hal_manager_update_stream_connection_info(pa_hal_manager *h, hal_stream_connection_info *info);
+int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
+int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec);
+int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h);
+int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h);
+int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h);
+int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available);
+int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
+int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
 
 #endif
index bbfd86ec79bcc02b98666edec21b349364ed92c6..2faf9b659f55e7fc30b9a4038d2bb13dc4665caf 100644 (file)
@@ -2297,7 +2297,7 @@ static void update_buffer_attribute(stream_type_t stream_type, void *new_data, p
     int32_t prebuf = -1;
     int32_t minreq = -1;
     int32_t fragsize = -1;
-    const char* audio_latency = NULL;
+    hal_stream_info info;
 
     pa_assert(m);
     pa_assert(new_data);
@@ -2305,12 +2305,18 @@ static void update_buffer_attribute(stream_type_t stream_type, void *new_data, p
     if (m->hal == NULL)
         return;
 
-    audio_latency = pa_proplist_gets(GET_STREAM_NEW_PROPLIST(new_data, stream_type), PA_PROP_MEDIA_TIZEN_AUDIO_LATENCY);
-    pa_log_info("audio_latency : %s", audio_latency);
-    if (audio_latency == NULL)
+    if ((info.latency = pa_proplist_gets(GET_STREAM_NEW_PROPLIST(new_data, stream_type), PA_PROP_MEDIA_TIZEN_AUDIO_LATENCY)))
+        pa_log_info("audio_latency : %s", info.latency);
+    else {
+        pa_log_warn("failed to get audio_latency");
         return;
+    }
+    info.direction = (io_direction_t)!stream_type;
+    info.sample_spec = (stream_type==STREAM_SINK_INPUT)? &(((pa_sink_input_new_data*)new_data)->sample_spec):
+                                                         &(((pa_source_output_new_data*)new_data)->sample_spec);
 
-    if (!pa_hal_manager_get_buffer_attribute(m->hal, (io_direction_t)!stream_type, audio_latency, new_data, (uint32_t*)&maxlength, (uint32_t*)&tlength, (uint32_t*)&prebuf, (uint32_t*)&minreq, (uint32_t*)&fragsize)) {
+    if (!pa_hal_manager_get_buffer_attribute(m->hal, &info, (uint32_t*)&maxlength, (uint32_t*)&tlength,
+                                             (uint32_t*)&prebuf, (uint32_t*)&minreq, (uint32_t*)&fragsize)) {
         pa_log_info(" - maxlength:%d, tlength:%d, prebuf:%d, minreq:%d, fragsize:%d", maxlength, tlength, prebuf, minreq, fragsize);
         pa_proplist_setf(GET_STREAM_NEW_PROPLIST(new_data, stream_type), "maxlength", "%d", maxlength);
         pa_proplist_setf(GET_STREAM_NEW_PROPLIST(new_data, stream_type), "tlength",   "%d", tlength);
index c03e96f41fab1b3ada4497327a2e5bf6d7560341..47ef0d8545e4bbbf8786f20c5251fd8b554532fb 100644 (file)
@@ -81,10 +81,10 @@ typedef struct audio_interface {
     audio_return_t (*do_route)(void *userdata, audio_route_info_t *info);
     audio_return_t (*update_route_option)(void *userdata, audio_route_option_t *option);
     audio_return_t (*update_stream_connection_info) (void *userdata, audio_stream_info_t *info, uint32_t is_connected);
+    audio_return_t (*get_buffer_attr)(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
+    /* Interface of PCM device */
     audio_return_t (*alsa_pcm_open)(void *userdata, void **pcm_handle, char *device_name, uint32_t direction, int mode);
     audio_return_t (*alsa_pcm_close)(void *userdata, void *pcm_handle);
-
-    /* Interface of PCM device */
     audio_return_t (*pcm_open)(void *userdata, void **pcm_handle, void *sample_spec, uint32_t direction);
     audio_return_t (*pcm_start)(void *userdata, void *pcm_handle);
     audio_return_t (*pcm_stop)(void *userdata, void *pcm_handle);
@@ -92,9 +92,6 @@ typedef struct audio_interface {
     audio_return_t (*pcm_avail)(void *userdata, void *pcm_handle, uint32_t *avail);
     audio_return_t (*pcm_write)(void *userdata, void *pcm_handle, const void *buffer, uint32_t frames);
     audio_return_t (*pcm_read)(void *userdata, void *pcm_handle, void *buffer, uint32_t frames);
-
-    audio_return_t (*get_buffer_attr)(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-    audio_return_t (*set_route)(void *userdata, uint32_t session, uint32_t subsession, uint32_t device_in, uint32_t device_out, uint32_t route_flag);
 } audio_interface_t;
 
 audio_return_t audio_init (void **userdata, void *platform_data);
@@ -108,6 +105,7 @@ audio_return_t audio_set_volume_mute (void *userdata, audio_volume_info_t *info,
 audio_return_t audio_do_route (void *userdata, audio_route_info_t *info);
 audio_return_t audio_update_route_option (void *userdata, audio_route_option_t *option);
 audio_return_t audio_update_stream_connection_info (void *userdata, audio_stream_info_t *info, uint32_t is_connected);
+audio_return_t audio_get_buffer_attr (void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
 audio_return_t audio_alsa_pcm_open (void *userdata, void **pcm_handle, char *device_name, uint32_t direction, int mode);
 audio_return_t audio_alsa_pcm_close (void *userdata, void *pcm_handle);
 audio_return_t audio_pcm_open (void *userdata, void **pcm_handle, void *sample_spec, uint32_t direction);
@@ -117,6 +115,4 @@ audio_return_t audio_pcm_close (void *userdata, void *pcm_handle);
 audio_return_t audio_pcm_avail (void *userdata, void *pcm_handle, uint32_t *avail);
 audio_return_t audio_pcm_write (void *userdata, void *pcm_handle, const void *buffer, uint32_t frames);
 audio_return_t audio_pcm_read (void *userdata, void *pcm_handle, void *buffer, uint32_t frames);
-audio_return_t audio_get_buffer_attr (void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-audio_return_t audio_set_route (void *userdata, uint32_t session, uint32_t subsession, uint32_t device_in, uint32_t device_out, uint32_t route_flag);
 #endif