SFML community forums

Bindings - other languages => DotNet => Topic started by: s.baus on March 18, 2015, 03:11:10 pm

Title: Performanceproblems with 2.2?
Post by: s.baus on March 18, 2015, 03:11:10 pm
Hello everybody,

I'm facing performanceproblems when setting the PlayingOffset with 2.2. Is there anything known? With an ogg file with a length of about 2 hours, setting the PlayingOffset to lets say about 1hour 30 minutes, I need to wait about 30 seconds for the code to run on. Is anybody facing this problem?

Thanks for your help
Sven
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 18, 2015, 03:17:27 pm
Do you mean that this problem didn't happen with SFML 2.1?
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 18, 2015, 03:53:33 pm
I just did a retest with 2.1, i'm also facing the problem with this release :(. Sorry for bothering you. Just tested it with mp3 (I did myself), that works performant, but ogg has pour performance. Are there any plans to tweak the performance?
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 18, 2015, 04:31:45 pm
Nothing changed with regards to playing offsets in the bindings. Show complete and minimal example that reproduces it.
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 19, 2015, 07:41:30 am
Well, I'm not sure any more, if it has to do with the bindings, or is a problem of SFML itself. When I set a new music object with the ogg file from above it also hangs about 5 till 10 seconds. If I set the PlayingOffset more at the end, the thread stops longer than if I set the PlayingOffset more to the start. Seems like the stream seeking is a bit unperformant, but has anybody else problems with this?
Title: Re: Performanceproblems with 2.2?
Post by: Dejan Geci on March 19, 2015, 08:01:14 am
Reproduced:
namespace OggSlowdown
{
  using SFML.Audio;
  using SFML.System;

  class Program
  {
    static void Main(string[] args)
    {
      var oggMusic = new Music("Mixdown.ogg"); // Use attached file
      oggMusic.PlayingOffset = Time.FromSeconds(60 * 60); // Slowdown here
      oggMusic.Play();
    }
  }
}
 
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 19, 2015, 01:41:24 pm
I tried your file, and sure SFML slows down with it... but there is something wrong with the file. VLC Media Player won't read that file right and neither will Audacity.
Title: Re: Performanceproblems with 2.2?
Post by: Dejan Geci on March 19, 2015, 01:50:18 pm
I used Studio One to generate an empty ogg file, tested it in Winamp and it worked fine.

I will re-check it with another ogg.
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 19, 2015, 02:22:08 pm
Ok, I did more digging, the entire freeze happens within libsndfile. So either the freeze has been around for 4+ years (https://github.com/SFML/SFML/tree/2.2/extlibs/bin/x86) when seeking or libsndfile has magically changed. Either way its not a problem with the bindings.
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 19, 2015, 02:23:15 pm
You could try with the latest SFML sources, now that we don't use libsndfile anymore.
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 20, 2015, 08:00:40 am
You could try with the latest SFML sources, now that we don't use libsndfile anymore.

Is it possible to get the SFML and CSFML compiled? I'm not able to build them myself, just managed to build the SFML.Net myself.
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 20, 2015, 08:46:44 am
There are nightly builds, but I don't know if they are recent enough.
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 20, 2015, 12:42:49 pm
I'm not guaranteeing anything... but I tried the latest SFML master and it didn't freeze when seeking.

http://zbrown.net/download/CSFML+Master+-+57d3ee0d8973aa3b81540fe6fa7202fa68044212.zip
Title: Re: Performanceproblems with 2.2?
Post by: Dejan Geci on March 20, 2015, 02:11:00 pm
Tested with your CSFML build and there was no slowdown. Most likely and issue with libsndfile, as Laurent suggested.
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 20, 2015, 03:21:23 pm
Since I use the bindings also on linux, what are the plans for a release 2.3? Or can you update the 2.2? release to work with the SFML master build?
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 20, 2015, 03:59:08 pm
Quote
what are the plans for a release 2.3?
Soon :D

Quote
Or can you update the 2.2? release to work with the SFML master build?
I don't think there will be a SFML 2.2.1. There are too few critical bugs, and 2.3 is almost complete.
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 20, 2015, 04:02:13 pm
Since I use the bindings also on linux, what are the plans for a release 2.3?

If you are on linux why don't you just build it yourself then? It is super easy compared to windows.

Quote
git clone https://github.com/SFML/SFML.git
cd SFML
cmake .
make install
cd ..
git clone https://github.com/SFML/CSFML.git
cd CSFML
cmake .
make install
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 25, 2015, 03:48:04 pm
There are nightly builds, but I don't know if they are recent enough.

I found this site (http://www.nightlybuilds.ch/) here, but the nightly builds are from january. Who is responsible for this site?
Since I use the bindings also on linux, what are the plans for a release 2.3?

If you are on linux why don't you just build it yourself then? It is super easy compared to windows.

Quote
git clone https://github.com/SFML/SFML.git
cd SFML
cmake .
make install
cd ..
git clone https://github.com/SFML/CSFML.git
cd CSFML
cmake .
make install

I tried this, but failed at the SFML build:
Quote
-- Could NOT find LIBXCB_ICCCM (missing:  LIBXCB_ICCCM_LIBRARY)
CMake Error at cmake/Modules/FindXCB.cmake:93 (message):
  xcb-icccm not found
Call Stack (most recent call first):
  src/SFML/Window/CMakeLists.txt:196 (find_package)
Title: Re: Performanceproblems with 2.2?
Post by: zsbzsb on March 25, 2015, 03:58:21 pm
If you are using linux as a developer you should be capable of reading error messages and understanding them. It says exactly what is wrong, a lib SFML depends on is missing so you should install it.

http://www.sfml-dev.org/tutorials/2.2/compile-with-cmake.php

And eXpl0it3r is responsible for the nightly builds site (easily discoverable if you spent 2 minutes clicking the buttons at the top of the site), but I don't know what you plan on doing with that information, force him to update?
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 26, 2015, 09:00:31 pm
I just thought it would be easier to get a nightly build, than to build SFML myself, since I use the framework not to worry about underlying stuff.

If eXpl0it3r could do an update, that would be really nice.
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 30, 2015, 11:28:19 am
I tried a build myself, SFML just got installed nice, but I can't get CSFML to build properly:

Quote
[root@localhost CSFML-master]# cmake .
CMake Error at src/SFML/CMakeLists.txt:26 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2) with any of the following names:

    SFMLConfig.cmake
    sfml-config.cmake

  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/home/sven/Downloads/CSFML-master/CMakeFiles/CMakeOutput.log".

How do I set the SFML_DIR variable?
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 30, 2015, 11:43:41 am
Forget about what CMake says. The documentation for this is in the FindSFML.cmake file (shipped with SFML).
Title: Re: Performanceproblems with 2.2?
Post by: s.baus on March 30, 2015, 01:07:57 pm
Well, whats the problem then? I'm not familiar with cmake.
Title: Re: Performanceproblems with 2.2?
Post by: Laurent on March 30, 2015, 01:23:34 pm
You must install SFML, and put FindSML.cmake where CMake can find it when you configure CSFML. Then, if SFML is not installed in a standard path, you must define the SFML_ROOT CMake variable when configuring CSFML.