internal structures and 32/64bit compatibility
I'm running gentoo on amd64 with the compat libs installes (emul-linux-x86-soundlibs). I'm seeing some strange things that make me think that either the internal structures have changed during the last few versions or that they aren't 32/64bit compatible.
I have a 64bit mplayer and 32bit wine which I use to play World of Warcraft. When I start mplayer to play a sound file, it works fine, I even can start a second mplayer and I can hear both sounds. Now when I start wine, I get this:
ALSA lib pcm_dmix.c:788:(snd_pcm_dmix_open) unable to create IPC shm instance
The other way around, when I start wine first, the in-game sound works fine. When I start mplayer later I get this:
mplayer: pcm_params.c:187: snd_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed.
Looks like they (the 32 and 64bit libraries) don't understand each other. As I can't compile the 32bit libs on my own, they are precompiled by the gentoo staff, I don't know which version they are, but the 64bit alsa-lib has version 1.0.10.
Can someone explain whet is going on here?
I've tried to compile my own 32bit alsa-oss to test why teamspeak fails, but libtool keeps using absolute paths (/usr/lib/libasound.so) but the 32bit libs are located in /usr/lib32, and I have no clue how to convince libtool to use "-lasound" instead of the absolete path. And I guess alsa-lib will be equally hard to compile for 32bit so I didn't even try it.
How can I compile alsa-lib for 32bit ?
thanks
tom
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Quoted 1 line · Tomas Carnecky
Looks like they (the 32 and 64bit libraries) don't understand each other. As I can't compile the 32bit libs on my own, they are precompiled by the gentoo staff, I don't know which version they are, but the 64bit alsa-lib has version 1.0.10.
... they should update their packages ;)
Quoted 4 lines
I've tried to compile my own 32bit alsa-oss to test why teamspeak fails, but libtool keeps using absolute paths (
/usr/lib/libasound.so) but the 32bit libs are located in/usr/lib32, and I have no clue how to convince libtool to use "-lasound" instead of the absolete path. And I guess alsa-lib will be equally hard to compile for 32bit so I didn't even try it.How can I compile alsa-lib for 32bit ?
was easier that I've expected:
./configure --prefix=~/root LDFLAGS="-L/emul/linux/x86/usr/lib -m32" CFLAGS="-L/emul/linux/x86/usr/lib -m32"
and the package compiled without errors, copied the library to the lib32 path and now I can play WoW and listen to music !
but the aoss wrapper library (version 1.0.10) still fails:
$ ALSA_OSS_DEBUG=1 LD_PRELOAD=/emul/linux/x86/usr/lib/libaoss.so.0.0.0 TeamSpeak
ERROR: ld.so: object '/emul/linux/x86/usr/lib/libaoss.so.0.0.0' from LD_PRELOAD cannot be preloaded: ignored.
Opened PCM dsp0 for stream 0 (result = -2)
Opened PCM default for stream 0 (result = 0)
Opened PCM default for stream 1 (result = 0)
open("/dev/dsp", 2, 0) -> 18
ioctl(18, SNDCTL_DSP_RESET)
ioctl(18, SNDCTL_DSP_SETDUPLEX)
ioctl(18, SNDCTL_DSP_GETCAPS, 0x590e9168) -> [13056]
ioctl(18, SNDCTL_DSP_SETFRAGMENT, 0x590e916c[3000c])
dsp ioctl error = -22
close(18) -> 0
$Maybe a bug in TeamSpeak itself, not initializing the device properly, but it works fine under native oss. I even tracked down the file and line on which it fails (posted to the alsa-user mailing list). So if someone has a clue how to fix this I'd be more than happy to test it.
Just commenting out the function call didn't help, so that call seems to be important for the device initialization. Seems like the function arguments ate calculated wrong, but I'm not a sound expert and I don't know what the valid fucntiion arguments are.
tom
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
At Sun, 04 Dec 2005 01:12:26 +0000,
Quoted 7 lines · Tomas Carnecky
but the aoss wrapper library (version 1.0.10) still fails:
$ ALSA_OSS_DEBUG=1 LD_PRELOAD=/emul/linux/x86/usr/lib/libaoss.so.0.0.0 TeamSpeak ERROR: ld.so: object '/emul/linux/x86/usr/lib/libaoss.so.0.0.0' from LD_PRELOAD cannot be preloaded: ignored.
Do you really have this shlib file?
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Quoted 12 lines · Takashi Iwai
At Sun, 04 Dec 2005 01:12:26 +0000,
Quoted 4 lines · Tomas Carnecky
but the aoss wrapper library (version 1.0.10) still fails:
$ ALSA_OSS_DEBUG=1 LD_PRELOAD=/emul/linux/x86/usr/lib/libaoss.so.0.0.0 TeamSpeak ERROR: ld.so: object '/emul/linux/x86/usr/lib/libaoss.so.0.0.0' from LD_PRELOAD cannot be preloaded: ignored.Do you really have this shlib file?
if alsa does some output, then the library was preloaded, if the preload would fail, I wouldn't see any output I guess.
And I really hope that the tab-completition in bash is working, too :)
tom
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
At Mon, 05 Dec 2005 19:59:08 +0000,
Quoted 13 lines · Tomas Carnecky
Quoted 11 lines · Takashi Iwai
At Sun, 04 Dec 2005 01:12:26 +0000,
Quoted 6 lines · Tomas Carnecky
but the aoss wrapper library (version 1.0.10) still fails:
$ ALSA_OSS_DEBUG=1 LD_PRELOAD=/emul/linux/x86/usr/lib/libaoss.so.0.0.0 TeamSpeak ERROR: ld.so: object '/emul/linux/x86/usr/lib/libaoss.so.0.0.0' from LD_PRELOAD cannot be preloaded: ignored.
Quoted 6 lines
Quoted 3 lines
Do you really have this shlib file?
if alsa does some output, then the library was preloaded, if the preload would fail, I wouldn't see any output I guess.
Right, but still I'm wondering how it did work. Maybe you have another libaoss and it was loaded instead of the above?
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Quoted 19 lines · Takashi Iwai
At Mon, 05 Dec 2005 19:59:08 +0000,
Quoted 16 lines · Tomas Carnecky
Quoted 13 lines · Takashi Iwai
At Sun, 04 Dec 2005 01:12:26 +0000,
Quoted 4 lines · Tomas Carnecky
but the aoss wrapper library (version 1.0.10) still fails:
$ ALSA_OSS_DEBUG=1 LD_PRELOAD=/emul/linux/x86/usr/lib/libaoss.so.0.0.0 TeamSpeak ERROR: ld.so: object '/emul/linux/x86/usr/lib/libaoss.so.0.0.0' from LD_PRELOAD cannot be preloaded: ignored.Do you really have this shlib file?
Quoted 7 lines
Quoted 1 line
if alsa does some output, then the library was preloaded, if the preload would fail, I wouldn't see any output I guess.
Right, but still I'm wondering how it did work. Maybe you have another libaoss and it was loaded instead of the above?
if I do:
LD_PRELOAD=./mylib.so wine /games/World.of.Warcraft/WoW.exe
it also prints that 'can't preload' message, but if I supply the full path to the library, it doesn't print that anymore. But since I've supplied the full path to LD_PRELOAD, I have no clue what might cause this error.
After I've changed some parts of libaoss.so it started to work, I had to comment out one function call, replace a return value in another place and add two function calls to the snd_pcm_read/write functions.
What I've done is described here: http://gentoo-wiki.com/HOWTO_ALSA_and_TeamSpeak_on_amd64
read the section 'compile patched alsa-oss' to find out what exactly I've changed.
tom
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click