GTK/X11 Port (aka Linux/UNIX GUI)

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Rhapsody
Snes9x White Belt
Posts: 18
Joined: Tue Jul 11, 2006 7:00 pm

Post by Rhapsody »

This is all very nice (though it doesn't address the main complaints I have with the regular Snes9x on Linux) but has a major problem in that there's no sound.

I'm using OSS4 (by necessity rather than by choice) and the regular PortAudio in the Ubuntu repositories did not work. I've compiled and installed PortAudio as suggested earlier in the topic, but Snes9x-GTK now sees no PortAudio at all and refuses to install.

If I may also digress, why did you feel the need to use PortAudio in the first place? SDLMAME can access OSS or ALSA just fine through SDL, bsnes works perfectly with OpenAL here, and most other apps just use OSS directly. Do you have an actual reason to complicate this even further or did you just feel the Linux audio situation is not yet catastrophic enough to warrant using something a little more well established?
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

Rhapsody wrote:This is all very nice (though it doesn't address the main complaints I have with the regular Snes9x on Linux) but has a major problem in that there's no sound.
It was a project to address MY main complaints with regular Snes9x on Linux. :-) Seriously, though, if you don't say what your complaints are, how am I to know what to fix?
I'm using OSS4 (by necessity rather than by choice) and the regular PortAudio in the Ubuntu repositories did not work. I've compiled and installed PortAudio as suggested earlier in the topic, but Snes9x-GTK now sees no PortAudio at all and refuses to install.
You might have installed PortAudio in /usr/local instead of /usr, in which case you probably need to add PKG_CONFIG_PATH=/usr/local/lib/pkgconfig to the front of configure. If you want to install the packages, you need to reinstall PortAudio to /usr, then manually use dpkg to forcefully install the deb. I'd definitely recommend compiling snes9x from source in this situation, if you're not already doing so.
If I may also digress, why did you feel the need to use PortAudio in the first place? SDLMAME can access OSS or ALSA just fine through SDL, bsnes works perfectly with OpenAL here, and most other apps just use OSS directly. Do you have an actual reason to complicate this even further or did you just feel the Linux audio situation is not yet catastrophic enough to warrant using something a little more well established?
I am certainly aware of the state of Linux audio, but there are a lot of issues with the APIs you list that made me decide on an obscure project like PortAudio. SDL's timer isn't finely-grained enough, OpenAL only does one channel unless you try to emulate stereo with 3D sources, OSS alone is often blocked by sound servers when a hardware mixer isn't present, and ALSA only runs on Linux. Since PortAudio works correctly with OSS and ALSA (and others), and is maintained, I chose to use it so I only had to write to one API.

I did leave things open so I could add another API easily, and OSS is fairly easy. If I'm feeling ambitious, I might add another driver over the next few days.
Rhapsody
Snes9x White Belt
Posts: 18
Joined: Tue Jul 11, 2006 7:00 pm

Post by Rhapsody »

BearOso wrote:It was a project to address MY main complaints with regular Snes9x on Linux. :-) Seriously, though, if you don't say what your complaints are, how am I to know what to fix?
Well, the two that remain unfixed are that the only scaling options are 1x and 2x, which isn't any good when I'm on a 1680x1050 22" LCD. I can manually resize the window to make it larger, but why aren't larger multiples available from the menu? For an example of what I'm looking for, bsnes goes up to 5x scaling, with 4x being optimal for me.

The other is that 'Maintain aspect ratio' forces the aspect ratio to multiples of 256x224. This is a perfectly valid option for various purposes, but there's no option for a correct aspect ratio, which would be multiples of 320x224. It does irritate me to see SNES video output squashed like this, when it was meant to be viewed at 4:3. Again, bsnes is my example of doing this right. It's my SNES emulator of choice right now.
BearOso wrote:You might have installed PortAudio in /usr/local instead of /usr,
Seems unlikely. I followed the instructions posted earlier, and PortAudio seemed happy that it had compiled correctly.
BearOso wrote:I'd definitely recommend compiling snes9x from source in this situation, if you're not already doing so.
I haven't, but I might as well.
BearOso wrote:I am certainly aware of the state of Linux audio, but there are a lot of issues with the APIs you list that made me decide on an obscure project like PortAudio. SDL's timer isn't finely-grained enough, OpenAL only does one channel unless you try to emulate stereo with 3D sources, OSS alone is often blocked by sound servers when a hardware mixer isn't present, and ALSA only runs on Linux. Since PortAudio works correctly with OSS and ALSA (and others), and is maintained, I chose to use it so I only had to write to one API.
I don't pretend to understand the issues behind all of this, I'm just annoyed that I'm spending hours messing with yet another audio API when I've got two other emulators working with audio APIs that required little (SDL) or no (OpenAL) configuration. This is the first time I've ended up having to compile stuff myself to get an audio API working, and it ended up pushing me over the edge.
BearOso wrote:I did leave things open so I could add another API easily, and OSS is fairly easy. If I'm feeling ambitious, I might add another driver over the next few days.
Well that would be nice if I can't get PortAudio to work.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

Rhapsody wrote: Well, the two that remain unfixed are that the only scaling options are 1x and 2x, which isn't any good when I'm on a 1680x1050 22" LCD. I can manually resize the window to make it larger, but why aren't larger multiples available from the menu? For an example of what I'm looking for, bsnes goes up to 5x scaling, with 4x being optimal for me.

The other is that 'Maintain aspect ratio' forces the aspect ratio to multiples of 256x224. This is a perfectly valid option for various purposes, but there's no option for a correct aspect ratio, which would be multiples of 320x224. It does irritate me to see SNES video output squashed like this, when it was meant to be viewed at 4:3. Again, bsnes is my example of doing this right. It's my SNES emulator of choice right now.
Ok, I've added a new 4:3 aspect ratio correction option in SVN. This is the same as the current Maintain Aspect Ratio option, where it adds the black bars. I've also added new resizing options, from 1x-5x for both square pixel and the 4:3 aspect ratios. bsnes does something a little different, resulting in a 21:16 aspect, which is apparently the correct NTSC result, but for now I went with the old 4:3 standby for simplicity.

I'll probably do the OSS driver next.
Rhapsody
Snes9x White Belt
Posts: 18
Joined: Tue Jul 11, 2006 7:00 pm

Post by Rhapsody »

BearOso wrote:Ok, I've added a new 4:3 aspect ratio correction option in SVN. This is the same as the current Maintain Aspect Ratio option, where it adds the black bars. I've also added new resizing options, from 1x-5x for both square pixel and the 4:3 aspect ratios. bsnes does something a little different, resulting in a 21:16 aspect, which is apparently the correct NTSC result, but for now I went with the old 4:3 standby for simplicity.

I'll probably do the OSS driver next.
This all sounds like very good news, thanks.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

byuu wrote: Why not use the ruby audio drivers from bsnes? They're public domain.
I certainly thought about it at first. Snes9x has a very weird strategy for generating samples that doesn't quite fit well with the ruby API. I haven't quite discovered how it works, and it's causing a bizarre latency pattern for my mostly done OSS driver. I'm still trying to figure out exactly how things are handled. I still might end up using ruby in the end. :-)
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Revision 68

Post by BearOso »

A new revision is available. This includes the changes previously discussed in the thread.
Rhapsody
Snes9x White Belt
Posts: 18
Joined: Tue Jul 11, 2006 7:00 pm

Post by Rhapsody »

Seems to all be working now. I had to install a non-working libportaudio2 from the repositories (because dpkg won't install the deb without it), but the OSS backend is working fine now that it's installed.
ChojinDSL
Snes9x White Belt
Posts: 1
Joined: Tue Mar 10, 2009 7:53 am

Post by ChojinDSL »

Wow, you ROCK!
Snes9x-gtk is becoming my favourite Snes Emulator.


Just a quick question, (sorry if its been asked before.)
Is there any chance of including 7zip support?

Some ROM sets come with a set of ROMS compressed as one 7zip file.
So for example "Chrono Trigger.7z" would have all versions (most of them identical anyway) of the ROM, e.g. Japanese, English, European, etc.

It would be cool if, when you select a 7z file to open in snes9x-gtk it allows you to select which ROM from the archive you wish to load.

I probably don't need to convince you of how much more efficient 7zip is at compression than classic Zip, but either way, its just an idea for a enhancement, nothing critical.
ganbare7
Snes9x White Belt
Posts: 4
Joined: Fri Mar 13, 2009 3:43 am
Location: Fredericton

Will Snes9x-gtk run in FreeBSD 7.1?

Post by ganbare7 »

I am most impressed that I have been able to compile Snes9x-gtk with ease in Ubuntu Hardy Heron and run a networked (netplay) game between my Desktop and laptop systems.

However I would most like to play Super Nintendo games over the net with my girlfriend who runs the latest incarnation of FreeBSD 7.1 and while the command

./configure --with-netplay works fine upon attempting to compile
using gmake (make fails fast) she gets this error:

src/gtk_sound_driver_oss.cpp: In member function 'virtual bool8 S9xOSSSoundDriver::open_device(int, bool8, int)':
src/gtk_sound_driver_oss.cpp:134: error: 'log2' was not declared in this scope
gmake[1]: ** [snes9x_gtk-gtk_sound_driver_oss.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/snes9x-1.51-src/gtk'
gmake: ** [all-recursive] Error 1

As far as I can tell she has all the required development libraries installed including portaudio and the OSS (Open Sound System).

At first I thought that maybe this only runs in Linux variants but I was surprised to learn that NetBSD has a snes9x-gtk package.

Any help in regards to successfully installing this wonderful emulator in FreeBSD 7.1 would be greatly appreciated.

Cheers,

Devin
Scudreloaded
Snes9x White Belt
Posts: 3
Joined: Fri Mar 13, 2009 5:18 am

this all of them?

Post by Scudreloaded »

I'm running ydl 6.1 on my ps3.
i cant get wireless or wired internet working currently. Maybe tomorro ill try again tho.
So i've been trying to download the required files to run this on my computer and then taking them to my room and putting em on manually.
does that GTK 2.10 link contain all of them?
when i try manually isntalling it says it needs frejack
and then it cant find some freebob dependency
and thats just when i try and get portaudio installed.
is there anyway this could be made into a simple single file RPM?
also, i assume that one version is already patched correct?
i unno. these instructions look confusing. im more used to just right clicking everything and telling it to isntall
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

ChojinDSL:
There's a lot of reasons why 7zip support probably won't happen. First, you're going to need external 7zip libraries because it's LGPL, not BSD licensed. I'd also have to implement multiple rom selection, which would either entail reading the 7zip header, which would require either a very recent lzma library that no one has, or decompressing the entire archive, thus defeating the whole point. I'd personally recommend you just decompress the 7z file and be done with it :-). If you're really adamant, file a feature request at the google code project.

ganbare7:
This is my fault. log2 isn't defined in BSD math headers. I've committed a fix to SVN, and I'll package a new release later.

Scudreloaded:
It's going to be much, much easier if you can get Internet access working. You'll be going back and forth a lot if you try to manually install packages, as there's a whole load of dependencies. After you get Internet access set up, I suggest you look at the PS3Bodega repository at http://pleasantfiction.ipower.com/bodeg ... ?f=11&t=21. Even then, it's not going to be as simple as a right-click install.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Revision 69

Post by BearOso »

Revision 69 is available.
ganbare7
Snes9x White Belt
Posts: 4
Joined: Fri Mar 13, 2009 3:43 am
Location: Fredericton

Post by ganbare7 »

Thanks BearOso for your quick reply and I was amazed to see a new revision as well. The base2log function change in the new revision did fix the problem described above so thanks so much for your help!

Unfortunately, me and my girlfriend spent all night trying different revisions...namely 61, 62, 67, and of course in the morning 69 but each time we got this compiler error:


src/gtk_sound_driver_portaudio.cpp:8: error: expected ',' or '...' before '*' token
src/gtk_sound_driver_portaudio.cpp:10: error: ISO C++ forbids declaration of 'PaStreamCallbackTimeInfo' with no type
src/gtk_sound_driver_portaudio.cpp: In member function 'virtual void S9xPortAudioSoundDriver::start()':
src/gtk_sound_driver_portaudio.cpp:54: error: 'Pa_IsStreamActive' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp: In member function 'virtual bool8 S9xPortAudioSoundDriver::open_device(int, bool8, int)':
src/gtk_sound_driver_portaudio.cpp:83: error: 'PaStreamParameters' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:83: error: expected `;' before 'param'
src/gtk_sound_driver_portaudio.cpp:85: error: expected initializer before '*' token
src/gtk_sound_driver_portaudio.cpp:106: error: 'param' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:112: error: 'Pa_GetHostApiCount' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:116: error: 'hostapi_info' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:116: error: 'Pa_GetHostApiInfo' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:120: error: 'paNotInitialized' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:128: error: 'paNotInitialized' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:163: error: 'Pa_GetHostApiCount' was not declared in this scope
gmake[1]: ** [snes9x_gtk-gtk_sound_driver_portaudio.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/snes9x-1.51-src/gtk'
gmake: ** [all-recursive] Error 1

So not sure what is going on here but if anyone has any advice on the steps needed to take to get this wonderful emulator running on FreeBSD that would be great! As for now, I will wait to make further posts until I actually install FreeBSD myself and try to get this working!

Thanks for your help BearOso and keep up the great work! Long live Super Nintendo emulation! :-)
Tukuyomi
Snes9x White Belt
Posts: 32
Joined: Mon May 24, 2004 4:14 pm
Location: France

Post by Tukuyomi »

I updated my translation file to match version 69 strings; here is the link:
http://kuro-hitsuji.net/~tukuyomi/stuff/fr_FR.po.gz
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

ganbare7 wrote:Thanks BearOso for your quick reply and I was amazed to see a new revision as well. The base2log function change in the new revision did fix the problem described above so thanks so much for your help!

Unfortunately, me and my girlfriend spent all night trying different revisions...namely 61, 62, 67, and of course in the morning 69 but each time we got this compiler error:


src/gtk_sound_driver_portaudio.cpp:8: error: expected ',' or '...' before '*' token
src/gtk_sound_driver_portaudio.cpp:10: error: ISO C++ forbids declaration of 'PaStreamCallbackTimeInfo' with no type
src/gtk_sound_driver_portaudio.cpp: In member function 'virtual void S9xPortAudioSoundDriver::start()':
src/gtk_sound_driver_portaudio.cpp:54: error: 'Pa_IsStreamActive' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp: In member function 'virtual bool8 S9xPortAudioSoundDriver::open_device(int, bool8, int)':
src/gtk_sound_driver_portaudio.cpp:83: error: 'PaStreamParameters' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:83: error: expected `;' before 'param'
src/gtk_sound_driver_portaudio.cpp:85: error: expected initializer before '*' token
src/gtk_sound_driver_portaudio.cpp:106: error: 'param' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:112: error: 'Pa_GetHostApiCount' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:116: error: 'hostapi_info' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:116: error: 'Pa_GetHostApiInfo' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:120: error: 'paNotInitialized' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:128: error: 'paNotInitialized' was not declared in this scope
src/gtk_sound_driver_portaudio.cpp:163: error: 'Pa_GetHostApiCount' was not declared in this scope
gmake[1]: ** [snes9x_gtk-gtk_sound_driver_portaudio.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/snes9x-1.51-src/gtk'
gmake: ** [all-recursive] Error 1

So not sure what is going on here but if anyone has any advice on the steps needed to take to get this wonderful emulator running on FreeBSD that would be great! As for now, I will wait to make further posts until I actually install FreeBSD myself and try to get this working!

Thanks for your help BearOso and keep up the great work! Long live Super Nintendo emulation! :-)
It's not finding PortAudio headers, which means the PortAudio library was detected, but the header is missing. I've checked the Makefile exclusion, and it's correct, so I don't know what's going on.

I suggest adding the --without-portaudio flag to configure, then do a make clean and try again to just build the OSS driver for now. I'll look and see if I can find any problems with the configure process.
ganbare7
Snes9x White Belt
Posts: 4
Joined: Fri Mar 13, 2009 3:43 am
Location: Fredericton

Post by ganbare7 »

Okay thanks BearOso! I will pass this valuable information along to my girlfriend! :D
ganbare7
Snes9x White Belt
Posts: 4
Joined: Fri Mar 13, 2009 3:43 am
Location: Fredericton

Okay, snes9x-gtk version 69 works on Freebsd 7.1

Post by ganbare7 »

Well, I had a friend install FreeBSD 7.1 from scratch and Snes9x-gtk compiled and installed perfectly fine. Then my girlfriend solved her portaudio problem by simply realizing that she had two different versions of portaudio installed so she deleted the older version and kept the lastest Portaudio2! And voila...it compiled and now I can play Secret of Mana with my girlfriend over the web!

Thanks a lot, BearOso for fixing, patching, and breathing new life back into snes9x! This emulator is extremely impressive and I am proud to run it! :wink:
Scudreloaded
Snes9x White Belt
Posts: 3
Joined: Fri Mar 13, 2009 5:18 am

Hmmmm

Post by Scudreloaded »

Can anyone other than the original poster comfirm this offline installation method?
cant the FreeBSD 7.1 ISO just be burnt and installed by ones self?
and which is specificly the best portaudio file to use. there are many on that website
Post Reply