View unanswered posts | View active topics It is currently Tue Sep 17, 2019 11:33 pm



This topic is locked, you cannot edit posts or make further replies.  [ 408 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 17  Next
bsnes v0.038 released 
Author Message
Post 
Quote:
So, if I'm reading it correctly, Qt-based open-source software can use a non-GPL license just as long as it's one of the licenses listed there. So you probably can't use a custom license, but at the very least it doesn't have to be GPL.


Yes, it just has to be a license others can convert to the GPL, acts just like the GPL (CDDL et al), or transfers ownership to the Q continuum.

Eh, maybe one of these days I'll write an elaborate inter-process communication wrapper to use Qt in closed source apps. Eg custom app speaks daemon API to daemon. Public domain daemon translates between its API and Qt, and forwards to Qt itself.


Wed Dec 17, 2008 12:23 am
Hazed

Joined: Sat Jul 22, 2006 8:43 pm
Posts: 55
Location: USA
Post 
Quick question about the forum: Shouldn't the "bsnes v0.038 to-do list" thread be unstickied and closed?

_________________
Pocky & Rocky? Pocky & Rocky? Pocky & Rocky?


Wed Dec 17, 2008 1:34 am
Profile
Gecko snack

Joined: Sun Aug 21, 2005 11:06 am
Posts: 2372
Location: Australia, QLD
Post 
or renamed to "bsnes v0.039 to-do list" and updated? :)

_________________
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64


Wed Dec 17, 2008 2:30 am
Profile WWW
Regular
User avatar

Joined: Tue Mar 07, 2006 10:32 am
Posts: 347
Location: The Netherlands
Post 
funkyass wrote:
should it not be

(x-a)³ = (x³ - 3ax² + 3a²x - a³)


Aah, you're right, I made a typo. Sorry, it was very late - I've fixed my posts.


Wed Dec 17, 2008 2:44 am
Profile
Trooper
User avatar

Joined: Mon Feb 20, 2006 3:11 am
Posts: 394
Location: Space
Post 
franpa wrote:
or renamed to "bsnes v0.039 to-do list" and updated? :)

*smacks Frampa for actually having a good idea for once*

Nice work Byuu, the new release is working fine here, no problems whatsoever. =)

_________________
Kega Fusion Supporter | bsnes Supporter | Regen Supporter


Wed Dec 17, 2008 2:52 am
Profile
Trooper
User avatar

Joined: Tue Apr 19, 2005 11:08 pm
Posts: 376
Location: DFW area, TX USA
Post 
byuu wrote:
Quote:
I did some testing and the speed hit was about 8%, though the lowest FPS was still well above 90, so I'm well in the clear of the 60 minimum I like to have.


Darn, only 90. At least v036 or so's S-DSP state machine approach boosted it 10% before this hit; so we're back to the same performance as then. And hopefully the delta queue method will pan out for some extra speed.


To be clear, the 95ish fps was the lowest point in the test. I just used the full intro loop to Chrono Trigger and compared FPS at various points in it. The highest point was over 150fps.


Wed Dec 17, 2008 4:53 am
Profile WWW
Rookie

Joined: Wed Jul 02, 2008 3:35 pm
Posts: 23
Post 
byuu wrote:
Eh, maybe one of these days I'll write an elaborate inter-process communication wrapper to use Qt in closed source apps. Eg custom app speaks daemon API to daemon. Public domain daemon translates between its API and Qt, and forwards to Qt itself.

I'm pretty sure Trolltech (well, Qt Software now, but I still call them Trolltech) wouldn't be happy about that. The whole reason Qt isn't under the LGPL is because then everyone could link their closed source apps to it (just like with GTK+), meaning they wouldn't have to purchase one of Trolltech's commercial licenses. That would be bad, since it's the primary way they make money off Qt. They'll probably not consider any license changes as long as Opera and Google are willing to pay them.

To me though, this seems like a bizarre way of getting around a problem that you invented for yourself. I really don't think anyone's going to try and fork bsnes at this point, and it's well-known enough that the users that actually matter to you wouldn't pay any attention to one now.


Wed Dec 17, 2008 4:46 pm
Profile
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
Thanks for the new release! I tested the new PulseAudio driver with Fedora 10 x86_64 (pulseaudio 0.9.13) and the results are strange. The sound quality is definitely better than the other PA option (openal -> sdl -> PA), but the emulation is not smooth. That is, it stops for a moment every few moments. I tried both PAL (Super Metroid) and NTSC (Lost Vikings II). It is also present in the other case, but in a lesser extent. I did not observe that behaviour when using OSS (alsa emulation) or ALSA. Can something be done to improve the situation?


Wed Dec 17, 2008 5:19 pm
Profile
Post 
Quote:
I'm pretty sure Trolltech (well, Qt Software now, but I still call them Trolltech) wouldn't be happy about that.


They chose the GPL, not me ;)
Seriously, too much work anyway. More of a joke post than anything.

Quote:
Can something be done to improve the situation?


Sure. Either fix the PulseAudio daemon, or find the bug in my driver:

Code:
    device.spec.format   = PA_SAMPLE_S16LE;
    device.spec.channels = 2;
    device.spec.rate     = settings.frequency;
    device.handle = pa_simple_new(
      0,                   //default server
      "ruby::pulseaudio",  //application name
      PA_STREAM_PLAYBACK,  //direction
      0,                   //default device
      "audio",             //stream description
      &device.spec,        //sample format
      0,                   //default channel map
      0,                   //default buffering attributes
      &error               //error code
    );
    //buffer.offset holds how many samples are in the buffer now, obviously
    pa_simple_write(device.handle, (const void*)buffer.data, buffer.offset * sizeof(uint32_t), &error);


That's it. Two API calls, and it isn't working right. What do you suggest I do to fix the fifth Linux audio API driver? :P


Last edited by byuu on Wed Dec 17, 2008 5:44 pm, edited 1 time in total.



Wed Dec 17, 2008 5:40 pm
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
OK, I'll try to make PA gurus look into it.


Wed Dec 17, 2008 5:44 pm
Profile
Post 
Cool. Wanna try making it into a sine wave generator app so they have an easier test case?

I mean, it's not as if it needs to be any simpler (you'd think they'd have debugged the one function I call to output audio ...), but yeah.

I don't have PulseAudio, so stabbing in the dark here ... if you could, please tweak this to actually compile and run on your side, if you don't mind.

Code:
#include <stdint.h>
#include <pulse/simple.h>
#include <pulse/error.h>

//PulseAudio simple test -- no error handling
int main() {
  pa_simple *handle;
  pa_sample_spec spec;
  uint32_t buffer[64];

  spec.format   = PA_SAMPLE_S16LE;
  spec.channels = 2;
  spec.rate     = 32000;

  int error = 0;
  handle = pa_simple_new(
    0,                   //default server
    "ruby::pulseaudio",  //application name
    PA_STREAM_PLAYBACK,  //direction
    0,                   //default device
    "audio",             //stream description
    &spec,               //sample format
    0,                   //default channel map
    0,                   //default buffering attributes
    &error               //error code
  );

  while(true) {
    for(unsigned i = 0; i < 64; i++) {
      int16_t sample = sin(i * 2 * M_PI / 64) * 0x2000;  //may need tweaking
      buffer[i] = (sample << 16) | sample;  //left and right
    }
    int error = 0;
    pa_simple_write(handle, (const void*)buffer, 64 * sizeof(uint32_t), &error);
  }

  pa_simple_flush(handle, &error);
  pa_simple_free(handle);
  return 0;
}


If you can get that to work; then it should work in bsnes, too.

(EDIT: fixed)


Last edited by byuu on Wed Dec 17, 2008 8:53 pm, edited 1 time in total.



Wed Dec 17, 2008 5:51 pm
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
I made that compile by changing buffer[buffer.offset++] to buffer[i], and it makes noise. Why bsnes stops every few secs then? To make myself clear, sound is perfectly fine, it's video that stops.


Wed Dec 17, 2008 6:57 pm
Profile
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
More info: I ran strace bsnes just in case, and the stops problem was gone. Due to increased CPU demand bsnes was not able to run 50/50 fps all the time, but the visible framerate was much more steady.


Wed Dec 17, 2008 7:45 pm
Profile
Regular
User avatar

Joined: Tue Mar 07, 2006 10:32 am
Posts: 347
Location: The Netherlands
Post 
Have you tried running any NTSC games? If you're syncing to video it's probably just duplicating a lot of frames because your refreshrate is higher than the framerate. Disabling sync to video will make it tear (by drawing outside VBlank) instead of duplicating frames, but the more closely your refreshrate matches the framerate of the game, the better it'll look.


Wed Dec 17, 2008 7:49 pm
Profile
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
I tried, and turning the sync option on and off does not seem to influence this behaviour.


Wed Dec 17, 2008 7:54 pm
Profile
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
Rhapsody wrote:
byuu wrote:
Eh, maybe one of these days I'll write an elaborate inter-process communication wrapper to use Qt in closed source apps. Eg custom app speaks daemon API to daemon. Public domain daemon translates between its API and Qt, and forwards to Qt itself.

I'm pretty sure Trolltech (well, Qt Software now, but I still call them Trolltech) wouldn't be happy about that. The whole reason Qt isn't under the LGPL is because then everyone could link their closed source apps to it (just like with GTK+), meaning they wouldn't have to purchase one of Trolltech's commercial licenses. That would be bad, since it's the primary way they make money off Qt. They'll probably not consider any license changes as long as Opera and Google are willing to pay them.

They actually did change the license, they now are under GPL3 too.

Unless my reading of GPL3 is way off, they now have a loophole which allows linking a library to a closed source app - yes the GPL3 sucks.

Oh and BTW, under GPL2, many open source programs in fact violate the license. You can't link to DirectX or anything that links to DirectX since you're merging with a closed source library. Basically ZSNES on Windows and a slew of other programs are illegal.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Wed Dec 17, 2008 7:54 pm
Profile WWW
Rookie

Joined: Wed Jul 02, 2008 3:35 pm
Posts: 23
Post 
Nach wrote:
They actually did change the license, they now are under GPL3 too.

Unless my reading of GPL3 is way off, they now have a loophole which allows linking a library to a closed source app - yes the GPL3 sucks.

What part are we talking about here? I've heard lots of talk about the GPLv3, but this one is new.

Nach wrote:
Oh and BTW, under GPL2, many open source programs in fact violate the license. You can't link to DirectX or anything that links to DirectX since you're merging with a closed source library. Basically ZSNES on Windows and a slew of other programs are illegal.

I thought section 3 covered that.

Quote:
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

Unless you actually include DirectX with the program, this exception should cover ZSNES perfectly well as DirectX is a part of Windows.


Thu Dec 18, 2008 12:56 am
Profile
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
Rhapsody wrote:
Nach wrote:
They actually did change the license, they now are under GPL3 too.

Unless my reading of GPL3 is way off, they now have a loophole which allows linking a library to a closed source app - yes the GPL3 sucks.

What part are we talking about here? I've heard lots of talk about the GPLv3, but this one is new.

I'll reread it and get back to you.

Rhapsody wrote:
Nach wrote:
Oh and BTW, under GPL2, many open source programs in fact violate the license. You can't link to DirectX or anything that links to DirectX since you're merging with a closed source library. Basically ZSNES on Windows and a slew of other programs are illegal.

I thought section 3 covered that.

Quote:
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

Unless you actually include DirectX with the program, this exception should cover ZSNES perfectly well as DirectX is a part of Windows.

You're looking at the wrong part, yes you don't have to include DirectX in your source package because it comes with the OS. However, you're still forbidden to link to it via the rest of the GPL.

Also under this section, you're required to ship with the source, the source to any libraries you use which aren't standard with the system, meaning that technically ZSNES must ship with libao source. Or that every Qt program has to ship with Qt source.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Dec 18, 2008 4:12 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
Here it is:
Code:
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

Translation:
If one wishes to compile a GPLv3 licensed component into another product which isn't an extension of the GPLv3 product (meaning the GPLv3 product is only used as a backend of sorts), then this other product is now called an "aggregate" IFF the other product doesn't add any restrictions to the use of each component it is built upon than those components originally came with, or to the user that they had prior to using the product.
Once deemed an aggregate, the GPLv3 does not infect the other parts of the other program.


Under this, I can now use any GPLv3 licensed product as a library, so long as I'm not extending the library, and merely using it as a backend for something. Provided I don't have my new product tell the user they have additional restrictions on using any GPLv3 backends or any other libraries I use beyond what those libraries come with, as a result of them using my product, or any global restrictions, such as by using this product you agree to never sue company X.
If the GPLv3 component was a backend alongside other interchangeable backends, then it is guaranteed that the inclusion of the GPLv3 component doesn't make the program any larger (i.e. additional capabilities) than it already is. In our case, using it as a method to draw to the screen, alongside other backends which do the same thing (although not necessarily on the same platforms).


My guess is, that the FSF in trying to close off using software patents in a product, define the GPL in embedded hardware, and wanting to link with other licenses, they somehow let this sneak in.

The original intention of this paragraph probably was intended to allow a GPLv3 program to ship alongside another program on an OS, or with some hardware, but they weren't careful enough with the wording.

This section also adds in new issues regarding GPL applications. If I want to buy a computer for my daughter, and have GPLv3 applications on it, I can't tell her that I'm giving her this computer on the condition she goes to bed every night at 9PM until she's in 6th grade, and stops arguing with her mother whether she can get earings or not. Unless it is clarified that these conditions I'm placing on her aren't legal restrictions, and there is no additional laws and governing system within the household, which isn't the case, as one can place restrictions on others for living on their property.

Which also means, that thanks to the GPLv3, I should only get my kids computers with Windows on it, and make sure no GPLv3 applications are in the mix of software I preinstall for them.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Dec 18, 2008 4:41 am
Profile WWW
Post 
Quote:
and which are not combined with it such as to form a larger program


That was pretty much my work-around suggestion for GPLv2: make the library not "part" of the program at the time of distribution, but very easy to make it one through simple user action.

Static linking through user compilation:

Let's say I were to support GTK+ and Qt inside my UI library, hiro. Inside the makefile, there's a line that says windows = "hiro.win", linux = "hiro.gtk".

User replaces ".gtk" with ".qt" and magically gets a Qt interface.

Could be tricky, as having Qt may make all of hiro GPL instead of PD. If that were the case, I'd have to make hiro a base PD lib that supports only Win32+GTK, and then make a "forked" project called hiro++ that has Qt support and is GPL. User would have to replace the hiro folder in my source archive before compiling.

Dynamic linking through library naming:

I distribute my app with hiro.gtk.so and hiro.qt.so. Inside the UI, there's a simple search for hiro.*.so, and it uses whatever it finds. The user simply installs the qt.so instead, and gets a Qt interface.

In fact, I really couldn't stop the latter if my UI lib were a dynamic link library. Anyone could make said wrapper.

Best part would be that its completely legal, as GPLv2,3 are distribution licenses, and do not govern usage in any way.

Again, hypothetical. I looked into a Qt port anyway, not to do this, but just to offer it, eg for my UPS patcher. Compiling Qt code was too much of a pain for me to bother. I'm sure Nach will disagree.


Thu Dec 18, 2008 6:22 am
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
The library isn't part of the program if you don't extend it.

Although we can argue if it somehow makes the program larger. However, it doesn't make the program larger if it's one of multiple backends.

Therefor for hiro, if the Qt part of hiro didn't include anything from the rest of hiro, it can be a stand alone backend, and not infect the rest of hiro to be GPL.

However, the workaround for GPLv2 won't work, as GPLv2 doesn't allow linking against non GPLv2 code, unless it can be virally "upgraded" to GPLv2.

However with GPLv2, I don't think anything prevents you from making it try to dynamically load GPLv2 objects during run time and make use of them.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Dec 18, 2008 6:58 am
Profile WWW
Rookie

Joined: Sat Aug 07, 2004 7:20 pm
Posts: 46
Post 
Might just be me being sleep depraved and everything, but, isn't this corner case also true for win32 or am I missing something here?


Thu Dec 18, 2008 7:31 am
Profile
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
wertigon wrote:
Might just be me being sleep depraved and everything, but, isn't this corner case also true for win32 or am I missing something here?

If you're referring to the licensing thing, then yes there are issues with using GPLv2 with the Win32 API.

Technically, most GPLv2 programs violate the GPLv2. However if you tell them that, they'll run away screaming.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Dec 18, 2008 7:56 am
Profile WWW
Post 
bsnes' source is getting really annoying to work with. If you look at src/interface.hpp, you'll see a carefully ordered list of header files, needed to get all of the various functions to inline across file boundaries. Look at ppu/counter.hpp and you see where I've resorted to wrapping functions I can't inline in headers that can't be included yet (circular dependency issues) so that the bulk of the functions can be inlined.

Why do I do this? Take this small example:
Code:
int compute(int x, int y) { return g(f(x, y), g(x, y)); }
int f(int x, int y) { return (x * 8) - (y * 4); }
int g(int x, int y) { return (x * 2) + y; }


If f,g are in a different source file, and you benchmark calls to compute(), it's literally ~15-20x slower.

But putting all of these speed-critical functions in header files is increasing compile time, hurting maintainability, etc. Not to mention all the benefits I could be getting if I inlined even more functions.

The solution to this problem is obvious, and Intel + Microsoft solved it five years ago: Link-time optimization. That is, compile each object to an intermediate language, then do all the machine translation inside the linker.

Visual C++ calls it LTCG, Intel C++ calls it PGO. Naturally, GCC only has --combine for pure C89, so I'm screwed.

... or am I? What if I were to make a special "release" target for GCC in my Makefile ... take all of the source files, spit them out into a file called lto.cpp, then compile and link that as if it were one gigantic object.

It would eat an insane amount of memory, take an eternity to compile, etc; but I think it could work. And, if we're lucky and GCC catches up in the next ten years, we can just convert that back to a compiler switch like the modern compilers have (/LTCG et al.)

Thoughts?

Quote:
Therefore for hiro, if the Qt part of hiro didn't include anything from the rest of hiro, it can be a stand alone backend, and not infect the rest of hiro to be GPL.


That's excellent news. Encourages me to take another stab at hiro::qt sometime.

Quote:
However, the workaround for GPLv2 won't work, as GPLv2 doesn't allow linking against non GPLv2 code, unless it can be virally "upgraded" to GPLv2.


Yeah. For this at least, it's Linux we're talking about. The user would be doing the linking themselves. And since it's a distribution license, so long as they keep it for personal use, they aren't violating anything. And even if they were, who cares? Nobody will know.


Thu Dec 18, 2008 8:49 am
Lurker

Joined: Wed Jul 28, 2004 1:35 am
Posts: 128
Post 
Try compiling it in LLVM instead of gcc.

I think the two relevant features are:

1. "Front-ends for C and C++ based on the GCC 3.4 and 4.0.1 parsers. They support the ANSI-standard C and C++ languages to the same degree that GCC supports them. Additionally, many GCC extensions are supported. "

2. "It supports a life-long compilation model, including link-time, install-time, run-time, and offline optimization."


Thu Dec 18, 2008 4:48 pm
Profile ICQ YIM
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 408 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 17  Next

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.