Sound not working

Archives Forums/Linux Discussion/Sound not working

Cole(Posted 2008) [#1]
Hey All

Having trouble getting sound working in BLitzMax on Linux. I've tried maxmod and simply playsound. I've tried other people's examples as well as included files in maxmod. I've installed every ALSA package available to my package manager. I've installed just about every other package mentioned on these forums. I've tried 3 different distros. Sabayon, PClinuxOS and now I'm on Mandriva. Same thing every time. Programs compile, modules compile, accelerated graphics work well, audio plays flawlessly in all other programs. None in Blitz.

I'm about to tear my hair out. Except it's too short to grab :S

Anyone have a suggestion?

Cole


Brucey(Posted 2008) [#2]
And OpenAL too?


Cole(Posted 2008) [#3]
No sound oputput from OpenAL

I'm not sure how to do any kind of testing other than trying code and listening though.


Cole(Posted 2008) [#4]
Sometimes I get this 'generic linux error"

appstub.linux signal handler 11

or no error at all, but no sound


D4NM4N(Posted 2008) [#5]
I've tried 3 different distros. Sabayon, PClinuxOS and now I'm on Mandriva.

change the soundcard!

Have you tried ubuntu? Its never failed to detect sound yet for me.


markcw(Posted 2008) [#6]
What model is your soundcard? Can you play system sounds?


Brucey(Posted 2008) [#7]
.. audio plays flawlessly in all other programs ..


Just not in Blitz, it would seem.


Cole(Posted 2008) [#8]
Soundcard is onboard. 'AC97 compliant. Not sure of the manufacturer. I've thought of trying a PCI card, but I don't have one around. It's been a long time since I've used a seperate soundcard. The last one I had was an ISA SB-16.

I don't see why I should have to change the card to get Blitz to work, if sound works everywhere else. That just makes me wonder about how well an app I program in Blitz will work on various systems.

I've ran winXP, PCBSD and the three linux distros with this card and this is the only trouble I've ran into. I didn't use Blitz in windows though, and I don't have it (Win) installed anymore.

I haven't tried Ubuntu. I would prefer a KDE distro, and I heard Kubuntu isn't great. I think if I try another one it'll be openSUSE.

I feel like I must be missing something. The Linspire sticky talks about editing (or creating) an ALSA.conf file. I don't have this file. Should I create one, and what should I put in it?


plash(Posted 2008) [#9]
I remember the same not working on Ubuntu.. There's a small program that lets you choose the default sound card, I think its the one that fixed it for me, but I don't remember where I got it.

Try a Google/Ubuntu forums search for sound card/default sound card issues.


Winni(Posted 2008) [#10]
Your problem is a perfect candidate for another entertaining article on the Linux Hater's Blog. It's 2008, you've tried several distributions and you can't get SOUND working with BlitzMax?

Doesn't that say everything about the state of Desktop Linux that there is to say?

Why are you wasting your time on it?

The moment you'll release a BlitzMax app for Linux, you will be grilled because it's not Open Source. And when you Open Source your BlitzMax app, you will be grilled because it was not written in an Open Source language, but in one that --GASP!!-- is proprietary but heavily uses Open Source technologies "without contributing back to the community".

For the record and before you start installing yet another distribution, namely Ubuntu 8.04: Although Ubuntu is the officially recommend distribution, you will run into a load of other issues with that one as well, and you might also not be able to resolve those.

If you try another distro, stick to a Gnome-based one. BlitzMax won't give you Qt-applications, but you can have native GTK-based ones through Brucey's modules.

Have you tried using the (evil commercial, but working) Open Sound System instead of the distribution's default modules? I don't know if it will help you with BlitzMax, but it has helped me in the past and got stuff working (especially on FreeBSD) that wasn't otherwise supported. It also fixed playback issues with in theory supported hardware that was suffering from poor driver support. Give it a shot:

http://www.opensound.com/


markcw(Posted 2008) [#11]
What model is your motherboard? And again, can you play system sounds?


plash(Posted 2008) [#12]
Doesn't that say everything about the state of Desktop Linux that there is to say?
Don't you mean "Doesn't it say something about the state of BlitzMax - on the Linux end?"

The moment you'll release a BlitzMax app for Linux, you will be grilled because it's not Open Source. And when you Open Source your BlitzMax app, you will be grilled because it was not written in an Open Source language, but in one that --GASP!!-- is proprietary but heavily uses Open Source technologies "without contributing back to the community".
So Eschalon was a failure?


Winni(Posted 2008) [#13]
No, it says something about the state of Linux, as obviously BlitzMax works on -some- distributions but not on -all- of them. Linux is notorious for those inconsistencies, and its developer community does not care enough to fix them. Reason #1 for me why I'd choose FreeBSD over Linux anytime. Reason #2 is performance, reason #3 is the license.

Talking about licenses: I own two Eschalon licenses, one for OS X and one for Windows. It's a great game and I really enjoyed playing it, but I am certainly not the person who can say whether it was a failure on Linux or not. Ask the folks from Basilisk Games how many Linux licenses they have sold. But since they've got the Linux port pretty cheap through BlitzMax' multi-platform support, it probably doesn't really matter if Eschalon's Linux port is commercially viable or not. But I know that John Carmack said that according to their calculations the Linux port of Doom 3 barely returned the investment they put into it, and my stomach feeling tells me that more Doom 3 copies have been sold than Eschalon copies.

By the way, I was talking about APPLICATIONS, not games. Just go and write some app for Linux that could be useful for a few people and then let us know how long you will have to wait until some bored teenager writes a lousy open source clone of it after they first have swamped your mail account and forum with complaints why your app is closed source and why they should pay for proprietary software. Here's their great advice for monetizing on your investment: You can make a living with selling merchandise and giving technical support! Yeah, I'm sure that works for everybody.

If you think that I'm just trolling, fine, I don't really care. But then again, after my own last fruitless effort with Linux (see the wxMax threads), maybe I've finally had enough of the penguins and now am no longer willing to even speak neutral about it. After so many years of development, certain things are simply intolerable and Linux ran out of credit.

Anyway. This thread was about a sound problem. I still recommend giving OSS a shot and then I'm out of here and will go back to playing Lego Indiana Jones on my Xbox 360. Great game, I love it. :)


D4NM4N(Posted 2008) [#14]
Well i bought eschalon linux version, so the 5 minutes tachyon spent compiling it was worth it right there.

Your problem is a perfect candidate for another entertaining article on the Linux Hater's Blog. It's 2008, you've tried several distributions and you can't get SOUND working with BlitzMax?

Doesn't that say everything about the state of Desktop Linux that there is to say?

No it doesn't. Why should linux support every peice of bullsh*t hardware that comes out anyway? Does OSX? Does BSD? Does Windows for that matter without an endless stream of 3rd party driver disks? If the hardware is brand new then it may take a few months but if its common hardware it WILL get support. Ubuntu (for example) does a great job usually.
I only buy linux compatible hardware, i check it first -OR- If i do buy something spontaneously and it doesn't work it goes straight back to the shop for a something that does.


plash(Posted 2008) [#15]
Doesn't that say everything about the state of Desktop Linux that there is to say?
If you didn't notice he said sound works fine in anything other then BlitzMax, that IS saying something about BlitzMax, not Linux.

Regardless of all this nonsense, he is asking for help, not spontaneous debate.


markcw(Posted 2008) [#16]
I had a similar problem with Ubuntu Hardy and my SBLive! Value card. Sound didn't work in BMax and neither did system sounds (like the login sound) however CD audio, any audio players and Flash in Firefox worked. The problem in my case was a conflict between my onboard AC97 audio and the SBLive. Apparently, the standard procedure when installing PCI cards (like the SBLive) is to disable the onboard sound in the BIOS. This worked for me but I don't know why BMax sounds won't work when you only have onboard sound.


Cole(Posted 2008) [#17]
I'm going to agree with Plash in this little debate. I have never had any problem with Linux (under KDE that is, I had some trouble with XFCE, but I think I was just expecting more than it had to offer). All my trouble has been with Blitz, and I'm inclined to blame them. Why is it even released without a proper list of dependancies? For $80 US, I expect that at the very least.

Personally, I don't care what people think about "how" my project has been released under linux, I only care whether or not they like playing it.

My motherboard is ECS I can't remember the model code. It uses an SIS sound chipset, socket 754 cpu, PCI-E Video (Geforce 8500 GT)

As I said before, I get system sounds, audio from all file formats, in all programs, audio from video files, etc, etc. Just nothing in Blitz

I just tried an OSS driver. Same situation as the ALSA.

Perhaps anyone on here who has Blitz working perfectly in Linux can tell me about their setup?
-Which linux distro
-Which soundcard
-Which driver
-Which packages installed
-anything else they think is relevant


Winni(Posted 2008) [#18]
Do you have gstreamer installed and its -dev packages?

And this one: libasound2-dev?


If you didn't notice he said sound works fine in anything other then BlitzMax, that IS saying something about BlitzMax, not Linux.



You assume that something is broken in BlitzMax. I doubt that, because obviously Eschalon has working sound on (some) Linux (distributions). So my assumption is that a required package is not installed by this specific distro that Cole uses, and in my book the dependency jungle and the related inconsistencies between distros are some of the worst problems that Linux has.


Cole(Posted 2008) [#19]
I did not have gstreamer installed. Doing that now. Not sure if I got its -dev packages, I didn't see any

my package manager doesn't have libasound2-dev :S

should I get it somewhere else and install manually?


Cole(Posted 2008) [#20]
I think it is Blitz's responsibilty to provide a list of necessary packages. 90% of Linux software does, and most of that software is free.

I purchased the BlitzMax Linux version assuming it was properly supported, since it is commercial software. Just because we're software developers doesn't mean we are mind readers. Maybe the "real" coders or hackers or whatever can just read through a billion lines of code and know what it requires to work, but I for one am not that good.


plash(Posted 2008) [#21]
I think it is Blitz's responsibilty to provide a list of necessary packages. 90% of Linux software does, and most of that software is free.
You may not have noticed, but as of recently BRL hasn't been very chatty in the community.

-Which linux distro - Ubuntu 8.04
-Which soundcard - SB Live! CT4831
-Which driver - ALSA
-Which packages installed - alsa and pulseaudio

-anything else they think is relevant
Ahh I've identified it, the default sound card program is asoundconf-gtk.

I assume you've properly setup BlitzMax, have you looked at some of the libs this thread may mention? (Check the links!)


Winni(Posted 2008) [#22]
Cole, this asound-thingee is listed as a required package in the Ubuntu 5.10 How-to (and also in a few other threads):
http://www.blitzmax.com/Community/posts.php?topic=54592

Ubuntu is the safest bet for BlitzMax. It is the recommended Linux distribution and most things actually work there. I just didn't have any luck with compiling wxMax on it and gave up after two (or three?) days. But if BlitzMax development on Linux is your focus, and if you don't want the rest of your days with hacking the OS, I would use the recommended distribution.

You also have not just purchased the Linux version of BlitzMax. You actually purchased four BlitzMax versions, namely the ones for OS X/PPC, OS X/x86, Windows x86 and Linux x86.

By the way, this is not an official support forum - this is a community forum. If you want support from BRL, you should email them directly. I've never done it, so I don't know how responsive they are. But for a product that only costs a bit more than 80 USD and for which you probably haven't purchased a support contract (if this option even exists, I don't know), I would not expect miracles or Enterprise-grade support.


Cole(Posted 2008) [#23]
Thanks Guys

This is all helpful stuff. I'm somewhat reluctant to use Ubuntu though. When I started with linux, I told myself it was the last distro I wanted to use. I'm hoping there will be a few more people on here who tell me about their setups with different distros. There are stickies for others, so they must work right? Maybe not...

I'll wait and see, and use this as a last resort :)

Cole


markcw(Posted 2008) [#24]
I haven't tried Ubuntu. I would prefer a KDE distro, and I heard Kubuntu isn't great. I think if I try another one it'll be openSUSE.

Sure, use whatever you want but be aware that most people here use Ubuntu. Kubuntu uses the same repositories as Ubuntu so it's basically the same thing except in KDE. Some Linux users don't like Ubuntu because they think it is slower and installs too much stuff, but Ubuntu is still the most popular distro with about 30% share.

my package manager doesn't have libasound2-dev :S
should I get it somewhere else and install manually?

In Mandriva libasound2-dev uses a different name: libalsa2-devel. You should try to avoid installing packages manually.


Winni(Posted 2008) [#25]
As a native German, I probably should recommend OpenSuSE, which is at home in Nürnberg and that supposedly is a great KDE distribution and also an acceptable Gnome distro. But after Novell bought SuSE... Well, let's say I was never a fan of Novell. But they did some very interesting things with their version of Gnome, which I kind of like. I also think that their Mono project is a good thing. So maybe I should give them some credit here.

I must say that I liked Fedora Werewolf; but to be honest, that was because it looked quite nice on the desktop and the name 'Werewolf' spoke to me. ;-)

Werewolf was also the first distro that I tried where setting up a dual head mode was no pain in the neck and where the 3D effects even worked directly on my PowerPC G4 notebook. But Fedora is another Gnome distribution, so you'll probably not be interested.

Maybe you should re-think your position towards KDE and Gnome. Gnome is where the large Linux companies are, and that for a simple reason: The license. It's much cheaper to write proprietary software for Gnome than for KDE where you have to buy a very expensive Qt license if you want to write closed source software. I asked Trolltech once for a quote for Qt Jambi. Their reply was a questionnaire and they actually wanted to know my income in order to make my an offer. Hello? Anybody home in Norway?

Anyway. Good luck with the sound issue and if you once more switch distributions, stick to a 32-Bit one for BlitzMax. From everything that I've read here, BlitzMax doesn't seem to like 64-Bit Linux.


Cole(Posted 2008) [#26]
I have libalsa2-devel installed. I installed everything with the letters "alsa" in it :)

I didn't realize there was much of a licensing difference between KDE and Gnome. That's interesting. I only decided to stick with KDE because my last experience with Gnome was pretty bad, but that was almost 8 years ago. When I ventured into Unix territory again my first experience was with KDE on PCBSD, and I thought it was great. After that I used XFCE in Sabayon linux, and was pretty frustrated with that. After switching back to KDE, all was going well until this sound issue cropped up. I guess I could try Gnome again.

I'm stuck with 32 bit distros anyway, as I have a 32 bit CPU, hehe

What does everyone think the chances are of it being the soundcard, even though sound works everywhere else? I know it was suggested a few times already, but I'm just wondering about spending the money on it or not.


Brucey(Posted 2008) [#27]
What does everyone think the chances are of it being the soundcard

Not likely.

The only issues I ever had with sound on Linux was when I had both on-board *and* a separate sound card installed. Sometimes Linux would get confused and try to play sound through the other one. In the end I disabled the on-board and played everything through the card.


I used to prefer KDE, but I've found over the years that Gnome is a better fit for me personally.


plash(Posted 2008) [#28]
The only issues I ever had with sound on Linux was when I had both on-board *and* a separate sound card installed.
That's how mine is too, I think switching the default card fixes my sound when it breaks - really weird when it does.


Cole(Posted 2008) [#29]
I'm starting to wonder though myself.

My onboard SIS video did some weird stuff in PCBSD. I couldn't figure it out until I changed to an NVidia card.

Do you guys think that I should try the standard Ubuntu setup and if things still don't work, move on to getting a new card?

If things work in Ubuntu, I can always move on to other distros armed with the knowledge that my card is fine.


Winni(Posted 2008) [#30]
I had some issues with a notebook on-board sound card with FreeBSD years ago and only could get it working with OSS. As for video... You can't do anything wrong with nVidia - they have great driver support for FreeBSD and Linux.

This has been posted before, but --somehow-- this thread reminds of this cartoon:




plash(Posted 2008) [#31]
Do you guys think that I should try the standard Ubuntu setup and if things still don't work, move on to getting a new card?
If sound works in everything else it's not a problem with your card.


markcw(Posted 2008) [#32]
Have you tried running alsamixer to see if something is muted?

What you could do before you install another distro, is put in a soundcard, disable the onboard sound in BIOS, try to get it recognized and then see if BMax sound works. That way you can tell if it's a problem with your SIS soundchip ie. the driver is at fault and there's nothing you can do.


Brucey(Posted 2008) [#33]
you can tell if it's a problem with your SIS soundchip

Would be strange, considering it apparently works with all other applications.


Cole(Posted 2008) [#34]
Tried alsamixer; nothing is muted

If I'm going to try another card, can someone vouch for one that is still on the market and works with blitz in linux for sure?

I can't try other distros or get a different card until after I finish getting the music ready for my wedding (which is iin 11 days), so I might be a little while.


Winni(Posted 2008) [#35]
Cole, just a stupid thought: Do you hear sound when you run your BlitzMax program as root?


skidracer(Posted 2008) [#36]
freeaudio for linux is currently hardwired to oss, if you want to try ALSA you will need to uncomment a bunch of alsa stuff in pub.mod/freeaudio.mod/freeaudio.bmx.

also, the oss driver is using the following output channel:

fd=open("/dev/dsp",O_WRONLY,0);

which may or may not be the politically correct way to be doing things on todays typical f/oss desktop


Cole(Posted 2008) [#37]
I thought of that too, Winni. Not a stupid thought, but no dice there either :(

Very useful information skidracer, thanks. I'm going to look into that.

Umm, just looking quick and I don't see anything (file or folder) called dsp in /dev on my system...


Cole(Posted 2008) [#38]
Hmm, now all of a sudden it's there. Weird...

I couldn't get ALSA loading into freeaudio.bmx. It kept giving me an error in alsadevice.cpp when I tried to build it. Did someone used the wrong variable maybe? I'm not a C programmer, but that's what it looks like to me when I compare ossdevice.cpp to alsadevice.cpp

Any suggestions other than forgetting about blitz and giving up on my game development dreams?


Cole(Posted 2008) [#39]
Mark, I just noticed your install guide to Mandriva and read it. Considering that I have followed the exact same steps that you have and you get sound but I don't, it leads me to believe the only possibility left for my troubles is that the support of my sound chipset is to blame.

I'm going to stop %&#@ing around and go get a new card. I'm also going to warn everyone against SIS. Their video chipset was junk, and it seems there's a good chance their sound is the same.


skidracer(Posted 2008) [#40]



Winni(Posted 2008) [#41]
Cole, you said that /dev/dsp sometimes is there, then it's not.

Do you have e.g. /dev/audio instead? Thanks to Linux not defining clear standards, I think not all audio devices appear as /dev/dsp.

It's another of those stupid ideas, but maybe you could change the code to

fd=open("/dev/audio",O_WRONLY,0);

and see what happens. Where /dev/audio could be whatever name your sound card is using instead of /dev/dsp.

If you're going to get new hardware, make sure it appears in your distro's hardware compatibility list. Even better, make sure it also appears in the HCLs of a few other distros. And also in FreeBSD's HCL. ;-)


markcw(Posted 2008) [#42]
/dev/audio is for compatibility with Sun workstations so it's not going to help, see here.

I'm thinking that this is to do with digital sound as /dev/dsp is the digital signal processor, see here. I think there are issues with some SIS soundchip drivers in Linux that can play analog sound but not digital.


markcw(Posted 2008) [#43]
I couldn't get ALSA loading into freeaudio.bmx. It kept giving me an error in alsadevice.cpp when I tried to build it. Did someone used the wrong variable maybe? I'm not a C programmer, but that's what it looks like to me when I compare ossdevice.cpp to alsadevice.cpp


Ok, I can get this compiling but I don't know how to select the ALSA device in BMax. How do you set fa_Init() in freeaudio.bmx to 1? Anyway, maybe you will know.

First in pub.freeaudio/freeaudio.bmx uncomment lines 65, 66, 70, 116, 177.
Import "-lasound"
Import "alsadevice.cpp"
...
Function OpenALSADevice()
...
Case 1
	device=OpenALSADevice()


Then in pub.freeaudio/alsadevice.cpp uncomment line 13.
#include <alsa/asoundlib.h>

Then add some void* casting stuff to line 38.
threadid=pthread_create(&audiothread,&attr,(void*(*)(void*))audiothread,(void*)this);

And then in the audiothread() function starting on line 53 change all the return -1 lines to return 0 ie. NULL.
	if (err<0) return 0;
...
	return 0;
...etc...



Cole(Posted 2008) [#44]
Thanks for continuing to work on this with me

I got all modules to compile with ALSA. It was line 38 of alsadevice.cpp that screwed me up earlier.

I figured that by switching the deviceid select case numbers this time, it would choose ALSA by default. Maybe it did, I dunno, because I still can't get any sound out of it. I switched to an ALSA driver with that setup, no help.

Apparently Mandriva's HCL is not up and running. Still hoping someone can point me toward a card that they have tested. I'm gonna check HCL's for other distros too.

my /dev/dsp apparently appears magically the first time I use software that produces sound. As does /dev/audio and /dev/adsp


skidracer(Posted 2008) [#45]
for alsa testing there may also be an issue with brl.freeaudioaudio.mod which also comments out Alsa init at another layer of audio design mayhem

I would also uncomment all the logging in each driver if you want to continue poking around.


markcw(Posted 2008) [#46]
Uncommenting line 201 in freeaudioaudio.bmx made no difference.
TFreeAudioAudioDriver.Create "FreeAudio ALSA System",1

I put a printf after pthread_create() which returns 0 so that seems to be working, see here.
One thing I just noticed is there is no 'void run()' function in alsadevice.cpp like in ossdevice.cpp.


Cole(Posted 2008) [#47]
Well guys, I got a sound blaster audigy yesterday. Put it in and disabled the onboard. No change. Sound works everywhere but in Blitz. Possibly a waste of money. Maybe my music sounds better, although I can't really tell, hehe

I can't understand this at all. Why would everything work immediately for markcw and not for me? What could be so different about my system?

I'm just about ready to give up on Blitz. The whole reason I decided to go with it is that it's supposed to make the multimedia aspect of game development easier. I would say it's been a far cry from that so far.


plash(Posted 2008) [#48]
Well guys, I got a sound blaster audigy yesterday. Put it in and disabled the onboard. No change. Sound works everywhere but in Blitz.
I do recall mentioning something like this.. If your sound card works, but not in blitz, then the problem is not your sound card :(


dawlane(Posted 2008) [#49]
Just out of curiosity Cole what make and model of motherboard is in your machine? And is the sound corrupt on all sound file types or just a few?


Cole(Posted 2008) [#50]
I didn't really suspect that the sound card was bad, but rather that the driver was somehow not doing what it was supposed to.

http://www.ecs.com.tw/ECSWebSite/Products/ProductsDetail.aspx?DetailID=575&CategoryID=1&DetailName=Feature&MenuID=48&LanID=0
That is my motherboard, and all the pertinent information

No sound file types are working in Blitz. All work elsewhere.


markcw(Posted 2008) [#51]
Ok, it seems the ADI AD1888 chipset uses the "ati ixp" driver for ALSA, see here but I'm not sure if it's supported by OSS, see here for a list.

You could try running "alsamixer" and set the Surround on Independ option and then try fiddling with the other switches, see here (Edit: oh yeah, this won't help).

Or this might work: KMix -> Switches -> disable Exchange Front/Surround

Or find the equivalent of: Audio Preferences -> default sink to OSS


D4NM4N(Posted 2008) [#52]
It does sound like a blitz issue after all.

why not simply wrap another c++ sound lib and use that instead? It shouldnt be that many functions to wrap up for just a sound module.