[linux-audio-dev] latency problem bdflush related?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] latency problem bdflush related?
From: Men Muheim (men_AT_ife.ee.ethz.ch)
Date: Wed Nov 21 2001 - 14:20:47 EET


I am experiencing heavy audio latency problems on two different systems (a
500MHz alpha and a Pentium Pro 188MHz - detailed system information see
below)

Problem description:
--------------------
I have implemented a simple life monitoring application for ALSA 0.6 on an
alpha system and ALSA 0.9 on a pentium system (see below). on both systems I
get am getting xrun - and of course audible clickings every five seconds.

Potential reason:
-----------------
The Problem seems to be related to meta data buffer flushes of the bdflush
daemon. I have expterimented with different settings of /proc/sys/vm/bdflush
and seen that value 4 (the percentage of cache to scan for free clusters)
can change the rate of xruns. smaller values mean a higher xrun rates.

Unfortunately I could not find bdflush values which suppress xruns
completely and I think killing the bdflush daemon is not the right sollution
either. Does anyone have the background understanding of what might be going
wrong in my system. could the problem be related to DMA, bus arbitration or
interrupt priorities? Would you recommend another preemptive kernel patch?

I really appreciate any help on this issue because I am completely stuck!
sigh!

Thank you in advance...

Men

------------------------------------------------------------------
the live monitoring on my pentium system is based on jackit
http://jackit.sourceforge.net/
------------------------------------------------------------------

jack server:
------------

# ./run.sh -R -P 99 -p 128
jackd: no process killed
creating alsa driver ... default|128|48000
new client: ALSA I/O, type 1 @ 0x805f868
registered ALSA I/O:Input 1
registered ALSA I/O:Input 2
registered ALSA I/O:Output 1
registered ALSA I/O:Output 2
ports registered, starting client
start engine ...
cannot lock down memory for RT thread (Cannot allocate memory)
new client: myClient, type 2 @ 0x5ffeb000
client myClient is on event fd 14
trying to connect ALSA I/O:Input 1 and myClient:myinput1
sending connection to client ALSA I/O
ALSA I/O:Input 1 connected to myClient:myinput1
sending connection to client myClient
trying to connect ALSA I/O:Input 2 and myClient:myinput2
sending connection to client ALSA I/O
ALSA I/O:Input 2 connected to myClient:myinput2
sending connection to client myClient
trying to connect myClient:myoutput1 and ALSA I/O:Output 1
sending connection to client myClient
sending connection to client ALSA I/O
ALSA I/O:Output 1 connected to myClient:myoutput1
trying to connect myClient:myoutput2 and ALSA I/O:Output 2
sending connection to client myClient
sending connection to client ALSA I/O
ALSA I/O:Output 2 connected to myClient:myoutput2
ALSA I/O: xrun of 3088 frames, (64.333 msecs)
ALSA I/O: xrun of 1440 frames, (30.000 msecs)
ALSA I/O: xrun of 304 frames, (6.333 msecs)
ALSA I/O: xrun of 1008 frames, (21.000 msecs)
ALSA I/O: xrun of 560 frames, (11.667 msecs)
ALSA I/O: xrun of 272 frames, (5.667 msecs)
...

jack client:
------------

# ./jack_simple_client myClient
the maximum buffer size is now 128
the sample rate is now 48000/sec
engine sample rate: 48000
client activated
myClient:myinput1 connected to ALSA I/O:Input 1
myClient:myinput2 connected to ALSA I/O:Input 2
myClient:myoutput1 connected to ALSA I/O:Output 1
myClient:myoutput2 connected to ALSA I/O:Output 2

---------------------------------------------------------
pentium system information
---------------------------------------------------------
$ uname -a
Linux xxx.ethz.ch 2.4.7-10custom #19 Tue Nov 6 07:30:16 EST 2001 i686
unknown

kernel patched with preempt-2.4.7-2.patch.txt

$ more /proc/asound/version
Advanced Linux Sound Architecture Driver Version 0.9.0beta9.
Compiled on Nov 11 2001 for kernel 2.4.7-10custom with versioned symbols.

$ more /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 1
model name : Pentium Pro
stepping : 6
cpu MHz : 179.631
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov
bogomips : 357.99

# lspci -v
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
        Flags: bus master, medium devsel, latency 32

00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
(rev 01)
        Flags: bus master, medium devsel, latency 0

00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton
II] (prog-if 80 [Master])
        Flags: medium devsel
        I/O ports at e800 [size=16]

00:09.0 Ethernet controller: Digital Equipment Corporation DECchip 21140
[FasterNet] (rev 22)
        Subsystem: D-Link System Inc DFE-500TX Fast Ethernet
        Flags: bus master, medium devsel, latency 32, IRQ 9
        I/O ports at e000 [size=128]
        Memory at e7000000 (32-bit, non-prefetchable) [size=128]
        Expansion ROM at <unassigned> [disabled] [size=256K]

00:0b.0 VGA compatible controller: S3 Inc. 86c764/765 [Trio32/64/64V+] (rev
54) (prog-if 00 [VGA])
        Flags: medium devsel, IRQ 10
        Memory at e0000000 (32-bit, non-prefetchable) [size=64M]
        Expansion ROM at <unassigned> [disabled] [size=64K]

00:0c.0 SCSI storage controller: Adaptec AHA-294x / AIC-7871 (rev 03)
        Flags: bus master, medium devsel, latency 32, IRQ 11
        I/O ports at d800 [disabled] [size=256]
        Memory at df800000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at <unassigned> [disabled] [size=64K]

00:0d.0 Multimedia audio controller: Xilinx, Inc.: Unknown device 3fc4 (rev
03)
        Flags: bus master, stepping, slow devsel, latency 32, IRQ 9
        Memory at de000000 (32-bit, non-prefetchable) [size=16M]

# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 1731460 1470392 173116 90% /
/dev/sda1 46636 8202 36026 19% /boot
none 31124 0 31124 0% /dev/shm
/dev/sdb1 1154276 328232 767412 30% /scr

# update -d
bdflush version 1.4
0: 30 Max fraction of LRU list to examine for dirty blocks
1: 64 Max number of dirty blocks to write each time bdflush activated
2: 64 Num of clean buffers to be loaded onto free list by refill_freelist
3: 256 Dirty block threshold for activating bdflush in refill_freelist
4: 500 Percentage of cache to scan for free clusters
5: 3000 Time for data buffers to age before flushing
6: 60 Time for non-data (dir, bitmap, etc) buffers to age before flushing
7: 0 Time buffer cache load average constant
8: 0 LAV ratio (used to determine threshold for buffer fratricide).

---------------------------------------------------------
alpha system informations:
---------------------------------------------------------
% uname -a
Linux yyy.ethz.ch 2.2.14-6.0 #1 Die Nov 21 14:02:45 CET 2000 alpha unknown

% more /proc/asound/version
Advanced Linux Sound Architecture Driver Version 0.6.0pre1.
Compiled on Apr 5 2001 for kernel 2.2.14-6.0 with versioned symbols.

% more /proc/cpuinfo
cpu : Alpha
cpu model : EV56
cpu variation : 7
cpu revision : 0
cpu serial number :
system type : Miata
system variation : 0
system revision : 0
system serial number :
cycle frequency [Hz] : 500000000
timer frequency [Hz] : 1024.00
page size [bytes] : 8192
phys. address bits : 40
max. addr. space # : 127
BogoMIPS : 494.92
kernel unaligned acc : 0 (pc=0,va=0)
user unaligned acc : 424 (pc=2000000edb0,va=20000271b74)
platform string : Digital Personal WorkStation 500au
cpus detected : 1

% lspci -v
00:03.0 Ethernet controller: Digital Equipment Corporation DECchip 21142/43
(rev 30)
        Flags: bus master, medium devsel, latency 255, IRQ 24
        I/O ports at 8000
        Memory at 0000000009000000 (32-bit, non-prefetchable)
        Expansion ROM at 0000000081900000 [disabled]

00:04.0 IDE interface: CMD Technology Inc PCI0646 (rev 01) (prog-if 80
[Master])
        Flags: bus master, medium devsel, latency 64
        I/O ports at 8800

00:07.0 Non-VGA unclassified device: Intel Corporation 82378IB [SIO ISA
Bridge] (rev 43)
        Flags: bus master, medium devsel, latency 0

00:0c.0 SCSI storage controller: Q Logic ISP1020 (rev 05)
        Flags: bus master, medium devsel, latency 248, IRQ 32
        I/O ports at 9000
        Memory at 0000000009001000 (32-bit, non-prefetchable)
        Expansion ROM at 0000000081940000 [disabled]

00:14.0 PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 02)
(prog-if 00 [Normal decode])
        Flags: bus master, medium devsel, latency 255
        Bus: primary=00, secondary=01, subordinate=00, sec-latency=255
        I/O behind bridge: 0000a000-0000afff
        Memory behind bridge: 09100000-31ffffff
        Prefetchable memory behind bridge: 0000000000000000-0000000000000000

01:08.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200 (rev 01)
(prog-if 00 [VGA])
        Subsystem: Matrox Graphics, Inc. Millennium G200 SD
        Flags: bus master, medium devsel, latency 248, IRQ 36
        Memory at 000000000a000000 (32-bit, prefetchable)
        Memory at 000000000b000000 (32-bit, non-prefetchable)
        Memory at 000000000b800000 (32-bit, non-prefetchable)
        Expansion ROM at 0000000081800000 [disabled]
        Capabilities: <available only to root>

01:09.0 Network controller: PLX Technology, Inc.: Unknown device 4444 (rev
05)
        Subsystem: PLX Technology, Inc.: Unknown device 9080
        Flags: bus master, medium devsel, latency 255, IRQ 40
        Memory at 000000000c000000 (32-bit, non-prefetchable)
        I/O ports at a000
        Memory at 000000001c000000 (32-bit, prefetchable)
        Memory at 000000002c000000 (32-bit, prefetchable)
        Expansion ROM at 0000000081814000 [disabled]

01:0a.0 Multimedia audio controller: Xilinx, Inc.: Unknown device 3fc4 (rev
03)
        Flags: bus master, stepping, slow devsel, latency 255, IRQ 44
        Memory at 0000000031000000 (32-bit, non-prefetchable)

# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda4 1902888 1047281 758816 58% /
/dev/sda5 2063536 1875644 83068 96% /usr

# update -d
bdflush version 1.4
0: 40 Max fraction of LRU list to examine for dirty blocks
1: 500 Max number of dirty blocks to write each time bdflush activated
2: 64 Num of clean buffers to be loaded onto free list by refill_freelist
3: 256 Dirty block threshold for activating bdflush in refill_freelist
4: 5120 Percentage of cache to scan for free clusters
5: 30720 Time for data buffers to age before flushing
6: 5120 Time for non-data (dir, bitmap, etc) buffers to age before flushing
7: 1884 Time buffer cache load average constant
8: 2 LAV ratio (used to determine threshold for buffer fratricide).


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Nov 21 2001 - 14:22:17 EET