]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Rework hardware parameter selection
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2008 23:13:41 +0000 (01:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 18:25:37 +0000 (20:25 +0200)
Follow more closely the real limits of PulseAudio's API.

pulse/pcm_pulse.c

index 7d0342021c08f26eb0f472decfc0a8170036b86e..fb73c8214bc3ac51efbaf0b31ae51efaad6f1a98 100644 (file)
@@ -631,8 +631,9 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io,
        pcm->ss.channels = io->channels;
 
        pcm->buffer_attr.maxlength =
-           (io->buffer_size * 3) / 2 * pcm->frame_size;
-       pcm->buffer_attr.tlength = io->buffer_size * pcm->frame_size;
+               io->buffer_size * pcm->frame_size;
+       pcm->buffer_attr.tlength =
+               pcm->buffer_attr.maxlength;
        pcm->buffer_attr.prebuf =
            (io->buffer_size - io->period_size) * pcm->frame_size;
        pcm->buffer_attr.minreq = io->period_size * pcm->frame_size;
@@ -741,9 +742,8 @@ static int pulse_hw_constraint(snd_pcm_pulse_t * pcm)
        if (err < 0)
                return err;
 
-       /* FIXME: Investigate actual min and max */
        err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_RATE,
-                                             8000, 48000);
+                                             1, PA_RATE_MAX);
        if (err < 0)
                return err;
 
@@ -757,7 +757,7 @@ 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, 1024 * 1024);
+                                           256, 2 * 1024 * 1024);
        if (err < 0)
                return err;