Lag with OSS
Moderator: General Mods
Lag with OSS
I recently tried switching to 4front's OSS from ALSA, mostly because the program I was making used the OSS library and I thought it best to use the real thing. It sounds great and all, seems to even have a bit less noise than ALSA, and the volume adjustments seem to work better (no overdrive) but the big problem is there seems to be a good half a second delay in the audio. I tried looking on the internet for solutions but I couldn't find any, but this message board has a lot of big fans of OSS so this would probably be my best bet.
System configuration:
Gentoo Linux 2008.0 using kernel 2.6.25-gentoo-r6
Intel Core 2 Duo E6750 @2.66Ghz
Asus P5K-e AP motherboard
4 gig DDR-800 RAM
Creative Sound Blaster Live w\o livedrive
I tested with bsnes, wine and gmeplay. bsnes seems to have the least delay of them all but still very noticeable.
System configuration:
Gentoo Linux 2008.0 using kernel 2.6.25-gentoo-r6
Intel Core 2 Duo E6750 @2.66Ghz
Asus P5K-e AP motherboard
4 gig DDR-800 RAM
Creative Sound Blaster Live w\o livedrive
I tested with bsnes, wine and gmeplay. bsnes seems to have the least delay of them all but still very noticeable.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Make sure all your apps are set to use the OSS API.
Also make sure the wrapper APIs (SDL, libao, OpenAL) all use OSS directly. Otherwise there will be more of a lag.
Also make sure the wrapper APIs (SDL, libao, OpenAL) all use OSS directly. Otherwise there will be more of a lag.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Hmm, that's strange, I use OSS4 and sound on my system is generally perfect.
System configuration:
OS ~ Ubuntu 8.04.1, Linux 2.6.24-19-generic #1 SMP, i686
CPU ~ Pentium 4 Prescott 640 @ 3.2GHz
Mobo ~ Dell 0WG261
Memory ~ 1024MiB (512MiB x 2, Infineon, DDR2 @ 266MHz)
Sound ~ Intel 82801G (ICH7) HDA
System configuration:
OS ~ Ubuntu 8.04.1, Linux 2.6.24-19-generic #1 SMP, i686
CPU ~ Pentium 4 Prescott 640 @ 3.2GHz
Mobo ~ Dell 0WG261
Memory ~ 1024MiB (512MiB x 2, Infineon, DDR2 @ 266MHz)
Sound ~ Intel 82801G (ICH7) HDA
Last edited by ZH/Franky on Wed Sep 17, 2008 7:21 pm, edited 1 time in total.
Does this have to do with the Creative Sound Blaster? (can't remember where I read that from...)
I also have a Creative Sound Blaster Live! card and the sound in general have some delay with OSS.
On another PC with a Cirrus Logic CS, there is no problem
On both systems: Debian Lenny; Ubuntu 8.04, AMD Athlon 2600+; AMD Athlon Thunderbird, Creative Labs SB Live! EMU10k1; Cirrus Logic CS 4614/22/24/30
I also have a Creative Sound Blaster Live! card and the sound in general have some delay with OSS.
On another PC with a Cirrus Logic CS, there is no problem
On both systems: Debian Lenny; Ubuntu 8.04, AMD Athlon 2600+; AMD Athlon Thunderbird, Creative Labs SB Live! EMU10k1; Cirrus Logic CS 4614/22/24/30
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
I have an SB Live! myself. It worked fine for me with OSS except when the app uses a large buffer. OSS 4 also makes better usage of smaller buffers than OSS 3 did. Which may explain why bsnes sounds the best for you, I made it use a smaller buffer.
Tell me how ZSNES with OSS sounds, that might help narrow it down.
Tell me how ZSNES with OSS sounds, that might help narrow it down.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
OK, I managed to disable vmix on OSS and the latency I experienced is now back to something normal.
Quick howto disable vmix:Uncomment OR add this lineand issue as root
I tested with ZSNES 1.51b (both i586 binary and src) and bsnes, mplayer, ...
Hope this will help you a bit..
Quick howto disable vmix:
Code: Select all
nano /usr/lib/oss/conf/osscore.conf
Code: Select all
vmix_disabled=1
Code: Select all
# soundoff && soundon
Code: Select all
./zsnes -ad oss
Audio Opened.
Driver: OSS audio driver output
Channels: 2
Rate: 32000
Oh sweet, it worked. Thanks a lot for all the help, everyone. I imagine this should be noted in some audio thread somewhere, since I'm probably not the first or last to encounter this problem.
EDIT: Is there any way to utilize my sound card's hardware mixing so I don't have problems with things mot working if something has the sound card open?
EDIT: Is there any way to utilize my sound card's hardware mixing so I don't have problems with things mot working if something has the sound card open?
Here's another (better) way to do this:
- Go to /usr/lib/oss/etc and open 'installed_drivers' in a text editor.
(it's a good idea to make a backup copy of it first,before editing)
- Remove all lines with listed devices (USB audio,VMix,etc.),except for that of your main soundcard/audio interface and save (overwrite) the file
- Stop and restart OSS (needs root permission)
- Open a terminal and start 'ossxmix'. You can see that now your Creative soundcard is using the hardware mixer
- Go to /usr/lib/oss/etc and open 'installed_drivers' in a text editor.
(it's a good idea to make a backup copy of it first,before editing)
- Remove all lines with listed devices (USB audio,VMix,etc.),except for that of your main soundcard/audio interface and save (overwrite) the file
- Stop and restart OSS (needs root permission)
- Open a terminal and start 'ossxmix'. You can see that now your Creative soundcard is using the hardware mixer
[i]Have a nice kick in da nutz[/i] @~@* c//
Sorry Nach, but the latency is still there with zsnes 1.51b (if vmix is enabled in OSS).Nach wrote:I have an SB Live! myself. It worked fine for me with OSS except when the app uses a large buffer. OSS 4 also makes better usage of smaller buffers than OSS 3 did. Which may explain why bsnes sounds the best for you, I made it use a smaller buffer.
Tell me how ZSNES with OSS sounds, that might help narrow it down.
Some more informations Debian Lenny up-to-date, Custom 2.6.26 kernel, Sound Blaster Live with MIDI Interface, (not really useful but still)ATi Radeon 9200 Pro (AGP Port)
Code: Select all
$ cat '/boot/config-2.6.26-custom' | grep _OSS
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
# lspci -vvvs 01:07
01:07.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07)
Subsystem: Creative Labs Device 8064
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 32 (500ns min, 5000ns max)
Interrupt: pin A routed to IRQ 5
Region 0: I/O ports at c000 [size=32]
Capabilities: [dc] Power Management version 1
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: sblive
01:07.1 Input device controller: Creative Labs SB Live! Game Port (rev 07)
Subsystem: Creative Labs Device 0020
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 32
Region 0: I/O ports at c400 [size=8]
Capabilities: [dc] Power Management version 1
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: Emu10k1_gameport
Kernel modules: emu10k1-gp
# lspci -vvvs 02:00
02:00.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200 PRO] (rev 01)
Subsystem: PC Partner Limited Device 7c13
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 32 (2000ns min), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 5
Region 0: Memory at d0000000 (32-bit, prefetchable) [size=128M]
Region 1: I/O ports at d000 [size=256]
Region 2: Memory at e1000000 (32-bit, non-prefetchable) [size=64K]
[virtual] Expansion ROM at e0000000 [disabled] [size=128K]
Capabilities: [58] AGP version 3.0
Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3+ Rate=x4,x8
Command: RQ=32 ArqSz=2 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x8
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Kernel modules: radeonfb
02:00.1 Display controller: ATI Technologies Inc RV280 [Radeon 9200 PRO] (Secondary) (rev 01)
Subsystem: PC Partner Limited Device 7c12
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Region 0: Memory at d8000000 (32-bit, prefetchable) [disabled] [size=128M]
Region 1: Memory at e1010000 (32-bit, non-prefetchable) [disabled] [size=64K]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
OSS v4.0-1016 installed from the deb provided here: www.opensound.com/
And I can't think of any other infos right now.
Ask me if I can be of any help :)
EDIT: wanted to add an important information: The latency I have seems to be system-wide, not zsnes specific.
OK, got hardware mixing to work.
I did what tukuyomi said to do to turn off vmix, then I opened sblive.conf in the same directory and changed
to
. You can probably mess with that value to figure out the actual maximum but I just picked the lowest allowed value which seemed safe.
I did what tukuyomi said to do to turn off vmix, then I opened sblive.conf in the same directory and changed
Code: Select all
#sblive_devices = 0
Code: Select all
sblive_devices = 5
I did what paulguy said, but when I attempt to run a second application, I get the '/dev/dsp is busy' message :/
About the system-wide audio latency, I can't seem to find anything on their forums :/
About the system-wide audio latency, I can't seem to find anything on their forums :/
That comment in this code block is interesting...
http://manuals.opensound.com/sources/sblive.c.html
Can anyone tell me more about it?
Code: Select all
if (devc->card_type == SB_LIVE)
{
Do not enable vmix by default on Live! It would cause enormous latencies because emu10k1 doesn't have working full/half buffer DMA interrupts.
adev->vmix_flags = VMIX_MULTIFRAG | VMIX_SKIP;
adev->max_intrate = 50;
adev->min_block = 4096;
}
else
{
adev->max_fragments = 2;
}
Can anyone tell me more about it?
Nach, Which driver do you use with your SBLive? sblive or emu10k1x (http://manuals.opensound.com/sources/emu10k1x.c.html)I have an SB Live! myself.
emu10k1x.....Creative Labs 10K1X (DELL SBLIVE 5.1 OEM)
sbive..........Sound Blaster: Live/MP3/Platinum, Audigy, Audigy2, Audigy2ZS, Audigy2-Value
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
It's emu10k something, my SBLive! is currently in a computer which is under going reconstruction, so I can't check exactly which one, but I do recall always seeing emu10k something being loaded.tukuyomi wrote:Nach, Which driver do you use with your SBLive?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Well, I don't have anything from dell, and it has 5 jacks on the back and a gameport.paulguy wrote:Emu10k1x was for a cheapo piece of shit Dell ripoff which is similar but modified to be cheaper. sblive is most likely what you want.
Was marked as the original SB Live! Value (didn't come with games or the front audio panel), and it wasn't that later piece of junk card.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding