DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st January 2014
angryfirelord angryfirelord is offline
Port Guard
 
Join Date: Jul 2008
Posts: 20
Thanked 0 Times in 0 Posts
Default Sound delay when playing 3D games

With the advent of KMS support, I've been trying out some 3D apps that I normally play on other operating system. To my surprise, they work quite well. However, I've noticed that there tends to be a delay between events. For instance, in bzflag, when the tank jumps or fires a bullet, it emits a sound to that event. Normally, it's supposed to be instantaneous, but instead there seems to be a quarter to half second lag.

Someone else also demonstrated it on OpenArena. The delay is not quite as noticeable there, but I can still detect it: http://www.youtube.com/watch?v=O5SPnCAQIug

Here's my output from audioctl:
Code:
$ audioctl -f /dev/audio
name=HD-Audio
version=1.0
config=azalia1
encodings=slinear_le:16:2:1,slinear_le:20:4:1,slinear_le:24:4:1
properties=full_duplex,independent
full_duplex=0
fullduplex=0
blocksize=9600
hiwat=6
lowat=4
output_muted=0
monitor_gain=0
mode=play
play.rate=48000
play.channels=2
play.precision=16
play.bps=2
play.msb=1
play.encoding=slinear_le
play.gain=126
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=0
play.samples=0
play.eof=0
play.pause=0
play.error=0
play.waiting=0
play.open=1
play.active=0
play.buffer_size=65536
play.block_size=9600
play.errors=0
record.rate=48000
record.channels=2
record.precision=16
record.bps=2
record.msb=1
record.encoding=slinear_le
record.gain=120
record.balance=32
record.port=0x0
record.avail_ports=0x0
record.seek=0
record.samples=0
record.eof=0
record.pause=0
record.error=0
record.waiting=0
record.open=1
record.active=0
record.buffer_size=65536
record.block_size=9600
record.errors=0
Additional output from mixerctl:
Code:
$ mixerctl
inputs.dac-0:1=126,126
inputs.dac-4:5=126,126
inputs.dac-2:3=126,126
record.adc-0:1_mute=off
record.adc-0:1=120,120
record.adc-2:3_mute=off
record.adc-2:3=120,120
inputs.mix_source=mic,mic2,line-in,hp,beep,line
inputs.mix_mic=120,120
inputs.mix_mic2=120,120
inputs.mix_line-in=120,120
inputs.mix_hp=120,120
inputs.mix_beep=120,120
inputs.mix_line=120,120
inputs.mix2_source=dac-0:1,mix
inputs.mix3_source=dac-4:5,mix
inputs.mix4_source=dac-2:3,mix
outputs.line_source=mix2
outputs.line_mute=off
outputs.line_dir=output
outputs.line_boost=off
outputs.line_eapd=on
outputs.mic_source=mix4
outputs.mic_mute=off
inputs.mic=85,85
outputs.mic_dir=input-vr80
outputs.mic2_source=mix2
outputs.mic2_mute=off
inputs.mic2=85,85
outputs.mic2_dir=input-vr80
outputs.mic2_boost=off
outputs.line-in_source=mix3
outputs.line-in_mute=off
outputs.line-in_dir=input
outputs.hp_source=mix2
outputs.hp_mute=off
inputs.hp=85,85
outputs.hp_dir=output
outputs.hp_boost=off
outputs.SPDIF_source=dig-dac-0:1
record.adc-2:3_source=mic,mic2,line-in,hp,beep,line,mix
record.adc-0:1_source=mic,mic2,line-in,hp,beep,line,mix
outputs.line_sense=plugged
outputs.mic_sense=unplugged
outputs.mic2_sense=unplugged
outputs.line-in_sense=unplugged
outputs.hp_sense=unplugged
outputs.master=126,126
outputs.master.mute=off
outputs.master.slaves=dac-0:1,line,hp
record.volume=120,120
record.volume.mute=off
record.volume.slaves=adc-0:1,adc-2:3
outputs.mode=analog
I suspect it's a latency issue, but I'm not really sure what to adjust. I'm running this on the -CURRENT snapshot.
Code:
$ uname -a
OpenBSD polaris.localdomain 5.4 GENERIC.MP#236 amd64
Reply With Quote
  #2   (View Single Post)  
Old 8th January 2014
backrow backrow is offline
Real Name: Anthony J. Bentley
Shell Scout
 
Join Date: Jul 2009
Location: Albuquerque, NM
Posts: 116
Thanked 10 Times in 4 Posts
Default

From sndiod(1):

Quote:
-b nframes

The buffer size of the audio device in frames. A frame consists of one sample for each channel in the stream. This is the number of frames that will be buffered before being played and thus controls the playback latency. The default is 7680 or twice the block size (-z), if the block size is set.
I used to set this (and maybe -z, I don’t remember) to a low value in order to get rid of audio lag in games, but stopped due to getting lots of audio stuttering in mplayer. I’m not really sure how to intelligently choose the values so that doesn’t happen. You may want to ask ratchov@ (the main audio developer) for advice.
__________________
Many thanks to the forum regulars who put time and effort into helping others solve their problems.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
your 3 favorite games welkin FreeBSD Ports and Packages 17 5th June 2010 08:26 PM
how to remove games and mail in netbsd dsp NetBSD Installation and Upgrading 10 16th June 2009 07:51 PM
OSS , playing a sound via command line.. scotsman FreeBSD General 7 29th August 2008 08:01 PM
Problem with no sound in games troberts FreeBSD General 9 21st July 2008 08:53 PM
CrossOver Games for BSD udragon FreeBSD General 6 27th May 2008 08:59 AM


All times are GMT. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick