9.10 / OSS4 delay/lag in game

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

9.10 / OSS4 delay/lag in game

Postby sirius lee » Sun Feb 14, 2010 8:11 pm

OK, Im a noob ... so please take it easy on me.

I was able to get OSS4 working with ubuntu 9.10. Everything went well on a fresh install, and even got my system sounds working w/o pulse.

I removed Alsa and pulse, and installed OSS so that I could run a few games and TeamSpeak at the same time. Under Alsa and pulse, I could never get teamspeak to run simultaneously with a game app.

Under OSS though, I seem to have a delay in games ... q2, q3, q4, et, doom, etc .... all produce an almost perfect 1 second lag from the actual event, to the sound being played.

On the same machine, with 9.10 alsa/pulse/jack I have no audio lag, but obviously can not run TS while running a game at the same time.

If anyone can help me out - perhaps there are a few settings within OSS that can be tweaked or something .....
sirius lee
New Member
 
Posts: 3
Joined: Sun Feb 14, 2010 8:00 pm

Re: 9.10 / OSS4 delay/lag in game

Postby cesium » Sun Feb 14, 2010 11:58 pm

Can you paste output of "ossinfo -v3" and "ossmix -a"? It might be helpful to know which soundcard this is... Also, I hope these games are set up to use OSS natively rather than go via some ALSA emulation or something. This and this might be helpful here.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: 9.10 / OSS4 delay/lag in game

Postby sirius lee » Mon Feb 15, 2010 3:15 am

Im not sure about the second link you posted ... as far as my own ability to understand it goes .... but the first does mention some OS ports of OSSv4 don't support mmap() ... whether that applies to me or not, i dunno..... since there is no audio lag in local or streaming video, I'm guessing it might just be that everything i play, uses the Quake engine

sound card is an old sb live card, and i also have an m-audio delta 44, that works well under 9.10 with alsa/pulse and jack through audacity.

I'll apologize in advance for the long output, I couldnt find a quick place to host the text files and just link them.

output OSSMIX -a ::

Selected mixer 0/M Audio Delta 44
Known controls are:
mon.out1/2 [<leftvol>:<rightvol>] (currently 135.0:135.0 dB)
mon.out3/4 [<leftvol>:<rightvol>] (currently 135.0:135.0 dB)
mon.in1/2 [<leftvol>:<rightvol>] (currently 135.0:135.0 dB)
mon.in3/4 [<leftvol>:<rightvol>] (currently 135.0:135.0 dB)
route.out1/2 <DMA|MONITOR|IN1/2|IN3/4> (currently DMA)
route.out3/4 <DMA|IN1/2|IN3/4> (currently DMA)
gain.out1/2 <+4DB|CONSUMER|-10DB> (currently +4DB)
gain.out3/4 <+4DB|CONSUMER|-10DB> (currently +4DB)
gain.in1/2 <+4DB|CONSUMER|-10DB> (currently +4DB)
gain.in3/4 <+4DB|CONSUMER|-10DB> (currently +4DB)
envy24.rate <8000|9600|11025|12000|16000|22050|24000|32000|44100|48000|88200|96000> (currently 48000)
envy24.ratelock ON|OFF (currently ON)
envy24.actrate <decimal value> (currently 48000) (Read-only)

Selected mixer 1/SB Live (STAC9721)
Known controls are:
line [<leftvol>:<rightvol>] (currently 32:32)
line.rec ON|OFF (currently OFF)
mic <monovol> (currently 0)
mic.rec ON|OFF (currently ON)
cd [<leftvol>:<rightvol>] (currently 75:75)
cd.rec ON|OFF (currently OFF)
igain [<leftvol>:<rightvol>] (currently 75:75)
aux1 [<leftvol>:<rightvol>] (currently 32:32)
aux1.rec ON|OFF (currently OFF)
phone [<leftvol>:<rightvol>] (currently 0:0)
phone.rec ON|OFF (currently OFF)
autorese ON|OFF (currently ON)
spkmode <FRONT|SURR|FRONT+SURR|DISCRETE> (currently FRONT+SURR)
pcm.main <monovol> (currently 100)
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-src <Fast|High|OFF> (currently Fast)
vmix0-outvol <monovol> (currently 22.4 dB)
vmix0-invol <monovol> (currently 25.0 dB)
vmix0.pcm8 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm9 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm10 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm11 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
pcm2 [<leftvol>:<rightvol>] (currently 100:100)
vol [<leftvol>:<rightvol>] (currently 75:75)
equalizer.prescale <monovol> (currently 100)
equalizer.lo <monovol> (currently 128)
equalizer.mid <monovol> (currently 128)
equalizer.hi <monovol> (currently 128)
equalizer.xhi <monovol> (currently 128)
equalizer.bypass ON|OFF (currently OFF)
front.spdif <monovol> (currently 100)
front.digcd <monovol> (currently 100)
front.ac97 <monovol> (currently 0)
front.pcm <monovol> (currently 100)
front.aux <monovol> (currently 100)
front.vol [<leftvol>:<rightvol>] (currently 100:100)
surr.spdif <monovol> (currently 0)
surr.digcd <monovol> (currently 0)
surr.ac97 <monovol> (currently 0)
surr.pcm <monovol> (currently 100)
surr.aux <monovol> (currently 0)
surr.vol [<leftvol>:<rightvol>] (currently 100:100)
record.spdif <monovol> (currently 100)
record.digcd <monovol> (currently 100)
record.ac97 <monovol> (currently 87)
record.pcm <monovol> (currently 50)
record.aux <monovol> (currently 100)
record.vol [<leftvol>:<rightvol>] (currently 100:100)


output ossinfo -v3 ::

Version info: OSS 4.2 (b 2002/200911060735) (0x00040100) TRIAL
Platform: Linux/i686 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 (fig-desktop)

Number of audio devices: 12
Number of audio engines: 16
Number of MIDI devices: 1
Number of mixer devices: 2


Device objects
0: osscore0 OSS core services
1: oss_envy240 M Audio Delta 44 interrupts=14865 (14865)
2: oss_sblive0 SB Live interrupts=70252 (70252)
3: oss_usb0 USB audio core services

MIDI devices (/dev/midi*)
0: SB Live external MIDI (MIDI port 1 of device object 2)
Device file /dev/oss/oss_sblive0/mid0, Legacy device /dev/midi00
Modes: IN/OUT , Available for use
Caps:
Minimum latency: Not indicated
Device handle: PCI80401102-0000:02:05.0-md01


Mixer devices
0: M Audio Delta 44 (Mixer 0 of device object 1)
Device file /dev/oss/oss_envy240/mix0, Legacy device /dev/mixer0
Priority: 0
Caps:
Device handle: PCId6331412-0000:02:02.0-mx01
Device priority: 0

1: SB Live (STAC9721) (Mixer 0 of device object 2)
Device file /dev/oss/oss_sblive0/mix0, Legacy device /dev/mixer1
Priority: 2
Caps:
Device handle: PCI80401102-0000:02:05.0-mx01
Device priority: 2


Audio devices
M Audio Delta 44 out1/2 /dev/oss/oss_envy240/pcm0 (device index 0)
Legacy device /dev/dsp0
Caps: TRIGGER
Modes: OUTPUT
Out engine 1: 0/M Audio Delta 44 out1/2
Available for use
Input formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Output formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au01
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: STEREO
Supported number of channels (min - max): 1 - 10
Native sample rates (min - max): 8000 - 96000 (8000,9600,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000)
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 out3/4 /dev/oss/oss_envy240/pcm1 (device index 1)
Legacy device /dev/dsp1
Caps: TRIGGER
Modes: OUTPUT
Out engine 1: 1/M Audio Delta 44 out3/4
Available for use
Input formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Output formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au02
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: STEREO
Supported number of channels (min - max): 1 - 8
Native sample rates (min - max): 8000 - 96000 (8000,9600,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000)
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 in1/2 /dev/oss/oss_envy240/pcmin0 (device index 2)
Legacy device /dev/dsp2
Caps: TRIGGER
Modes: INPUT
In engine 1: 2/M Audio Delta 44 in1/2
Available for use
Input formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Output formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au03
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: STEREO
Supported number of channels (min - max): 1 - 12
Native sample rates (min - max): 8000 - 44100 (8000,9600,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000)
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 in3/4 /dev/oss/oss_envy240/pcmin1 (device index 3)
Legacy device /dev/dsp3
Caps: TRIGGER
Modes: INPUT
In engine 1: 3/M Audio Delta 44 in3/4
Available for use
Input formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Output formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au04
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: STEREO
Supported number of channels (min - max): 1 - 10
Native sample rates (min - max): 8000 - 44100 (8000,9600,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000)
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 input from mon. mixer /dev/oss/oss_envy240/mon (device index 4)
Legacy device /dev/dsp4
Caps: TRIGGER
Modes: INPUT
In engine 1: 4/M Audio Delta 44 input from mon. mixer
Available for use
Input formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Output formats (0x00009010):
AFMT_S16_LE - 16 bit signed little endian
AFMT_S32_LE - 32 bit signed little endian
AFMT_S24_LE - 24/32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au05
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: STEREO
Supported number of channels (min - max): 1 - 2
Native sample rates (min - max): 8000 - 44100 (8000,9600,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000)
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 (all outputs) /dev/oss/oss_envy240/10ch_out (device index 5)
Legacy device /dev/dsp5
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 5/M Audio Delta 44 (all outputs)
Available for use
Input formats (0x00001000):
AFMT_S32_LE - 32 bit signed little endian
Output formats (0x00001000):
AFMT_S32_LE - 32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au06
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: MULTICH
Supported number of channels (min - max): 10 - 10
Native sample rates (min - max): 8000 - 96000
HW Type: Not indicated.
Minimum latency: Not indicated

M Audio Delta 44 (all inputs) /dev/oss/oss_envy240/12ch_in (device index 6)
Legacy device /dev/dsp6
Caps: TRIGGER MMAP
Modes: INPUT
In engine 1: 6/M Audio Delta 44 (all inputs)
Available for use
Input formats (0x00001000):
AFMT_S32_LE - 32 bit signed little endian
Output formats (0x00001000):
AFMT_S32_LE - 32 bit signed little endian
Device handle: PCId6331412-0000:02:02.0-au07
Related mixer dev: 0
Sample rate source: 0
Preferred channel configuration: MULTICH
Supported number of channels (min - max): 12 - 12
Native sample rates (min - max): 8000 - 96000
HW Type: Not indicated.
Minimum latency: Not indicated

SB Live main /dev/oss/oss_sblive0/pcm0 (device index 7)
Legacy device /dev/dsp7
Caps: DUPLEX TRIGGER MMAP
Modes: IN/OUT
Engine 1: 7/SB Live main
Available for use
Engine 2: 8/SB Live main (vmix)
Available for use
Engine 3: 9/SB Live main (vmix)
Available for use
Engine 4: 10/SB Live main (vmix)
Available for use
Engine 5: 11/SB Live main (vmix)
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: PCI80401102-0000:02:05.0-au01
Related mixer dev: 1
Sample rate source: 7
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 Live front out /dev/oss/oss_sblive0/pcm1 (device index 8)
Legacy device /dev/dsp8
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 12/SB Live 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: PCI80401102-0000:02:05.0-au02
Related mixer dev: 1
Sample rate source: 7
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 Live side out /dev/oss/oss_sblive0/pcm2 (device index 9)
Legacy device /dev/dsp9
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 13/SB Live 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: PCI80401102-0000:02:05.0-au03
Related mixer dev: 1
Sample rate source: 7
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 Live center/lfe out /dev/oss/oss_sblive0/pcm3 (device index 10)
Legacy device /dev/dsp10
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 14/SB Live 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: PCI80401102-0000:02:05.0-au04
Related mixer dev: 1
Sample rate source: 7
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 Live 5.1 output device /dev/oss/oss_sblive0/pcm4 (device index 11)
Legacy device /dev/dsp11
Caps: TRIGGER MMAP
Modes: OUTPUT
Out engine 1: 15/SB Live 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: PCI80401102-0000:02:05.0-au05
Related mixer dev: -1
Sample rate source: 12
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


Nodes
/dev/dsp -> /dev/oss/oss_sblive0/pcm0
/dev/dsp_in -> /dev/oss/oss_envy240/pcmin0
/dev/dsp_out -> /dev/oss/oss_envy240/pcm0
/dev/dsp_ac3 -> /dev/oss/oss_sblive0/pcm0
/dev/dsp_mmap -> /dev/oss/oss_sblive0/pcm0
/dev/dsp_multich -> /dev/oss/oss_envy240/pcm0
sirius lee
New Member
 
Posts: 3
Joined: Sun Feb 14, 2010 8:00 pm

Re: 9.10 / OSS4 delay/lag in game

Postby cesium » Mon Feb 15, 2010 9:49 pm

A) I should have asked this earlier, but does the latency appear when you play these games in general, or only when teamspeak is run simultaneously?

B) What happens if you set "vmix0-src to OFF"? ("ossmix vmix0-src OFF"). Does it work better? (If not, I suggest reseting vmix0-src back to Fast or High).

C) The Linux port of OSS4 support mmap(), so that's less of a problem. However, the solution linked there (a wrapper to use SDL libraries) might work better with OSS anyhow, so you may want to try it. Note that SDL requires libsdl1.2debian-oss package to output via OSS.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: 9.10 / OSS4 delay/lag in game

Postby sirius lee » Tue Feb 16, 2010 7:46 pm

Latency is in-game, without TS running.

And if i set ossmix -d1 vmix0-src OFF ... that _does_ correct the lag problem, (thanks for the suggestion) but apparently doesn't allow both (q3 + teamspeak)

I've tried several vmix settings/combinations, but cant get both q3 and ts together, without sound latency in the games .... but it's a start.

I'll have to read up a bit on the SDL wrapper, and see how that works out


thanks a bunch for the suggestions. at least Im heading in the right direction.
sirius lee
New Member
 
Posts: 3
Joined: Sun Feb 14, 2010 8:00 pm

Re: 9.10 / OSS4 delay/lag in game

Postby cesium » Tue Feb 16, 2010 7:51 pm

I think teamspeak may work with vmix0-src set to OFF if it's set to output at the same rate as vmix uses to "talk" to the card (default: 48K). "sudo vmixctl" command can be used to change the rate used by vmix. There probably is a TS knob somewhere to change this... (Note that for regular use, it's better to have vmix0-src at "Fast" or "High"). Another possible solution is the SDL wrapper approach...
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: 9.10 / OSS4 delay/lag in game

Postby Fistandantilus » Sat May 22, 2010 12:56 am

I have similar problem (sound delays/lags (+0.5-2seconds) ) with my "SBLive 5.1 Pla IR" with buildin HDA codec - i have no delays.
Seems to be that lags happens in all system application
Ubuntu 10.04 /OSSv4 2002 builded from mercurial
Fistandantilus
New Member
 
Posts: 2
Joined: Sat May 22, 2010 12:42 am
Location: Istar!

Re: 9.10 / OSS4 delay/lag in game

Postby Fistandantilus » Thu Jun 24, 2010 1:31 pm

someone fix that problem? Or may be in 2003 release that bug fixed?
Fistandantilus
New Member
 
Posts: 2
Joined: Sat May 22, 2010 12:42 am
Location: Istar!

Re: 9.10 / OSS4 delay/lag in game

Postby cesium » Thu Jun 24, 2010 4:34 pm

Fistandantilus, maybe you can try "sudo vmixctl rate /dev/dsp 44100" command...
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am


Return to Linux

Who is online

Users browsing this forum: Google [Bot] and 1 guest