Linux sound problems fixed!
Moderator: ZSNES Mods
Linux sound problems fixed!
I have found a way to fix the broken sound in Linux.
ALSA doesn't work. No Sound.
OSS doesn't work. No Sound
SDL doesn't work. Broken Sound.
There is a Linux program called wine http://winehq.org/ , when I download the zipped ZSnes and start it this way:
wine zsnes.exe
The Linux sound works perfectly. I don't know what wine does but would it be possible to include it in the next ZSnes release? It's GPL too, I think.
Keep up the good work! :D
ALSA doesn't work. No Sound.
OSS doesn't work. No Sound
SDL doesn't work. Broken Sound.
There is a Linux program called wine http://winehq.org/ , when I download the zipped ZSnes and start it this way:
wine zsnes.exe
The Linux sound works perfectly. I don't know what wine does but would it be possible to include it in the next ZSnes release? It's GPL too, I think.
Keep up the good work! :D
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
Haha, talk about a lousy way to fix linux.
Also, if you're trying to run the Win port in linux, don't expect sound... or anything, for that matter - without Wine, I mean.
Also, if you're trying to run the Win port in linux, don't expect sound... or anything, for that matter - without Wine, I mean.
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
-
- Rookie
- Posts: 20
- Joined: Thu Mar 01, 2007 6:47 pm
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Refer to this when speaking of ALSA: http://insanecoding.blogspot.com/2007/0 ... linux.htmlLiquidAcid wrote:Sad to see that the zsnes team doesn't succeed in interfacing correctly with ALSA...
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
I'm sorry, and what are your qualifications for claiming this about Nach's article, again?LiquidAcid wrote:FUD
Rather than a short acronym, please point out some factual evidence of "FUD" in anything within Nach's article.
WINE is a major project that's been under development by hundreds of people, and has been around longer than ZSNES. Why you think the ZSNES devs should be as capable of manipulating ALSA as them, I don't know.
And really, with as many talented people on ZSNES as there are, the fact that even they can't get ALSA to sound good should really, really tell you something about ALSA.
-
- Rookie
- Posts: 20
- Joined: Thu Mar 01, 2007 6:47 pm
The ALSA sound driver implementation of wine is quite young compared to the age of the whole project byuu.
If ALSA sucks really so hard how everyone claims here wine should have an insane amount of problems with the audio. But it hasn't, not on my desktop system with a dedicated soundcard, nor on my laptop system with a integrated chip.
In fact I have currently more trouble with input devices in wine, and sound was never a problem for me after the ALSA driver was integrated.
I'm just pointing out that devs here are not willing to support ALSA, just because it's linux only. On the other hand dsound support is implemented, which is also only for one operating system type.
And everytime a discussion about audio on linux comes up this link is posted. Has anyone even though about that the situation has already changed? That's like: "ALSA sucked some time ago, it's destined to suck for all time coming"
And just to prevent this question. Yes, I have read the text from nach's blog. And I disagree.
If ALSA sucks really so hard how everyone claims here wine should have an insane amount of problems with the audio. But it hasn't, not on my desktop system with a dedicated soundcard, nor on my laptop system with a integrated chip.
In fact I have currently more trouble with input devices in wine, and sound was never a problem for me after the ALSA driver was integrated.
I'm just pointing out that devs here are not willing to support ALSA, just because it's linux only. On the other hand dsound support is implemented, which is also only for one operating system type.
And everytime a discussion about audio on linux comes up this link is posted. Has anyone even though about that the situation has already changed? That's like: "ALSA sucked some time ago, it's destined to suck for all time coming"
And just to prevent this question. Yes, I have read the text from nach's blog. And I disagree.
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
ALSA sucks at variable amounts of samples per frame and low latency.
Which makes it suck for ZSNES among other stuff.
Pre-blargg core was bufferable enough not to crap out with ALSA on some setups, yet a lot of linux users reported sound issues. Obviously zsnes is at fault. From what I read, most of these users got a better result using the preliminary OSS code added post 1.51. Obviously zsnes is at fault.
You'll compare how wine fares with a win port of zsnes that actually uses the new sound core.
Discussion over.
Which makes it suck for ZSNES among other stuff.
Pre-blargg core was bufferable enough not to crap out with ALSA on some setups, yet a lot of linux users reported sound issues. Obviously zsnes is at fault. From what I read, most of these users got a better result using the preliminary OSS code added post 1.51. Obviously zsnes is at fault.
You'll compare how wine fares with a win port of zsnes that actually uses the new sound core.
Discussion over.
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
An emulator has a lot of demands that most applications do not. Audacious, mplayer et al have no difficulty with playing back audio. It's all they do.If ALSA sucks really so hard how everyone claims here wine should have an insane amount of problems with the audio. But it hasn't, not on my desktop system with a dedicated soundcard, nor on my laptop system with a integrated chip.
Now, given, you said ZSNES+Wine works well. That's impressive. Perhaps their dev team of 100 wouldn't mind helping out us emu authors with sound drivers for our emulators :)
DirectSound is used by ~97% of the ZSNES userbase. ALSA is used by ~2%. You pretty much have to support the former -- but the latter, not so much. ALSA goes against the spirit of Unix and interoperability, whereas OSS does not. Microsoft has always been a vendor lock-in company.I'm just pointing out that devs here are not willing to support ALSA, just because it's linux only. On the other hand dsound support is implemented, which is also only for one operating system type.
It's not that anyone hates Linux. It's that we don't have time to support every last little esoteric OS with an API straight from the ninth circle of hell. DirectSound, on the other hand, is ridiculously easy to use. Very straightforward, very well documented, and there's fifty times as many users and troubleshooting threads around the internet to research problems from.
With which lines? Can you cite sources backing up why you disagree, and why you are right and he is wrong? Just saying you disagree or that Nach is spreading FUD doesn't really tell us anything. If he's wrong, and you can prove it, then I'll give you that :)And just to prevent this question. Yes, I have read the text from nach's blog. And I disagree.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
You make it sound like that article was written years ago.LiquidAcid wrote: And everytime a discussion about audio on linux comes up this link is posted. Has anyone even though about that the situation has already changed? That's like: "ALSA sucked some time ago, it's destined to suck for all time coming"
But even though it was written a short while ago, stuff has in fact changed! OSS is even better now, ALSA still sucks, and distros seem to be oblivious, probably time for another article. But in my recent tests, all the bad points about ALSA still stands.
And of course all the replies that just keep piling up to the article (in the comments section) about new Linux users having OSS 4 work better for them than ALSA, it should be quite apparent what the story is.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Reading the article:
So this case is clearly a driver bug, not a problem from ALSA itself. But it's a problem that I was only able to reproduce with this game... I found it just two days ago, but now the bug is reported and assigned to an ALSA dev.
So, please, if someone finds that ALSA OSS emulation works better than ALSA directly report it to the ALSA devs... and use OSS4 if you want, but also report it!!!
About workarounds... with GuitarFun I found pretty different behaviour:
- Changing from ALSA, OSS user-space emulation and OSS kernel emulation.
- When using ALSA changing from the "default" device to the "hw" or "plughw" device (so no software mixing).
I have one of these cases. A GuitaHero-like game called GuitarFun that uses SDL and works a *lot* better using the user-space OSS emulation (so I even still have software mixing) than ALSA directly. But this just happens in my snd-hda-intel (integrated AS1988) driver, on an emu10k1 (Sound Blaster Live!) the game works correctly using ALSA directly.But the big embarrassment here for ALSA is that using ALSA via its OSS emulation is usually better than using ALSA directly. I've heard from many users of SDL or libao powered programs that telling those wrappers to use OSS (which ends up being used via ALSA's OSS emulation) works better with less gaps (or other problems) in the audio than using ALSA directly by those wrappers.
So this case is clearly a driver bug, not a problem from ALSA itself. But it's a problem that I was only able to reproduce with this game... I found it just two days ago, but now the bug is reported and assigned to an ALSA dev.
So, please, if someone finds that ALSA OSS emulation works better than ALSA directly report it to the ALSA devs... and use OSS4 if you want, but also report it!!!
About workarounds... with GuitarFun I found pretty different behaviour:
- Changing from ALSA, OSS user-space emulation and OSS kernel emulation.
- When using ALSA changing from the "default" device to the "hw" or "plughw" device (so no software mixing).
-
- Rookie
- Posts: 20
- Joined: Thu Mar 01, 2007 6:47 pm
-
- Rookie
- Posts: 20
- Joined: Thu Mar 01, 2007 6:47 pm
wine is facing similar problems like zsnes when translating dsound to alsa.byuu wrote: An emulator has a lot of demands that most applications do not.
OSS goes against the spirit of free software. I already waiting for the day they close down the source again. I'm not going to replace my ALSA setup with some piece of proprietary software just because the zsnes dev team doesn't like the API.byuu wrote:You pretty much have to support the former -- but the latter, not so much. ALSA goes against the spirit of Unix and interoperability, whereas OSS does not. Microsoft has always been a vendor lock-in company.
@Nach's article: No hard facts. I don't see any latency comparison between the different sound systems. In fact the use of numbers is kind of non-existant. You can't expect me to believe this is an objective article. Just someones rant on a piece of technology he failed to understand.
Sorry, but without any kind of number facts this text is just another unsubstantial blog entry.
Also it focuses too much on the wrapper APIs on linux, like SDL or libao. These wrappers are not ALSA. If the wrappers suck ALSA can't help it.
You state that alsalib is not lightweight enough and latency is not the best. And you don't want to use the lowlevel API, so why don't you use JACK.
It's famous for low latency, and even supports OSS backends, and Mac OS audio backends.
The whole blog entry is just there to put down the linux audio infrastructure. Good APIs like JACK or portaudio aren't even mentioned.
Such an article has to be balanced, and I'm only seeing negative critique there.
I really appreciate what Nach and the rest of the zsnes dev team has accomplished over the years. I regularly check the SVN history on bountysource to see what changes were made to the source.
But this constant ALSA bashing really gets on my nerve and I'm not going to stay quiet just because everyone else here backups the developer's wrong opinion on alsa.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I don't think you can simply just get numbers and expect to get proper analysis. The way to properly look at it is how the implementation goes. Even if you feel that Nach is not giving ALSA a fair shake, it is most likely because he has had the most success working with OSS. ALSA implementations seem to have a greater inconsistancy (something like Win9x sound drivers prior to DX5) and apps that have sensitivity towards latency (such as ZSNES) bold poorly under ALSA. An audio/media player isn't dealing with dynamic generation of audio in most instances. Using OSS emulation under ALSA unfortunately proves OSS to be a better solution.LiquidAcid wrote:@Nach's article: No hard facts. I don't see any latency comparison between the different sound systems. In fact the use of numbers is kind of non-existant. You can't expect me to believe this is an objective article. Just someones rant on a piece of technology he failed to understand.
I think it should be addressed at the very least.You state that alsalib is not lightweight enough and latency is not the best. And you don't want to use the lowlevel API, so why don't you use JACK.
It's famous for low latency, and even supports OSS backends, and Mac OS audio backends.
The whole blog entry is just there to put down the linux audio infrastructure. Good APIs like JACK or portaudio aren't even mentioned.
Such an article has to be balanced, and I'm only seeing negative critique there.
It is purely Nach's opinion, but it hasn't been wrong in respect to ZSNES. Against other things, I cannot verify or claim otherwise that it is true or false. If someone were to provide an ALSA patch for ZSNES that works consistantly on all systems, then you might have a point. Show proof or you aren't being objective in regards to Nach's opinion of the matter.I really appreciate what Nach and the rest of the zsnes dev team has accomplished over the years. I regularly check the SVN history on bountysource to see what changes were made to the source.
But this constant ALSA bashing really gets on my nerve and I'm not going to stay quiet just because everyone else here backups the developer's wrong opinion on alsa.
Unfortunately, this argument has been repeated before, and noone has yet to provide a working patch to make ALSA work on all systems.
Last edited by Deathlike2 on Fri Feb 29, 2008 12:33 am, edited 3 times in total.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Please show me how to use alsa then, because we have tried for years and while it works for some people it does not for others. APIs are not supposed to require special tweaks to work on different hardware, this is the point of an API. Why is it that I can run sound fine in FreeBSD or Windows but in Linux using ALSA it becomes a huge headache? I would like someone to please, step up and write some ALSA code that works you believe it can be done.LiquidAcid wrote: I really appreciate what Nach and the rest of the zsnes dev team has accomplished over the years. I regularly check the SVN history on bountysource to see what changes were made to the source.
But this constant ALSA bashing really gets on my nerve and I'm not going to stay quiet just because everyone else here backups the developer's wrong opinion on alsa.
Watering ur plants.
Coincidentally, that is the audio chip used in both of my computers. It would be amusing if all of the ALSA issues turned out to be with this one driver.But this just happens in my snd-hda-intel (integrated AS1988) driver
What?? OSS4 is GPL'ed. You're complaining about their licensing practices in the past? Linux itself wasn't always GPL'ed, either. The GPL is not revokable, so you can use OSS4 right now, and fifty years from now. You can fork it if you like. There's nothing "proprietary" about OSS4, except the commercial version. Many open source vendors (MySQL for one) do this, so that's hardly something to complain about. At the end of the day, everyone has to eat.OSS goes against the spirit of free software. I already waiting for the day they close down the source again. I'm not going to replace my ALSA setup with some piece of proprietary software just because the zsnes dev team doesn't like the API.
As it stands, OSS is the only hardware-level, cross-platform, cross-OS, open source API for multiple Unix-like operating systems. That's a major advantage over ALSA right there.
As far as your system, I really don't think anyone here cares what you do with it. Keep ALSA. Rig it to use your PC speaker for audio out. Attach small plastic pagodas to your computer case. We really couldn't care less.
Again, where are your hard facts?@Nach's article: No hard facts ... But this constant ALSA bashing really gets on my nerve and I'm not going to stay quiet just because everyone else here backups the developer's wrong opinion on alsa.
You can get as loud as you want. Nobody here cares. Write an ALSA driver for ZSNES that works well everywhere, or get technical and point out exactly what Nach has said that is wrong. Cite your sources. We aren't going to take your word at face value over his. This is a simple issue of credibility. Nach is far ahead of you in this community.
Amen to that. It would be nice if Linux would embrace open, cross-platform, cross-OS standards, too. I would expect that kind of shit from Microsoft, but not Linux. Nothing stopped them from improving OSS3 even when it went closed source, as every other OS that used it did.APIs are not supposed to require special tweaks to work on different hardware, this is the point of an API.
-
- Regular
- Posts: 236
- Joined: Mon Nov 21, 2005 3:43 am
I'm sure there's someone out there that could probably code a proper ALSA driver. I wouldn't totally discredit the thing. Have any of you tried talking to people on the ALSA development team to try to get it working properly? Hell maybe they could get their problems worked out with it. If it's somehow unfixable I don't even see the point of using ALSA at all.
Edit: Rofl I did try the windows version of zsnes in wine with alsa output and it does sound perfect. Though the problem is they can't get it working properly on everyones machine. If they could somehow fix it I'm sure they'd have a setting for it.
Edit: Rofl I did try the windows version of zsnes in wine with alsa output and it does sound perfect. Though the problem is they can't get it working properly on everyones machine. If they could somehow fix it I'm sure they'd have a setting for it.
Last edited by powerspike on Thu Mar 06, 2008 9:16 pm, edited 1 time in total.
-
- Lurker
- Posts: 109
- Joined: Sun Jan 30, 2005 10:06 pm
- Location: Wouldn't you like to know?
- Contact:
In my opinion, another major issue with ALSA is it's Linux only. Linux is NOT the only form of Unix out there. I use FreeBSD, which is another form, and it's sound drivers are OSS-compatible (although not OSS according to them). I think it's a good move on the part of the ZSNES developers to focus on using OSS for sound, as it will allow them to continue to make ZSNES work for more than just Windows and Linux. I would hate to see people using FreeBSD be left out. Hell, I'm sure if it works for FreeBSD, it would work for NetBSD as well. Maybe even Mac OS X later on (although only on Intel processors because of the x86 ASM code).
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
I'm a computer programmer (in C++) and a future game designer.
Well, ALSA devs have the cases where they can see AS1988 working better with OSS emulation than directly with ALSA. I hope 1.0.17 have the fixes.byuu wrote:Coincidentally, that is the audio chip used in both of my computers. It would be amusing if all of the ALSA issues turned out to be with this one driver.But this just happens in my snd-hda-intel (integrated AS1988) driver
Meanwhile you can try with the "hw" device if you need to test ALSA. Not only Guitarfun worked a lot better with it. Also trying http://mednafen.sourceforge.net/ I saw that a call to snd_pcm_hw_params_set_period_size(), that works with the "hw" device, fails with the "default" device (only on AS1988).