aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wilson2011-11-17 09:48:19 -0600
committerAndroid Git Automerger2011-11-17 09:48:19 -0600
commita52f4a721582ea7a8aae20e7043b27e681beda4d (patch)
treeb836d651fc1201855c9645aaf26eeef250d9343d
parent9b780fa5164bd37dbe9f93f28de05e598c1784f4 (diff)
parent5aed71db7d87ba518b53e40c00dcaa0afbc2aceb (diff)
downloadplatform-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.h6
-rw-r--r--mixer.c3
-rw-r--r--pcm.c5
-rw-r--r--tinymix.c3
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 */
114const char *pcm_get_error(struct pcm *pcm); 114const 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 */
119unsigned int pcm_get_buffer_size(struct pcm *pcm); 117unsigned int pcm_get_buffer_size(struct pcm *pcm);
120unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); 118unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames);
121unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int frames); 119unsigned 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 */
124unsigned int pcm_get_latency(struct pcm *pcm); 122unsigned int pcm_get_latency(struct pcm *pcm);
diff --git a/mixer.c b/mixer.c
index 5563bc6..a7f5d21 100644
--- a/mixer.c
+++ b/mixer.c
@@ -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 }
diff --git a/pcm.c b/pcm.c
index dbf68e4..f499a05 100644
--- a/pcm.c
+++ b/pcm.c
@@ -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
diff --git a/tinymix.c b/tinymix.c
index 3b778e1..b9c71a4 100644
--- a/tinymix.c
+++ b/tinymix.c
@@ -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;