Delay when starting playback

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.x.x package for your distribution or compile Audacity from the source code.
Locked
audacity-aa
Posts: 5
Joined: Wed Jul 23, 2008 2:44 pm
Operating System: Please select

Delay when starting playback

Post by audacity-aa » Wed Jul 23, 2008 3:26 pm

Hi,

when starting playback of a short test sound, I recognize a delay of about one second every time after pressing the space key or the start button until the real playback starts. When opening "Help -> Audio Device Info" it takes about 10 seconds before the window with the results appears.

configure flags: --with-libsndfile=system --with-libflac --with-libmad=system --with-id3tag=system --with-libresample=no --with-libsamplerate=system --with-soundtouch=system --with-portaudio=v19 --with-ladspa --with-expat=system --with-wx-version=2.8

Below you'll find the output of "Help -> Audio Device Info".
With audacity-1.2, aplau or other tools the playback is working fine.

Thanks a lot for your help!

Kind regards,

Ado

==============================
Default capture device number: -1
Default playback device number: -1
==============================
Device ID: 0
Device name: ALSA: HDA Intel: AD198x Analog (hw:0,0)
Input channels: 2
Output channels: 2
Low Input Latency: 0.011610
Low Output Latency: 0.011610
High Input Latency: 0.046440
High Output Latency: 0.046440
Supported Rates:
8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Device ID: 1
Device name: ALSA: HDA Intel: AD198x Digital (hw:0,1)
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
44100
48000
88200
96000
192000
==============================
Device ID: 2
Device name: ALSA: front
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Device ID: 3
Device name: ALSA: surround40
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Device ID: 4
Device name: ALSA: surround51
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Device ID: 5
Device name: ALSA: surround71
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Device ID: 6
Device name: ALSA: iec958
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
44100
48000
88200
96000
192000
==============================
Device ID: 7
Device name: ALSA: spdif
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.011610
High Input Latency: -1.000000
High Output Latency: 0.046440
Supported Rates:
44100
48000
88200
96000
192000
==============================
Device ID: 8
Device name: ALSA: default
Input channels: 128
Output channels: 128
Low Input Latency: 0.042653
Low Output Latency: 0.042653
High Input Latency: 0.046440
High Output Latency: 0.046440
Supported Rates:
8000
9600
11025
16000
22050
32000
44100
48000
88200
==============================
Device ID: 9
Device name: ALSA: dmix
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.042667
High Input Latency: -1.000000
High Output Latency: 0.042667
Supported Rates:
48000
==============================
Selected capture device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Selected playback device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Supported Rates: 8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Available mixers:
==============================
Available capture sources:
0 - Front Mic Boost:0
1 - Mic Boost:0
2 - Capture:0
3 - Capture:1
4 - Digital:0
==============================
Available playback volumes:
0 - Master:0
1 - Headphone:0
2 - PCM:0
3 - Front:0
4 - Front Mic:0
5 - Front Mic Boost:0
6 - CD:0
7 - Mic:0
8 - Mic Boost:0
9 - IEC958:0
10 - Mono:0
==============================
Capture volume is native
Capture volume is native

steve
Site Admin
Posts: 81653
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Delay when starting playback

Post by steve » Wed Jul 23, 2008 5:02 pm

Your current settings appear to be:
Selected capture device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Selected playback device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)

Try going to "Edit > Preferences > Audio I/O" and setting Record and Playback devices to "Alsa default" and see if that improves it.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

audacity-aa
Posts: 5
Joined: Wed Jul 23, 2008 2:44 pm
Operating System: Please select

Re: Delay when starting playback

Post by audacity-aa » Thu Jul 24, 2008 9:11 am

Thanks for your hint, but it doesn't change anything. I also removed ~/.audacity* and /tmp/audacity* without any change.

Kind regards,

Ado

audacity-aa
Posts: 5
Joined: Wed Jul 23, 2008 2:44 pm
Operating System: Please select

Re: Delay when starting playback

Post by audacity-aa » Thu Jul 24, 2008 12:20 pm

Hi all,

I have found two (inconvenient) ways to avoid the delay. Perhaps these observations help to track down the problem.

1. If I first startup firefox, play a sound within firefox (e.g. a tune on http://www.jpc.de or http://www.dradio.de -> Flash), then start audacity and select "ALSA: default" as playback device, the delay disappears.

2. Another way is to play a tune with e.g. aplay. As long as aplay runs, the delay in starting a playback in audacity is gone.

It seems the delay disappears only if another application has opened the sound device before audacity accesses it.


There is another thing handling portmixer:

If I choose as playback device "ALSA: HDA Intel: AD198x Analog (hw:0,0)"
I get a listing off mixers, capture sources and playback volumes
at the end of "Help -> Audio Device Info":

==============================
Selected capture device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Selected playback device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Supported Rates: 8000
11025
16000
22050
32000
44100
48000
88200
96000
192000
==============================
Available mixers:
==============================
Available capture sources:
0 - Front Mic Boost:0
1 - Mic Boost:0
2 - Capture:0
3 - Capture:1
4 - Digital:0
==============================
Available playback volumes:
0 - Master:0
1 - Headphone:0
2 - PCM:0
3 - Front:0
4 - Front Mic:0
5 - Front Mic Boost:0
6 - CD:0
7 - Mic:0
8 - Mic Boost:0
9 - IEC958:0
10 - Mono:0
==============================
Capture volume is native
Capture volume is native


If I choose "ALSA: default" as playback device I get (only last part
listed):

...
==============================
Selected capture device: 0 - ALSA: HDA Intel: AD198x Analog (hw:0,0)
Selected playback device: 8 - ALSA: default
Supported Rates: 8000
11025
16000
22050
32000
44100
48000
88200
Unable to open Portmixer

Does anyone have an idea how to solve my problems?

Kind regards,

Ado

steve
Site Admin
Posts: 81653
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Delay when starting playback

Post by steve » Thu Jul 24, 2008 12:27 pm

Is it a packaged version that you are using, or one that you have built from source?
There's information in the wiki (link at top of the page) about building from source. Since Audacity 1.3.x is beta software, and Portaudio has been upgraded recently, there seems to be quite a few problems with packaged version. Hopefully when Audacity 1.4 stable come out these sort of problems will be resolved.

I'm afraid that there is a marked lack of Linux expertise on this forum, so if you manage to fix it, please enlighten us here on the forum - it could help someone in the future.

Steve
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

audacity-aa
Posts: 5
Joined: Wed Jul 23, 2008 2:44 pm
Operating System: Please select

Re: Delay when starting playback

Post by audacity-aa » Thu Jul 24, 2008 12:40 pm

Hi stevethefiddle,

the package I'm using is built from source (same as with my own linux system). I have shown the config params in my first mail.

For sure if I find more I will publish it, but I'm afaraid that I'm not familiar enough with the sound system for debugging this problem.

Ado

audacity-aa
Posts: 5
Joined: Wed Jul 23, 2008 2:44 pm
Operating System: Please select

Re: Delay when starting playback

Post by audacity-aa » Thu Jul 24, 2008 4:26 pm

Ok, I have tracked down the problem to the call of AlsaOpen in lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c/TestParameters, line 1067:
PA_ENSURE( AlsaOpen( hostApi, parameters, streamDir, &pcm ) );
Since I'm sure that the sound device supports the requested 44100 Hz, I inserted a
return paNoError
just in front of that statement and the delay disappears.

Is there one of the developers listening who could give me an advise how to go on?

Thanks and kind regards,

Ado

Locked