Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No sound in DOOM3
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
blueworm
l33t
l33t


Joined: 09 May 2003
Posts: 962

PostPosted: Thu Oct 07, 2004 5:19 am    Post subject: Reply with quote

I'm winning 2-3. Sound wise.
Works on athlon64 system (see sig)
Works on nforce2 system Asus A7N8X on-board audio using alsa intel8x0.
Does NOT work on T-bird ES1371 on-board audio.

The nforce2 system is using a 2.6.8.1 vanilla kernel everything compilled into the kernel. Did'nt do anything wierd, just works!
Back to top
View user's profile Send private message
paulisdead
Guru
Guru


Joined: 10 Apr 2002
Posts: 510
Location: Seattle, WA

PostPosted: Thu Oct 07, 2004 5:30 am    Post subject: Reply with quote

OK I got a fix, thanks to an anonymous post from Linuxgames http://www.linuxgames.com/news/feedback.php?identiferID=6962&action=flatview

here's the post, since it's sure to be buried on that site fast

Quote:
I see I'm not the only one to get this error:

WARNING: ioctl SNDCTL_DSP_SPEED failed to get the requested frequency 44100, got 44101



I don't have a sound server, and use pure OSS (no alsa emulation). Apparently it is caused by low-quality sound chipset, or bad drivers, that are not able to provide the requested frequency (due to limitations or round-off errors), and return the closest frequency they can handle. It should not be really an error, but Doom3 decides that for 1Hz of difference, it won't play sound :/

I propose a... radical fix: patch the doom3 binary so that it doesn't compare the returned value with the expected one, and act as if it was OK.

I don't assume any problem this could cause to your system !!

You will need a hexadecimal editor for that; I used "hexcurse" (text-mode).
- You should know where you installed doom3, and go to this directory.
- DO A BACKUP of the original "doom.x86" binary in a safe place elsewhere.
- You may need to be root to modify the file. In this case you should better do a copy of the file as a normal user, edit it as described with this user, and overwrite it back as root when you are done.Less chance to do errors as root...
- open the file with "hexcurse doom.x86"
- Go to the byte to modify by typing "Ctrl-G" and entering the address ; for doom3, it is address 001BED1B ; for doom3-demo, it is 001BE3FB.
- Modifiy the "74" under the cursor to "EB".
- Save (Ctrl-S) and quit (Ctrl-Q)
The md5sum of the modified binary is now:
a4b9c37eef2ad5142b9c88f0447bb52a for the complete version
3cb21789bd262ef6f4b451cce8559239 for the demo version.
If not, you made an error; restore the backup file and start again.

Now doom3 should ignore any difference in the frequency settings. It worked OK for me because I have only a 1Hz difference; if you have more, I don't know how it will behave...


For those interested/who want to be sure I didn't just install a virus in their binary :) here is the explanation:

I used "objdump -d doom.x86 > doom_disassembled.txt" to get the disassembled (machine instructions) version of the program. the SNDCTL_DSP_SPEED ioctl has for value 0xc0045002. There is only 1 occurence of this value in the code. Reading the disassembled output around leads to:


8206ce5: bf 02 50 04 c0 _______ mov $0xc0045002,%edi <-- SNDCTL_DSP_SPEED ioctl code
[... some more parameter passing ...]
8206d05: e8 1a 42 e4 ff _______ call 0x804af24 <-- call the ioctl function
8206d0a: 40 ________________ inc %eax
8206d0b: 0f 84 7e 02 00 00 ____ je 0x8206f8f <-- test if return value is -1 (error)
8206d11: 8b 4e 10 _______________ mov 0x10(%esi),%ecx
8206d14: 3b 8c 24 a4 00 00 00 _____ cmp 0xa4(%esp),%ecx <-- compare a passed parameter to a returned value (the 44100 Hz)
8206d1b: 74 24 __________________ je 0x8206d41 <-- if equal, continue code somewhere
[... else fall through the warning code and sound disabling ...]


My patch replace the test by an unconditionnal jump:

8206d1b: eb 24 _____ jmp 0x8206d41


which never cares about the comparison.

(Disclaimer: this "reverse-engineering" was done purely for interoperability purpose, so should be legal (at least here in Europe) )


THIS DOES WORK FOR ME! Thank you anonymous hacker.
_________________
"we should make it a law that all geeks have dates" - Linus
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Thu Oct 07, 2004 6:07 am    Post subject: Reply with quote

That's no good for me, the game complains it gets 48000.
Back to top
View user's profile Send private message
paulisdead
Guru
Guru


Joined: 10 Apr 2002
Posts: 510
Location: Seattle, WA

PostPosted: Thu Oct 07, 2004 6:27 am    Post subject: Reply with quote

IntergalacticWalrus wrote:
That's no good for me, the game complains it gets 48000.


Hmm I wonder if one of the other numerous fixes I've tried along the way worked with this fix, since mine used to complain that it was getting 48000 as well. Sound seemed fine when I ran the game.

Right now, I do have dxs_support=3 in my alsa config, and also had the old quake3 sound fix going too. About all I can think of, but I am running the 2.6.9-rc3 kernel which introduced a lot of alsa updates (I think it's the same version as the alsa ebuilds but could be more recent). I'm on the unstable branch of AMD64 using my nforce3s onboard sound.

*edit maybe I misunderstood you. Did you not even try it because you have 48000hz? I've got that as well, and this worked for me.
_________________
"we should make it a law that all geeks have dates" - Linus
Back to top
View user's profile Send private message
c0ma2k
n00b
n00b


Joined: 30 Sep 2002
Posts: 15
Location: Germany

PostPosted: Thu Oct 07, 2004 10:05 am    Post subject: Reply with quote

I can confirm that this binary patch works on my nForce 3 integrated sound, too. I also was getting the 48000 Hz error and thus was expecting at least some sound delays or skipping with 4kHz difference in sample rate, but didn't notice any of that.

You can relax and kick some demons' a**, IntergalacticWalrus. ;-)

Many thanks to the unknown disassembler and to paulisdead for finding this hack!
Back to top
View user's profile Send private message
SpoonMeiser
n00b
n00b


Joined: 25 Sep 2002
Posts: 62

PostPosted: Thu Oct 07, 2004 8:03 pm    Post subject: curiouser and curiouser Reply with quote

paulisdead wrote:
Using echo "doom 0 0 direct" > /proc/asound/card0/pcm0p/oss, and then starting doom up with "aoss -cla /usr/lib32/ ./doom" doesn't bomb out on sound, and actually says sound's initialized. However, now I get another error that prevents the game from starting altogether.


What's really insteresting, is that this has nothing to do with aoss! aoss basically adds the environment LD_PRELOAD=/usr/lib/libaoss.so, but since you're passing -c to exec, this is then ignored.

Test this by running; exec -c doom3

You'll see exactly the same results (although the xterm will then exit, so you might have to redirect to a file to see the results).

exec -c means execute with an empty environment. So what in the environment is causing this problem? Also, what in the environment then causes libGL not to be found?

*edit;
and easier way to see this, is:
Code:
env -i /usr/local/bin/doom3


*edit2;
further experimentation reveals that the environment required to get graphics to work are DISPLAY and HOME:
Code:
env -i DISPLAY=:0.0 HOME=/home/oj /usr/local/bin/doom3

but this then produces the same sound problem. I'm totally confused as to why this is, but I think I'm barking up the wrong tree here...


Last edited by SpoonMeiser on Thu Oct 07, 2004 8:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1319
Location: UK

PostPosted: Thu Oct 07, 2004 8:20 pm    Post subject: Reply with quote

hexpatchy thing worked a charm, those darn sloppy ID coders ;-) (that was a JOKE dont have a giant go at me for slagging off ID or anything)
Back to top
View user's profile Send private message
SpoonMeiser
n00b
n00b


Joined: 25 Sep 2002
Posts: 62

PostPosted: Thu Oct 07, 2004 8:40 pm    Post subject: Reply with quote

The problem with aoss on AMD64 is the incompatability with 32bit and 64bit. However, there is a masked package: emul-linux-x86-soundlibs

since all aoss does is LD_PRELOAD=/usr/lib/libaoss.so

You can try;
Code:

$ cd "/usr/local/games/doom3/"
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
$ LD_PRELOAD=/usr/lib32/libaoss.so ./doom.x86

The first 2 lines copied out of the doom3 script

This still didn't work though, although the error was interestingly different:
Code:
WARNING: failed to open sound device '/dev/dsp': Invalid argument
Back to top
View user's profile Send private message
tindalos
n00b
n00b


Joined: 26 Aug 2003
Posts: 5

PostPosted: Thu Oct 07, 2004 10:59 pm    Post subject: ALSA Reply with quote

I just edited ~/doom3/base/DoomConfig.cfg and altered this line
Code:
seta s_driver "oss"

changing it to
Code:
seta s_driver "alsa"

and sound started working great
Back to top
View user's profile Send private message
Ivan The Viking
Tux's lil' helper
Tux's lil' helper


Joined: 14 Apr 2003
Posts: 78
Location: Connecticut, USA

PostPosted: Fri Oct 08, 2004 3:24 am    Post subject: Reply with quote

The hex hackup above of changing some machine code also *fixed* my issue with getting any sound in doom3. I also was getting the lovely 48khz error, but now since it skips the check, the sound works.

My system is an Ahtlon XP 2800+ Overclocked a touch to ~2.35 GHZ on an MSI K7N2 Delta2 Platinum board running 2.6.8.1 Vanilla with the 1.6a alsa-drivers. This version of the Nforce2 chipsets with the CK8 sound "Card" has the same problem as the Nforce3 chipsets, that is, the onboard sound codecs actually run at 48khz, with no way that I can see to change it.

I changed the hex value and at first, the sound seems fine, but since it is playing them at 48khz instead of 44.1khz, it a little fast, that is the pitch is slightly high, but,

THE GAME HAS SOUND :D

Many kudos to the man who went through the machine code to figure that one out, and to paulisdead for finding this great *fix*. Now, I can actually play without getting my 'a' handed to me from lowly imps. Next up, getting the sound card to actually run at 44.1khz so that it sounds correct.

Cheers!
Shawn
Back to top
View user's profile Send private message
paulisdead
Guru
Guru


Joined: 10 Apr 2002
Posts: 510
Location: Seattle, WA

PostPosted: Fri Oct 08, 2004 3:34 am    Post subject: Reply with quote

@ SpoonMeiser

Gettin aoss to work is a bit of a moot point now that I've found the hex fix, but thanks for the reply.
_________________
"we should make it a law that all geeks have dates" - Linus
Back to top
View user's profile Send private message
gatiba
Guru
Guru


Joined: 01 Sep 2002
Posts: 434

PostPosted: Fri Oct 08, 2004 6:53 am    Post subject: Re: ALSA Reply with quote

tindalos wrote:
I just edited ~/doom3/base/DoomConfig.cfg and altered this line
Code:
seta s_driver "oss"

changing it to
Code:
seta s_driver "alsa"

and sound started working great


I can't believe it! 8O 8O
Now sounds works perfectly!!! :D :D

Tx man !
Back to top
View user's profile Send private message
pzgren
n00b
n00b


Joined: 28 Sep 2004
Posts: 63
Location: The Old Europe, Germany

PostPosted: Fri Oct 08, 2004 8:39 pm    Post subject: Re: same problem, amd64 Reply with quote

atmos wrote:
Yup, tried that, still no dice. :(

Maybe you need both:
Code:
echo "doom.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss
echo "doom.x86 0 0 disable" > /proc/asound/card0/pcm0c/oss


If ALSA is compiled as modules, make sure snd-pcm-oss is loaded before this commands, or id does not apply. And then it should list this:

Code:
cat /proc/asound/card0/pcm0p/oss
doom.x86 0 0 direct
...


In 199x I hate Epic Games for their Voodoo2-only first Unreal Game and liked ID Software much for quake and doom... today I like Epic Games like never before for their very fine Linux (and amd64-binaries) Games and hate more and more ID for this late and bad pseudo-Linux support. That is really sh** ID. And I think the MAC-Users are pinning ID on the trash for their Mac-support.

Marcus
Back to top
View user's profile Send private message
SpoonMeiser
n00b
n00b


Joined: 25 Sep 2002
Posts: 62

PostPosted: Fri Oct 08, 2004 11:45 pm    Post subject: Re: ALSA Reply with quote

tindalos wrote:
I just edited ~/doom3/base/DoomConfig.cfg and altered this line
Code:
seta s_driver "oss"

changing it to
Code:
seta s_driver "alsa"

and sound started working great

Sadly this didn't work for me, so I've taken the cheaters way out and am now using another sound card (it feels so wrong to give up on hardware).
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Sat Oct 09, 2004 12:41 am    Post subject: Reply with quote

Ivan The Viking wrote:
I changed the hex value and at first, the sound seems fine, but since it is playing them at 48khz instead of 44.1khz, it a little fast, that is the pitch is slightly high, but,

THE GAME HAS SOUND :D


Ugh, that sucks a bunch. I'm not even going to try this hack.
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Sat Oct 09, 2004 12:46 am    Post subject: Reply with quote

Hey, the wiki on zerowing just got updated with this:
http://zerowing.idsoftware.com/linux/doom/ wrote:
SNDCTL_DSP_SPEED failed to get the requested frequency 44100, got 48000

The sound engine will only output 44.1KHz. This indicates that your sound processing cannot do this and suggests 48KHz instead. Depending on your setup, try to find a configuration that allows 44.1KHz. If you are running artsd for resampling/multiplexing, you can try to reconfigure with the following command: artsd -s 44100 -F 6 -S 256


What a sorry excuse. I've never seen any other app complain about frequency, so clearly it's not the fault of my drivers or my hardware. Hell, all previous id games ran just fine (after the direct/disable trick, of course).

Why can't they just admit that their sound backend sucks?!
Back to top
View user's profile Send private message
blixel
Guru
Guru


Joined: 19 Jul 2004
Posts: 403
Location: Central, Florida

PostPosted: Sat Oct 09, 2004 1:39 pm    Post subject: Re: same problem, amd64 Reply with quote

atmos wrote:
during DOOM 3 initialization...
WARNING: mmap 57344 bytes on device /dev/dsp failed: Input/output error

WARNING: sound subsystem disabled


Same problem with my ASUS A7V880 board (that I just bought last week).

I happened to have an extra Creative SB Live! card. I was going to try to use it but for some strange reason (resource conflict I'm guessing), whenever the SB Live! card is in my system, my NIC quits working after about 5 minutes.
Back to top
View user's profile Send private message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Sun Oct 10, 2004 2:46 pm    Post subject: Reply with quote

A similar error:
Code:
----------- OSS Sound Initialization -----------
opened sound device '/dev/dsp'
/dev/dsp - bit rate: 16, channels: 2, frequency: 44100
WARNING: mmap 32768 bytes on device /dev/dsp failed: Input/output error

close sound device
WARNING: sound subsystem disabled

------------------------------------------------
I tried setting the config to alsa as well - that unfortunately didn't fix the problem :(. I too have no problems running UT2004 and such, but I should probably also mention that artsd always crashes on startup in KDE... even though sound works when not going through artsd.

I cannot go with the "get a better sound card" route because I am using a laptop, and I don't even want to go to trying that external SB Extigy thing.

The hex-edit thing doesn't look like it would work because it detects 44100 on the dot.

I'd like to get this up and running - I can get things running smooth at high detail at 1024x768.
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
nouse66
Apprentice
Apprentice


Joined: 09 Jan 2003
Posts: 194

PostPosted: Mon Oct 11, 2004 6:22 am    Post subject: Reply with quote

i've got compiled in alsa for my envy24 chipset and none of these fixes work. changing to /dev/dsp1 stopped the gamefrom complaining but there isnt any sound with either - seta s_driver "oss" or "alsa"

i also tried the
echo "doom.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss
thing with no luck

does anyone have any other ideas i can try?
Back to top
View user's profile Send private message
Tuna
Guru
Guru


Joined: 19 Jul 2002
Posts: 485
Location: Berlin

PostPosted: Mon Oct 11, 2004 9:46 am    Post subject: Reply with quote

setting the driver to "alsa" will not work anyway. maybe it ignores some specific checks at startup but the game will report to open /dev/dsp anyway. the id page also says there is no alsa support (yet).

i have an envy24ht chip aswell.. and all i could produce from that one was a little crackling on the speakers with aoss emulation. this is a problem with oss emulation and mmap support. it just wont work. same is for quake3 and quake1. tell id software not to use mmap with oss.. or better - tell them to give us an alsa interface already.. its about time - oss is obsolete! ;-)
Back to top
View user's profile Send private message
pzgren
n00b
n00b


Joined: 28 Sep 2004
Posts: 63
Location: The Old Europe, Germany

PostPosted: Mon Oct 11, 2004 2:39 pm    Post subject: Reply with quote

Tuna wrote:
setting the driver to "alsa" will not work anyway. maybe it ignores some specific checks at startup but the game will report to open /dev/dsp anyway. the id page also says there is no alsa support (yet).

Yes, no ALSA. Do not know who mention to use it in the doom config.../dev/dsp is the first OSS sound device, which will be emulated by ALSA through snd-pcm-oss.

Tuna wrote:
i have an envy24ht chip aswell.. and all i could produce from that one was a little crackling on the speakers with aoss emulation. this is a problem with oss emulation and mmap support. it just wont work. same is for quake3 and quake1. tell id software not to use mmap with oss.. or better - tell them to give us an alsa interface already.. its about time - oss is obsolete! ;-)

Not ALSA, but rather http://www.openal.org/ like UT2004 with fine ogg music format. Runs on every system.

Marcus
_________________
Gentoo Linux 2.6.9-ck2 - x86_64 - Athlon64 3200 - MSI K8N Neo -
1 GB Infineon PC-400 - FX 5900XT - 2 SATA 80GB Maxtor/Samsung and 99% M$ free system
Back to top
View user's profile Send private message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Wed Oct 20, 2004 2:50 am    Post subject: Reply with quote

I checked here and found a possible solution in this thread:
Quote:
No sound? Possible solution - 2004/10/07 09:38 I'm using ALSA with the snd_intel8x0 module, and had no sound. The doom3
output included the following:

WARNING: mmap 32768 bytes on device /dev/dsp failed: Input/output error

Then I remembered a trick used to run other games with sound. As root, I
entered

echo "doom.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss

This does the trick for other games, but not for doom3 on my system. Now I
got another error message, though:

WARNING: ioctl SNDCTL_DSP_SPEED failed to get the requested frequency 44100, got 48000

What finally made it work for me, was to use aRts for resampling. In one window
I entered the following to start the aRts daemon with resampling:

artsd -s 44100 -F 6 -S 256

In another window I cd'ed to the doom3 directory, and used artsdsp to start Doom:

artsdsp -m doom3

Voila! Sound works!


Sverre.
Unfortunately, artsd just plain don't work with me, so I can't verify this (every time I start KDE artsd crashes... though I do have sound). Can anyone else still suffering from this try it and verify? I just wish that it worked with me :(

Here's what I get:
Code:
bash-2.05b$ artsd -s 44100 -F 6 -S 256
unix_connect: can't connect to server (unix:/tmp/mcop-rich/localhost-4565-4175d066)
Segmentation fault
so I stop there not seeing the point in trying any further.
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Wed Oct 20, 2004 10:41 pm    Post subject: Reply with quote

Same error.

I give up. Somebody wake me up again when the Linux port of DOOM III is actually usable.
Back to top
View user's profile Send private message
wintux
n00b
n00b


Joined: 30 Oct 2004
Posts: 4
Location: Elizabethtown, PA - USA

PostPosted: Sat Oct 30, 2004 7:55 pm    Post subject: Reply with quote

:D Doom3 and the "id" like games and sound problem solved!!!!

Hi, after some extensive searching I found that adding or creating a script file exactly like this enables sound in for me, Doom3, Quake3, TeamSpeak:

# echo "doom.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss
artsd -s 44100 -F 6 -S 256 &
cd /usr/games/doom3 " <--------- point this to your own doom3 script!!"
artsdsp -m doom3


After I did that, all of my "id" games had sound, and good sound.

By the way my sound hardware is nvidia nforce2 (i.e. intel8x0)
my kernel is compiled with alsa and oss support.

I hope this helps :)

My System:
Athlon XP 2700+
1GB PC 2700
Kernel 2.6 sources
Gigabyte GA-7N400 Pro2
NVidia NForce2 chipset and sound
XFX FX 5600SE/256MB
_________________
Someday, the sheep of the world will see that Linux is the answer.....
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Sat Oct 30, 2004 8:07 pm    Post subject: Reply with quote

Have you even read this thread? Somebody just posted the exact same thing two posts above.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum