Problems with ZSNES 1.50 in Linux
Moderator: ZSNES Mods
Problems with ZSNES 1.50 in Linux
Just tried out 1.50, and noticed at least two serious problems in Linux (the Windows version still works) that weren't there in 1.42:
1. The sound started making crackling noises (seems to be related to the volume level - clipping perhaps?). Btw, I have read the FAQs regarding this issue, and none of the tips work (ALSA/OSS, 44.1 or 48 kHz, killing sound daemons, etc).
2. The emulator doesn't run as smoothly as before. This is most easily seen in the Contra 3 intro when the text "The Alien Wars Begin" start scrolling over the screen. It never scrolled perfectly smooth, but now it's become really bad.
Tried pinpointing the svn revision where the error first appeared. So far, I know that up until revision 2562, it was OK, and from 3048 it was broken. Most of the revisions between 2562 and 3048 seem to be completely unusable on Linux because of a bunch of unresolved symbols when linking, so I haved searched in that range yet. A bit worrying that 485 revisions could go by without anyone noticing that the Linux version didn't build. Makes me feel like I'm all alone in this. :)
Anyway, I thought I would post this before digging further into this problem. Would be nice to know if I'm not the only one seeing this.
1. The sound started making crackling noises (seems to be related to the volume level - clipping perhaps?). Btw, I have read the FAQs regarding this issue, and none of the tips work (ALSA/OSS, 44.1 or 48 kHz, killing sound daemons, etc).
2. The emulator doesn't run as smoothly as before. This is most easily seen in the Contra 3 intro when the text "The Alien Wars Begin" start scrolling over the screen. It never scrolled perfectly smooth, but now it's become really bad.
Tried pinpointing the svn revision where the error first appeared. So far, I know that up until revision 2562, it was OK, and from 3048 it was broken. Most of the revisions between 2562 and 3048 seem to be completely unusable on Linux because of a bunch of unresolved symbols when linking, so I haved searched in that range yet. A bit worrying that 485 revisions could go by without anyone noticing that the Linux version didn't build. Makes me feel like I'm all alone in this. :)
Anyway, I thought I would post this before digging further into this problem. Would be nice to know if I'm not the only one seeing this.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
If you're using strictly 1.50, then you need to compile with --enable-release passed to ./configure.
Also, I think the unresolved symbols is a result of a failure to make clean in many instances. Yes, you are alone in your issue.
Also, I think the unresolved symbols is a result of a failure to make clean in many instances. Yes, you are alone in your issue.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Makes no difference, aside from taking forever to compile.Deathlike2 wrote:If you're using strictly 1.50, then you need to compile with --enable-release passed to ./configure.
No, seems to be caused by these lines in cpu/execute.c:Deathlike2 wrote:Also, I think the unresolved symbols is a result of a failure to make clean in many instances.
Code: Select all
#ifdef __LINUX__
#include "../gblhdr.h"
#define DIR_SLASH "/"
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#define DIR_SLASH "\"
#endif
#include "../gblvars.h"
You're as sure about that as you were about the above points?Deathlike2 wrote:Yes, you are alone in your issue.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I don't think so either, but somewhere in those 485 revisions, the two bugs started occuring, and I can't easily determine where because of the link issues. The piece of code I showed above fixes some of the link errors (actually, it reverses patch 2563), but more are introduced later and this makes it very time-consuming to debug the problem by binary searching revisions until I find the culprit.Deathlike2 wrote:Not every commit is perfect, however I don't think literally "every" commit within that range is causing those problems.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
If you're having sound issues, I recommend trying latest SVN, using --enable-libao (requires libao and libao-dev) to configure, and then trying one of the audio drivers you can pass to -ad, see zsnes --help.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Sure: (I was going to eventually, but I thought I'd put some more effort in myself before filing a regular bug report)Deathlike2 wrote:Could you at least mention your specs, and Linux distro you are using?
Software:
Distro: Slackware 11.0
Kernel: 2.6.18.5
Libc: 2.3.6
ALSA: 1.0.11
X.org: 6.9.0
NVIDIA driver: 1.0.9629
Hardware:
CPU: Athlon 64 X2 3800+
M/B: ASUS A8N SLI
Graphics: Geforce 7800 GTX
Sound card: SB Live 5.1
It's getting very late here (almost 03:30 :), so I'll have to try this tomorrow. Thanks for the tip.Nach wrote:If you're having sound issues, I recommend trying latest SVN, using --enable-libao (requires libao and libao-dev) to configure, and then trying one of the audio drivers you can pass to -ad, see zsnes --help.
Anyway, I'm seeing the scrolling issue even when I disable sound completely, so if the two problems are related, I'm not very optimistic.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Well if you can narrow down certain emu bugs to a particular revision, I'll gladly take a look. But please do tell me if any other audio options help you at all.hakonrk wrote:It's getting very late here (almost 03:30Nach wrote:If you're having sound issues, I recommend trying latest SVN, using --enable-libao (requires libao and libao-dev) to configure, and then trying one of the audio drivers you can pass to -ad, see zsnes --help., so I'll have to try this tomorrow. Thanks for the tip.
Anyway, I'm seeing the scrolling issue even when I disable sound completely, so if the two problems are related, I'm not very optimistic.
BTW I own an SB Live. With it I don't have ALSA, just OSS, have SDL using OSS, set ZSNES to 32000 Stereo sound, and it sounds fine in all games but ToP. When I get a chance I hope to try the new libao sound code on it which was just commited to SVN.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Progress report: The audio bug turned out to be a regression that was introduced in revision 2757. By applying the following patch to the current SVN revision, the effects of revision 2757 is undone, and the sound works in Linux/ALSA again:Well if you can narrow down certain emu bugs to a particular revision, I'll gladly take a look. But please do tell me if any other audio options help you at all.
Code: Select all
Index: src/linux/audio.c
===================================================================
--- src/linux/audio.c (revision 4300)
+++ src/linux/audio.c (working copy)
@@ -215,9 +215,9 @@
int *end_d = DSPBuffer+BufferSizeB;
for (; d < end_d; d++, ptr++)
{
- if ((unsigned) (*d + 0x8000) <= 0xFFFF) { *ptr = *d; continue; }
- if (*d > 0x7FFF) { *ptr = 0x7FFF; }
- else { *d = 0x8000; }
+ if (*d > 32767) { *ptr = 32767; }
+ else if (*d < -32767) { *ptr = -32767; }
+ else { *ptr = *d; }
}
}

Found the source of the scrolling bug, too. This regression was introduced in 2625. As with the sound bug, it's an attempted optimization that didn't work. The commit comment says:
Combined with the above patch for the mentioned sound issue, this fixes all the problems I've seen with 1.50.
Apparently, the code doesn't detect changing frames very well, so I'm currently just using the below patch to disable this optimization:Optimisation to frame draw code, only draw frames that change
Code: Select all
Index: src/linux/sw_draw.c
===================================================================
--- src/linux/sw_draw.c (revision 4302)
+++ src/linux/sw_draw.c (working copy)
@@ -153,7 +153,6 @@
UpdateVFrame();
- if (prevtot == frametot && (!GUIOn || !GUIOn2)) { return; }
if (curblank || OGLModeCheck()) return;
LockSurface();
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Okay, I just applied a patch to SVN, let me know if that has good sound for you.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Thank you for finding.hakonrk wrote:Sounds good now. Thanks for applying this so quickly!Nach wrote:Okay, I just applied a patch to SVN, let me know if that has good sound for you.
BTW, can you try the new -ad oss option and tell me how that works for you? (must configure with --enable-libao, and make clean first)
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Tried -ad oss and -ad sdl, and they both seem to work fine. I'm using ALSA, though, so I'm not sure how valuable my -ad oss test was. At least I can say that it seems to be working with ALSA's OSS compability interface.Nach wrote:BTW, can you try the new -ad oss option and tell me how that works for you? (must configure with --enable-libao, and make clean first)
This optimization also doesn't work well with the NTSC filter (use the NTSC filter with some RPG where the characters "walk on the spot" and you'll see what I mean) It should be disabled when the NTSC filter is active, because the NTSC artifacts (should) change every frame even if the image produced by the SNES doesn't.hakonrk wrote:Found the source of the scrolling bug, too. This regression was introduced in 2625. As with the sound bug, it's an attempted optimization that didn't work. The commit comment says:
Apparently, the code doesn't detect changing frames very well, so I'm currently just using the below patch to disable this optimization:Optimisation to frame draw code, only draw frames that change
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I wasn't sure if to bump this thread or create a new one, but since I have the exact same problems as the poster, I decided to just bump it. Sorry if it wasn't the right choice.
Well, I'm on Ubuntu 6.10, and I've installed the zsnes 1.51 stable version. At first sound didn't go well. Installed it with libao, chose 32000 khz and it worked fine.
But then I reached a point where scrolling was annoyingly slow, it was when 4 sprites where on the screen (on Ys IV: Mask of the Sun).
I tried using the patch the poster proposed (I just had to add it on the line he put there, not removing anything, isn't that so? I'm new to Linux, and don't know anything of programming, so...), but the problem was still there.
I also tried the latest SVN version, and I believe the scrolling issue had been fixed (I say "I believe" because I've tried so many things already...), but because the sound core is being rebuilt as I read elsewhere on this board, sound was awful.
Anyway, thank you, and sorry if I'm not posting this on the right place
Well, I'm on Ubuntu 6.10, and I've installed the zsnes 1.51 stable version. At first sound didn't go well. Installed it with libao, chose 32000 khz and it worked fine.
But then I reached a point where scrolling was annoyingly slow, it was when 4 sprites where on the screen (on Ys IV: Mask of the Sun).
I tried using the patch the poster proposed (I just had to add it on the line he put there, not removing anything, isn't that so? I'm new to Linux, and don't know anything of programming, so...), but the problem was still there.
I also tried the latest SVN version, and I believe the scrolling issue had been fixed (I say "I believe" because I've tried so many things already...), but because the sound core is being rebuilt as I read elsewhere on this board, sound was awful.
Anyway, thank you, and sorry if I'm not posting this on the right place
