summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-09-23 11:01:24 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-09-23 11:01:24 +0200
commitf17d43066fc1f8b03947032bb04a1b5cc22203fa (patch)
tree632fefca59e04d081cc837ec77b68526495b7d4f
parent38f53573aad8deef4b2fe0663091f9c9336f711a (diff)
downloadhardware_tinyalsa-audio-f17d43066fc1f8b03947032bb04a1b5cc22203fa.zip
hardware_tinyalsa-audio-f17d43066fc1f8b03947032bb04a1b5cc22203fa.tar.gz
hardware_tinyalsa-audio-f17d43066fc1f8b03947032bb04a1b5cc22203fa.tar.bz2
Debug prints on most functions
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--audio_hw.c28
-rw-r--r--audio_in.c31
-rw-r--r--audio_out.c31
3 files changed, 84 insertions, 6 deletions
diff --git a/audio_hw.c b/audio_hw.c
index 5e18a0b..317a798 100644
--- a/audio_hw.c
+++ b/audio_hw.c
@@ -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;
diff --git a/audio_in.c b/audio_in.c
index dffed01..ef6730b 100644
--- a/audio_in.c
+++ b/audio_in.c
@@ -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;