Step two: Getting the &%&*$ sound to work!

Archives Forums/Linux Discussion/Step two: Getting the &%&*$ sound to work!

Russell(Posted 2011) [#1]
Every single program that uses sound on Ubuntu 10.10 works perfectly, except BlitzMax programs I compile. I've even installed openal and openal-dev (synaptic package manager - which I love!) and used
SetAudioDriver("openal")      'EnableOpenALAudio() returns True

but to no avail. Programs compile and run (usually), but no sound and I get this error:
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started

Apparently, sound has been a big problem with Bmax on linux for a while.

Any workarounds?
Russell

[EDIT: If there IS something that BMax needs to produce sound on Linux, maybe it should be added to the BMax dependencies script.]

Last edited 2011


degac(Posted 2011) [#2]
I have the same problem, see here

http://www.blitzbasic.com/Community/posts.php?topic=88613#1053208

I've installed these 3 package libopenal1, libopenal1-dbg and libopenal1-dev.
Dont' know if it could changes the result.

Question: audio works with other applications? What are the audio system drivers present on your system (PULSE, ALSA)?


Russell(Posted 2011) [#3]
I now have Ubuntu installed on its own partition, rather than having it run in VirtualBox, so that may simplify things.

Anyway, BlitzMax will not compile anything until the script mentioned above is executed (Why this script is not part of BlitzMax's Linux installation procedure or even mentioned in a 'readme', I can't imagine...).

I'm totally new to Linux, so I have no idea what sound system I have, but I did use Synaptic Package Manager to install the OpenAL libraries. Then I used EnableOpenALAudio() and SetAudioDriver("openal"), but that still produced no sound :(

Which sound driver(s) is/are known to work with BMax/Ubuntu? And how do I install it/them? (I imagine it's something like "sudo apt-get install blah-blah")

(I thought I had abandoned the command line 25+ years ago, with the advent of the GUI interface... LOL)

Anyway, since Ubuntu is supposedly the official Linux distro for BlitzMax (which is why I chose it over the others), I'm sure I'm not the only one having issues with sound.

Any ideas/help is greatly appreciated.

Russell


skidracer(Posted 2011) [#4]
You could help test the new pulse audio driver.


Russell(Posted 2011) [#5]
I will reboot into Ubuntu (I'm on Win7 right now) and test this for sure!

One question (Remember that I'm new to Linux...): If I compile programs using your audio driver, will the end-user need anything extra, or is everything kosher since I presume it will be statically linked into the executable? The latter would be preferable, of course, barring licensing issues.

Russell

Last edited 2011


Russell(Posted 2011) [#6]
Yep it worked swell! Hopefully this will find its way into the official linux Bmax in the near future!

(See also my other reply in the link you supplied)
Russell


Russell(Posted 2011) [#7]
In the docs for Brucey's irrklang.mod, it says that one of the requirements for linux is to have the libirrklang.so file in the place referenced by the LD_LIBRARY_PATH environmental variable.

I did some searching to find out how to get/set this. I use
printenv
to list all of the currently defined environmental variables and LD_LIBRARY_PATH is not one of them! Do I need to create this variable? And if so, where should it point to?

Putting the libirrklang.so file in the same directory as the source file doesn't help. I get this error:
Linking:helloworld
/usr/bin/ld: cannot find -lirrKlang
collect2: ld returned 1 exit status
Build Error: Failed to link /home/russell/BlitzMax/mod/bah.mod/irrklang.mod/examples/helloworld
Process complete

Now, I just thought of one thing: I think I read that the irrklang library used to be called irrklang.so (like the name mentioned in the output) instead of libirrklang.so. Could this be it?

(Nope, I tried renaming it to irrklang.so and the result was the same...)

Any ideas?
Russell


skidracer(Posted 2011) [#8]
Typicially linux programmers do not use capital letters (shift key contributes to carpal tunnel syndrome) and their file systems are case sensitive so maybe try irrklang?


Ole JR(Posted 2011) [#9]
As a nonroot user:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path-to-libirrklang.so-file

Should set LD_LIBRARY_PATH so ld finds it.

Putting that into .bashrc in your homedir, should set it for you everytime.
(Notice the '.' as in hidden file)

Or as root (sudo) user:
Or you could try copying the libirrklang.so to a place where ld
default searches. As in /usr/local/lib, then maybe do a 'ldconfig' to
rebuild the lib cache..

The problem with both of the above is that if you release something,
everyone that install your app also have to do the same..

Last edited 2011