]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Adjust buffering metrics to match what PA internally uses
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 16:18:48 +0000 (18:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 18:25:38 +0000 (20:25 +0200)
Follow more closely the buffering metrics PA uses internally. This avoids
clamping of the metricsin PA internally.

pulse/pcm_pulse.c

index fb73c8214bc3ac51efbaf0b31ae51efaad6f1a98..6d7403c16213008d67660fe8784564045d81a6e9 100644 (file)
@@ -631,9 +631,9 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io,
        pcm->ss.channels = io->channels;
 
        pcm->buffer_attr.maxlength =
-               io->buffer_size * pcm->frame_size;
+               4 * 1024 * 1024;
        pcm->buffer_attr.tlength =
-               pcm->buffer_attr.maxlength;
+               io->buffer_size * pcm->frame_size;
        pcm->buffer_attr.prebuf =
            (io->buffer_size - io->period_size) * pcm->frame_size;
        pcm->buffer_attr.minreq = io->period_size * pcm->frame_size;
@@ -757,13 +757,13 @@ static int pulse_hw_constraint(snd_pcm_pulse_t * pcm)
        err =
            snd_pcm_ioplug_set_param_minmax(io,
                                            SND_PCM_IOPLUG_HW_PERIOD_BYTES,
-                                           256, 2 * 1024 * 1024);
+                                           128, 2 * 1024 * 1024);
        if (err < 0)
                return err;
 
        err =
            snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIODS,
-                                           2, 1024);
+                                           3, 1024);
        if (err < 0)
                return err;
        return 0;