[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test2-104-ge335b3d
Lennart Poettering
gitmailer-noreply at 0pointer.de
Sat Feb 21 18:57:11 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 2d9ae496c953ce62765f8f7f5b87fcab5e325c52 (commit)
- Log -----------------------------------------------------------------
e335b3d... prepare test for tracking down ens1371 issue
-----------------------------------------------------------------------
Summary of changes:
src/tests/alsa-time-test.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
-----------------------------------------------------------------------
commit e335b3d6cacf5ae961848e28021eb8713865839f
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Feb 22 03:55:54 2009 +0100
prepare test for tracking down ens1371 issue
diff --git a/src/tests/alsa-time-test.c b/src/tests/alsa-time-test.c
index 3858bf7..e852c3f 100644
--- a/src/tests/alsa-time-test.c
+++ b/src/tests/alsa-time-test.c
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
snd_pcm_status_t *status;
snd_pcm_t *pcm;
unsigned rate = 44100;
- unsigned periods = 0;
+ unsigned periods = 2;
snd_pcm_uframes_t boundary, buffer_size = 44100/10; /* 100s */
int dir = 1;
struct timespec start, last_timestamp = { 0, 0 };
@@ -75,10 +75,13 @@ int main(int argc, char *argv[]) {
r = snd_pcm_hw_params_current(pcm, hwparams);
assert(r == 0);
+ r = snd_pcm_sw_params_current(pcm, swparams);
+ assert(r == 0);
+
r = snd_pcm_sw_params_set_avail_min(pcm, swparams, 1);
assert(r == 0);
- r = snd_pcm_sw_params_set_period_event(pcm, swparams, 1);
+ r = snd_pcm_sw_params_set_period_event(pcm, swparams, 0);
assert(r == 0);
r = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size);
@@ -116,7 +119,6 @@ int main(int argc, char *argv[]) {
for (;;) {
snd_pcm_sframes_t avail, delay;
-/* snd_pcm_uframes_t avail2; */
struct timespec now, timestamp;
unsigned short revents;
int written = 0;
@@ -131,29 +133,20 @@ int main(int argc, char *argv[]) {
assert((revents & ~POLLOUT) == 0);
-/* state = snd_pcm_get_state(pcm); */
-
avail = snd_pcm_avail(pcm);
assert(avail >= 0);
r = snd_pcm_status(pcm, status);
assert(r == 0);
- printf("%lu %lu\n", (unsigned long) avail, (unsigned long) snd_pcm_status_get_avail(status));
+ /* This assertion fails from time to time. ALSA seems to be broken */
+/* assert(avail == (snd_pcm_sframes_t) snd_pcm_status_get_avail(status)); */
+/* printf("%lu %lu\n", (unsigned long) avail, (unsigned long) snd_pcm_status_get_avail(status)); */
- assert(avail == (snd_pcm_sframes_t) snd_pcm_status_get_avail(status));
snd_pcm_status_get_htstamp(status, ×tamp);
delay = snd_pcm_status_get_delay(status);
state = snd_pcm_status_get_state(status);
-/* r = snd_pcm_avail_delay(pcm, &avail, &delay); */
-/* assert(r == 0); */
-
-/* r = snd_pcm_htimestamp(pcm, &avail2, ×tamp); */
-/* assert(r == 0); */
-
-/* assert(avail == (snd_pcm_sframes_t) avail2); */
-
r = clock_gettime(CLOCK_MONOTONIC, &now);
assert(r == 0);
@@ -191,6 +184,10 @@ int main(int argc, char *argv[]) {
written,
state);
+ /** When this assert is hit, most likely something bad
+ * happened, i.e. the avail jumped suddenly. */
+ assert((unsigned) avail <= buffer_size);
+
last_avail = avail;
last_delay = delay;
last_timestamp = timestamp;
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list