diff options
author | Simon Wilson | 2011-11-17 09:48:19 -0600 |
---|---|---|
committer | Android Git Automerger | 2011-11-17 09:48:19 -0600 |
commit | a52f4a721582ea7a8aae20e7043b27e681beda4d (patch) | |
tree | b836d651fc1201855c9645aaf26eeef250d9343d | |
parent | 9b780fa5164bd37dbe9f93f28de05e598c1784f4 (diff) | |
parent | 5aed71db7d87ba518b53e40c00dcaa0afbc2aceb (diff) | |
download | platform-external-tinyalsa-a52f4a721582ea7a8aae20e7043b27e681beda4d.tar.gz platform-external-tinyalsa-a52f4a721582ea7a8aae20e7043b27e681beda4d.tar.xz platform-external-tinyalsa-a52f4a721582ea7a8aae20e7043b27e681beda4d.zip |
am 5aed71db: Update to latest tinyalsa
* commit '5aed71db7d87ba518b53e40c00dcaa0afbc2aceb':
Update to latest tinyalsa
-rw-r--r-- | include/tinyalsa/asoundlib.h | 6 | ||||
-rw-r--r-- | mixer.c | 3 | ||||
-rw-r--r-- | pcm.c | 5 | ||||
-rw-r--r-- | tinymix.c | 3 |
4 files changed, 12 insertions, 5 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h index 741c466..d6409fe 100644 --- a/include/tinyalsa/asoundlib.h +++ b/include/tinyalsa/asoundlib.h | |||
@@ -113,12 +113,10 @@ int pcm_set_config(struct pcm *pcm, struct pcm_config *config); | |||
113 | /* Returns a human readable reason for the last error */ | 113 | /* Returns a human readable reason for the last error */ |
114 | const char *pcm_get_error(struct pcm *pcm); | 114 | const char *pcm_get_error(struct pcm *pcm); |
115 | 115 | ||
116 | /* Returns the buffer size (int frames) that should be used for pcm_write. | 116 | /* Returns the buffer size (int frames) that should be used for pcm_write. */ |
117 | * This will be 1/2 of the actual fifo size. | ||
118 | */ | ||
119 | unsigned int pcm_get_buffer_size(struct pcm *pcm); | 117 | unsigned int pcm_get_buffer_size(struct pcm *pcm); |
120 | unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); | 118 | unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); |
121 | unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int frames); | 119 | unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int bytes); |
122 | 120 | ||
123 | /* Returns the pcm latency in ms */ | 121 | /* Returns the pcm latency in ms */ |
124 | unsigned int pcm_get_latency(struct pcm *pcm); | 122 | unsigned int pcm_get_latency(struct pcm *pcm); |
@@ -306,6 +306,9 @@ int mixer_ctl_get_value(struct mixer_ctl *ctl, unsigned int id) | |||
306 | case SNDRV_CTL_ELEM_TYPE_ENUMERATED: | 306 | case SNDRV_CTL_ELEM_TYPE_ENUMERATED: |
307 | return ev.value.enumerated.item[id]; | 307 | return ev.value.enumerated.item[id]; |
308 | 308 | ||
309 | case SNDRV_CTL_ELEM_TYPE_BYTES: | ||
310 | return ev.value.bytes.data[id]; | ||
311 | |||
309 | default: | 312 | default: |
310 | return -EINVAL; | 313 | return -EINVAL; |
311 | } | 314 | } |
@@ -341,6 +341,9 @@ int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, | |||
341 | if (rc < 0) | 341 | if (rc < 0) |
342 | return -1; | 342 | return -1; |
343 | 343 | ||
344 | if (pcm->mmap_status->state == PCM_STATE_XRUN) | ||
345 | return -1; | ||
346 | |||
344 | *tstamp = pcm->mmap_status->tstamp; | 347 | *tstamp = pcm->mmap_status->tstamp; |
345 | if (tstamp->tv_sec == 0 && tstamp->tv_nsec == 0) | 348 | if (tstamp->tv_sec == 0 && tstamp->tv_nsec == 0) |
346 | return -1; | 349 | return -1; |
@@ -549,7 +552,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, | |||
549 | /* pick a high stop threshold - todo: does this need further tuning */ | 552 | /* pick a high stop threshold - todo: does this need further tuning */ |
550 | if (!config->stop_threshold) | 553 | if (!config->stop_threshold) |
551 | pcm->config.stop_threshold = sparams.stop_threshold = | 554 | pcm->config.stop_threshold = sparams.stop_threshold = |
552 | config->period_count * config->period_size * 10; | 555 | config->period_count * config->period_size; |
553 | else | 556 | else |
554 | sparams.stop_threshold = config->stop_threshold; | 557 | sparams.stop_threshold = config->stop_threshold; |
555 | 558 | ||
@@ -140,6 +140,9 @@ static void tinymix_detail_control(struct mixer *mixer, unsigned int id, | |||
140 | case MIXER_CTL_TYPE_ENUM: | 140 | case MIXER_CTL_TYPE_ENUM: |
141 | tinymix_print_enum(ctl, print_all); | 141 | tinymix_print_enum(ctl, print_all); |
142 | break; | 142 | break; |
143 | case MIXER_CTL_TYPE_BYTE: | ||
144 | printf(" 0x%02x", mixer_ctl_get_value(ctl, i)); | ||
145 | break; | ||
143 | default: | 146 | default: |
144 | printf(" unknown"); | 147 | printf(" unknown"); |
145 | break; | 148 | break; |