diff options
-rw-r--r-- | audio_hw.c | 28 | ||||
-rw-r--r-- | audio_in.c | 31 | ||||
-rw-r--r-- | audio_out.c | 31 |
3 files changed, 84 insertions, 6 deletions
@@ -47,6 +47,8 @@ static uint32_t audio_hw_get_supported_devices(const struct audio_hw_device *dev) { + LOGD("%s(%p)", __func__, dev); + int supported_output_devices = AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_WIRED_HEADSET | @@ -71,6 +73,8 @@ static uint32_t audio_hw_get_supported_devices(const struct audio_hw_device *dev static int audio_hw_init_check(const struct audio_hw_device *dev) { + LOGD("%s(%p)", __func__, dev); + if(dev != NULL) return 0; else @@ -79,49 +83,67 @@ static int audio_hw_init_check(const struct audio_hw_device *dev) static int audio_hw_set_voice_volume(struct audio_hw_device *dev, float volume) { + LOGD("%s(%p, %f)", __func__, dev, volume); + return -ENOSYS; } static int audio_hw_set_master_volume(struct audio_hw_device *dev, float volume) { + LOGD("%s(%p, %f)", __func__, dev, volume); + return -ENOSYS; } static int audio_hw_set_mode(struct audio_hw_device *dev, int mode) { + LOGD("%s(%p, %d)", __func__, dev, mode); + return 0; } static int audio_hw_set_mic_mute(struct audio_hw_device *dev, bool state) { + LOGD("%s(%p, %d)", __func__, dev, state); + return -ENOSYS; } static int audio_hw_get_mic_mute(const struct audio_hw_device *dev, bool *state) { + LOGD("%s(%p, %p)", __func__, dev, state); + return -ENOSYS; } static int audio_hw_set_parameters(struct audio_hw_device *dev, const char *kvpairs) { + LOGD("%s(%p, %s)", __func__, dev, kvpairs); + return -ENOSYS; } -static char * audio_hw_get_parameters(const struct audio_hw_device *dev, +static char *audio_hw_get_parameters(const struct audio_hw_device *dev, const char *keys) { + LOGD("%s(%p, %s)", __func__, dev, keys); + return NULL; } static size_t audio_hw_get_input_buffer_size(const struct audio_hw_device *dev, uint32_t sample_rate, int format, int channel_count) { + LOGD("%s(%p, %d, %d, %d)", __func__, dev, sample_rate, format, channel_count); + return 320; } static int audio_hw_dump(const audio_hw_device_t *device, int fd) { + LOGD("%s(%p, %d)", __func__, device, fd); + return 0; } @@ -131,6 +153,8 @@ static int audio_hw_dump(const audio_hw_device_t *device, int fd) int audio_hw_close(hw_device_t *device) { + LOGD("%s(%p)", __func__, device); + if(device != NULL) free(device); @@ -143,6 +167,8 @@ int audio_hw_open(const hw_module_t *module, const char *name, struct tinyalsa_audio_device *tinyalsa_audio_device; struct audio_hw_device *dev; + LOGD("%s(%p, %s, %p)", __func__, module, name, device); + if(strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) return -EINVAL; @@ -32,6 +32,8 @@ static uint32_t audio_in_get_sample_rate(const struct audio_stream *stream) static int audio_in_set_sample_rate(struct audio_stream *stream, uint32_t rate) { + LOGD("%s(%p, %d)", __func__, stream, rate); + return 0; } @@ -52,37 +54,49 @@ static int audio_in_get_format(const struct audio_stream *stream) static int audio_in_set_format(struct audio_stream *stream, int format) { + LOGD("%s(%p, %d)", __func__, stream, format); + return 0; } static int audio_in_standby(struct audio_stream *stream) { + LOGD("%s(%p)", __func__, stream); + return 0; } static int audio_in_dump(const struct audio_stream *stream, int fd) { + LOGD("%s(%p, %d)", __func__, stream, fd); + return 0; } static int audio_in_set_parameters(struct audio_stream *stream, const char *kvpairs) { + LOGD("%s(%p, %s)", __func__, stream, kvpairs); + return 0; } -static char * audio_in_get_parameters(const struct audio_stream *stream, +static char *audio_in_get_parameters(const struct audio_stream *stream, const char *keys) { + LOGD("%s(%p, %s)", __func__, stream, keys); + return strdup(""); } static int audio_in_set_gain(struct audio_stream_in *stream, float gain) { + LOGD("%s(%p, %f)", __func__, stream, gain); + return 0; } -static ssize_t audio_in_read(struct audio_stream_in *stream, void* buffer, - size_t bytes) +static ssize_t audio_in_read(struct audio_stream_in *stream, + void *buffer, size_t bytes) { /* XXX: fake timing for audio input */ usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / @@ -92,16 +106,22 @@ static ssize_t audio_in_read(struct audio_stream_in *stream, void* buffer, static uint32_t audio_in_get_input_frames_lost(struct audio_stream_in *stream) { + LOGD("%s(%p)", __func__, stream); + return 0; } static int audio_in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) { + LOGD("%s(%p, %p)", __func__, stream, effect); + return 0; } static int audio_in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect) { + LOGD("%s(%p, %p)", __func__, stream, effect); + return 0; } @@ -112,6 +132,8 @@ static int audio_in_remove_audio_effect(const struct audio_stream *stream, effec static void audio_hw_close_input_stream(struct audio_hw_device *dev, struct audio_stream_in *stream) { + LOGD("%s(%p)", __func__, stream); + if(stream != NULL) free(stream); } @@ -124,6 +146,9 @@ static int audio_hw_open_input_stream(struct audio_hw_device *dev, struct tinyalsa_audio_stream_in *tinyalsa_audio_stream_in; struct audio_stream_in *stream; + LOGD("%s(%p, %d, %p, %p, %p, %d, %p)", + __func__, dev, devices, format, channels, sample_rate, acoustics, stream_in); + if(dev == NULL) return -EINVAL; diff --git a/audio_out.c b/audio_out.c index ae69f52..04655e0 100644 --- a/audio_out.c +++ b/audio_out.c @@ -32,6 +32,8 @@ static uint32_t audio_out_get_sample_rate(const struct audio_stream *stream) static int audio_out_set_sample_rate(struct audio_stream *stream, uint32_t rate) { + LOGD("%s(%p, %d)", __func__, stream, rate); + return 0; } @@ -52,42 +54,56 @@ static int audio_out_get_format(const struct audio_stream *stream) static int audio_out_set_format(struct audio_stream *stream, int format) { + LOGD("%s(%p, %d)", __func__, stream, format); + return 0; } static int audio_out_standby(struct audio_stream *stream) { + LOGD("%s(%p)", __func__, stream); + return 0; } static int audio_out_dump(const struct audio_stream *stream, int fd) { + LOGD("%s(%p, %d)", __func__, stream, fd); + return 0; } static int audio_out_set_parameters(struct audio_stream *stream, const char *kvpairs) { + LOGD("%s(%p, %s)", __func__, stream, kvpairs); + return 0; } static char * audio_out_get_parameters(const struct audio_stream *stream, const char *keys) { + LOGD("%s(%p, %s)", __func__, stream, keys); + return strdup(""); } static uint32_t audio_out_get_latency(const struct audio_stream_out *stream) { + LOGD("%s(%p)", __func__, stream); + return 0; } static int audio_out_set_volume(struct audio_stream_out *stream, float left, float right) { + LOGD("%s(%p, %f, %f)", __func__, stream, left, right); + return 0; } -static ssize_t audio_out_write(struct audio_stream_out *stream, const void* buffer, - size_t bytes) +static ssize_t audio_out_write(struct audio_stream_out *stream, + const void *buffer, size_t bytes) { /* XXX: fake timing for audio output */ usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / @@ -98,16 +114,22 @@ static ssize_t audio_out_write(struct audio_stream_out *stream, const void* buff static int audio_out_get_render_position(const struct audio_stream_out *stream, uint32_t *dsp_frames) { + LOGD("%s(%p, %p)", __func__, stream, dsp_frames); + return -EINVAL; } static int audio_out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) { + LOGD("%s(%p, %p)", __func__, stream, effect); + return 0; } static int audio_out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect) { + LOGD("%s(%p, %p)", __func__, stream, effect); + return 0; } @@ -118,6 +140,8 @@ static int audio_out_remove_audio_effect(const struct audio_stream *stream, effe void audio_hw_close_output_stream(struct audio_hw_device *dev, struct audio_stream_out *stream) { + LOGD("%s(%p)", __func__, stream); + if(stream != NULL) free(stream); } @@ -130,6 +154,9 @@ int audio_hw_open_output_stream(struct audio_hw_device *dev, struct tinyalsa_audio_stream_out *tinyalsa_audio_stream_out; struct audio_stream_out *stream; + LOGD("%s(%p, %d, %p, %p, %p, %p)", + __func__, dev, devices, format, channels, sample_rate, stream_out); + if(dev == NULL) return -EINVAL; |