Skip to contentSkip to conversation

Delays with PulseAudio (normal)?

DISCUSSION Tom Watson 2 participants 2 messages Nov 17, 2009

lore
Share & tools
lore

Tom Watson

author
#0 lore raw

I just did an fresh install of a Fedora 11, and it went well for the most part. Then I tried some audio stuff, and it seems that pulseaudio (groan!) has a closing delay.

In my case I want to issue a "beep" then make a recording. This involves the equivalent of:

$ aplay beep.wav
$ arecord -d recordit.wav

This used to work in a kernel of a few years ago, but in F11 there is a NOTICABLE delay from the end of the beep to the start of the recording. It can even be seen if one does a simple aplay and waits for the shell prompt. I was wondering if there was an option in a configuration file, or a hammer I can take to pulseaudio to solve this problem.

An added bit of information: The beep.wav file is about 0.1 second long (if that matters, which I believe it shouldn't).

Any clues would be appreciated,
Thanks.

Signature · 1 line
Tom Watson
#1 lore raw

2009/11/17 Tom Watson <[email protected]>

Quoted 19 lines

I just did an fresh install of a Fedora 11, and it went well for the most part. Then I tried some audio stuff, and it seems that pulseaudio (groan!) has a closing delay.

In my case I want to issue a "beep" then make a recording. This involves the equivalent of:

$ aplay beep.wav
$ arecord -d recordit.wav

This used to work in a kernel of a few years ago, but in F11 there is a NOTICABLE delay from the end of the beep to the start of the recording. It can even be seen if one does a simple aplay and waits for the shell prompt.
I was wondering if there was an option in a configuration file, or a hammer
I can take to pulseaudio to solve this problem.

An added bit of information: The beep.wav file is about 0.1 second long (if that matters, which I believe it shouldn't).

Quoted 8 lines

Any clues would be appreciated,
Thanks.

--
Tom Watson

In theory, minimum period bytes is 128 bytes if your alsa application are using alsa-pulse plugin

    err =
        snd_pcm_ioplug_set_param_minmax(io,
                        SND_PCM_IOPLUG_HW_BUFFER_BYTES,
                        1, 4 * 1024 * 1024);
    if (err < 0)
        return err;

    err =
        snd_pcm_ioplug_set_param_minmax(io,
                        SND_PCM_IOPLUG_HW_PERIOD_BYTES,
                        128, 2 * 1024 * 1024);
    if (err < 0)
        return err;