I'm experiencing quite a noticeable amount of latency when running JACK with OSS when routing the input of the card back to the output. Originally I was using the built-in FreeBSD sound driver (emu10k1) and was trying different things to get the least latency possible so I installed 4Front's OSS to try.
The latency when using OSS on this same task is much higher than with emu10k1 in FreeBSD. After playing around with some of JACK's settings and the included FreeBSD driver, I was able to get the latency down to where it's not super noticeable but there was still a bit of an "echo" effect. Since I'm going to be doing lots of live recording, I wanted to try OSS again to see if there would be an improvement over that. The result is a much more noticeable delay which is heard as well as seen visually on ossxmix's output meters (the "record" meters show it incoming correctly with no visual delay). I don't have any accurate numbers on the latency but I would guess between 100ms and 200ms with OSS whereas the latency indicator for FBSD's emu10k1 was showing around 16ms with my settings.
With OSS, the "Frames/Period" (-p) option in JACK doesn't seem to have any effect on the latency as it does with emu10k1. Also, the "-b" option ("Ignore hardware period/buffer size") has to be used with OSS, but I'm not sure if that has anything to do with this.
Basically what I'm trying to do right now is take the sound card's line input which is a mono source and send it back out on both left and right channels so I hear it in both headphones when recording. I'm doing this by connecting the "capture_1" in JACK to both 'playback_1" and "playback_2".
Are there some OSS options I'm missing which might be causing the higher latency than FreeBSD's emu10k1 driver? I've tried with JACK as root with realtime priority and without and things don't seem to change. I've also tried with the ULE and 4BSD schedulers without much change either. It doesn't seem to be a CPU overload problem since I was doing some tests with only the necessary things open and things were the same.
Also, is there a better way to do what I am trying to do that I might be missing?
My hardware is:
Athlon64 X2 5200+
2GB RAM
Sound Blaster Audigy 2 Platinum
FreeBSD 7.0-STABLE [amd64]
oss-freebsd7-v4.0-1015-amd64
Thanks in advance!
-Mark
Code: Select all
[mixx941@amd645200:~]% ossinfo -v9
Version info: OSS 4.0 (b1015/200803240216) (0x00040003)
Platform: FreeBSD/amd64 7.0-STABLE FreeBSD 7.0-STABLE #8: Mon May 5 14:17:43 CDT 2008 mixx941@amd645200.localhost:/usr/obj/usr/src/sys/AMD645200 (amd645200.localhost)
Number of audio devices: 14
Number of audio engines: 14
Number of mixer devices: 1
Device objects
0: sblive0 SB Audigy2
1: vmix0 OSS transparent virtual mixer
Mixer devices
0: SB Audigy2 (STAC9721) (Mixer 0 of device object 0)
Device file /dev/oss/sblive0/mix0, Legacy device /dev/mixer0
Priority: 2
Caps:
Device handle: OSS-PCI-mx01
Device priority: 2
Audio devices
SB Audigy2 main /dev/oss/sblive0/pcm0 (device index 0)
Legacy device /dev/dsp0
Caps: DUPLEX TRIGGER MMAP
Modes: IN/OUT
Engine 1: 0/SB Audigy2 main
Busy (IN/OUT) by PID 2715 / jackd label 'jackd'
Engine 2: 6/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 7/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 8/SB Audigy2 main (VMIX0)
Available for use
Engine 5: 9/SB Audigy2 main (VMIX0)
Available for use
Engine 6: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 7: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 8: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 9: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000418):
AFMT_U8 - 8 bit unsigned
AFMT_S16_LE - 16 bit signed little endian
AFMT_AC3 - AC3 (Dolby Digital) encoded audio
Device handle: OSS-PCI-au01
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,24000,32000,44100,48000)
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 front out /dev/oss/sblive0/pcm1 (device index 1)
Legacy device /dev/dsp1
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 1/SB Audigy2 front out
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000418):
AFMT_U8 - 8 bit unsigned
AFMT_S16_LE - 16 bit signed little endian
AFMT_AC3 - AC3 (Dolby Digital) encoded audio
Device handle: OSS-PCI-au02
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,24000,32000,44100,48000)
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 side out /dev/oss/sblive0/pcm2 (device index 2)
Legacy device /dev/dsp2
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 2/SB Audigy2 side out
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000418):
AFMT_U8 - 8 bit unsigned
AFMT_S16_LE - 16 bit signed little endian
AFMT_AC3 - AC3 (Dolby Digital) encoded audio
Device handle: OSS-PCI-au03
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,24000,32000,44100,48000)
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 center/lfe out /dev/oss/sblive0/pcm3 (device index 3)
Legacy device /dev/dsp3
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 3/SB Audigy2 center/lfe out
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000418):
AFMT_U8 - 8 bit unsigned
AFMT_S16_LE - 16 bit signed little endian
AFMT_AC3 - AC3 (Dolby Digital) encoded audio
Device handle: OSS-PCI-au04
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,24000,32000,44100,48000)
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 raw S/PDIF (output only) /dev/oss/sblive0/pcm4 (device index 4)
Legacy device /dev/dsp4
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 4/SB Audigy2 raw S/PDIF (output only)
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000418):
AFMT_U8 - 8 bit unsigned
AFMT_S16_LE - 16 bit signed little endian
AFMT_AC3 - AC3 (Dolby Digital) encoded audio
Device handle: OSS-PCI-au05
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,24000,32000,44100,48000)
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 5.1 output device /dev/oss/sblive0/pcm5 (device index 5)
Legacy device /dev/dsp5
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 5/SB Audigy2 5.1 output device
Available for use
Input formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Output formats (0x00000010):
AFMT_S16_LE - 16 bit signed little endian
Device handle: OSS-PCI-au06
Related mixer dev: -1
Sample rate source: 1
Preferred channel configuration: MULTICH
Supported number of channels (min - max): 2 - 6
Native sample rates (min - max): 8000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm0 (device index 6)
Legacy device /dev/dsp6
Caps: DUPLEX TRIGGER MMAP VIRTUAL
Modes: IN/OUT
Engine 1: 6/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 7/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 8/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 9/SB Audigy2 main (VMIX0)
Available for use
Engine 5: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 6: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 7: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 8: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au01
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm1 (device index 7)
Legacy device /dev/dsp7
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 7/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 8/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 9/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 5: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 6: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 7: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au02
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm2 (device index 8)
Legacy device /dev/dsp8
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 8/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 9/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 5: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 6: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au03
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm3 (device index 9)
Legacy device /dev/dsp9
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 9/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 5: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au04
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm4 (device index 10)
Legacy device /dev/dsp10
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 10/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 4: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au05
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm5 (device index 11)
Legacy device /dev/dsp11
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 11/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 3: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au06
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm6 (device index 12)
Legacy device /dev/dsp12
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 12/SB Audigy2 main (VMIX0)
Available for use
Engine 2: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au07
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
SB Audigy2 main (VMIX0) /dev/oss/vmix0/pcm7 (device index 13)
Legacy device /dev/dsp13
Caps: DUPLEX TRIGGER MMAP VIRTUAL SHADOW HIDDEN
Modes: IN/OUT
Engine 1: 13/SB Audigy2 main (VMIX0)
Available for use
Input formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Output formats (0x00005010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_FLOAT - Single precision floating point (native endianess)
Device handle: vmix0-au08
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: Not indicated
Supported number of channels (min - max): 2 - 2
Native sample rates (min - max): 48000 - 48000
HW Type: Not indicated.
Minimum latency: Not indicated
Code: Select all
[mixx941@amd645200:~]% cat /dev/sndstat
OSS 4.0 (b1015/200803240216) (C) 4Front Technologies 1996-2008
This OSS version will expire after: Oct 2008
Kernel: FreeBSD 7.0-STABLE #8: Mon May 5 14:17:43 CDT 2008
mixx941@amd645200.localhost:/usr/obj/usr/src/sys/AMD645200
Audio devices:
0: SB Audigy2 main (DUPLEX)
Engine 1 opened INOUT by jackd/2715 @ 48000/48000 Hz Fragment: 1024/192000 (5.3 msec)
1: SB Audigy2 front out (OUTPUT)
2: SB Audigy2 side out (OUTPUT)
3: SB Audigy2 center/lfe out (OUTPUT)
4: SB Audigy2 raw S/PDIF (output only) (OUTPUT)
5: SB Audigy2 5.1 output device (OUTPUT)
6: SB Audigy2 main (VMIX0) (DUPLEX)
7: SB Audigy2 main (VMIX0) (DUPLEX)
8: SB Audigy2 main (VMIX0) (DUPLEX)
9: SB Audigy2 main (VMIX0) (DUPLEX)
10: SB Audigy2 main (VMIX0) (DUPLEX)
11: SB Audigy2 main (VMIX0) (DUPLEX)
12: SB Audigy2 main (VMIX0) (DUPLEX)
13: SB Audigy2 main (VMIX0) (DUPLEX)
Mixers:
0: SB Audigy2 (STAC9721)
History:
/dev/oss/sblive0/pcm0.00: pid 1728 cmd 'jackd' IN OUT 1888 underruns 4 overruns
/dev/oss/sblive0/pcm0.00: pid 2587 cmd 'jackd' IN OUT 273 underruns
/dev/oss/sblive0/pcm0.00: pid 2596 cmd 'jackd' IN OUT 33 underruns
/dev/oss/sblive0/pcm0.00: pid 2631 cmd 'jackd' IN OUT 1511 underruns 2 overruns