fishBMC

  Thread Rating:
  • 2 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #1
Hi all!

I have started porting my sound visualisation program "fische" to XBMC. There's a first screenshot at http://26elf.at.
However, there's one question that immediately arises: how can I get a higher framerate?
CPU is at 12 percent, framerate around 10 per second, no (intentional) delays in my code
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 4,004
Joined: Dec 2007
Reputation: 10
Post: #2
Impossible to answer that without the code and the hardware and OS you are developing it on/for.

I'd suggest reading up on optmization tricks for OpenGL / DirectX / OpenGLES

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
jme Offline
Junior Member
Posts: 24
Joined: Feb 2005
Reputation: 0
Location: Sweden
Post: #3
Looks nice!

Do you have a multicore cpu? 12% might not seem like much but if you have 8 cores or 4 cores with hyper threading enabled your actually maxing your cpu in a single threaded application. So you need to do cpu optimization or add support for multithreading.

If cpu doesnt seem to be a problem. Try disabling your blending. Does that have a high impact on the frame rate. Blending is very slow so it might and you seem to do a lot of it. Then you can try to disable other parts of the visualizer one at a time and see how the frame rate changes to pinpoint the cause. But looking though some GPU optimization guides is a good idea since there can be a lot of different bottlenecks (pixelshader, vertexshader, fillrate, texture bandwidth to name just a few). Nvidia has some good tools for it if you have a nvidia card. Not sure how well they work in XBMC though.

Current project Plane9 a 3d music visualizer/sound responsive screensaver. Author of the planestate, matrix trails, asteroids and ping pong xbmc screensavers.
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #4
Thanks you for your advice. All CPU intensive operations are multi-threaded (i.e. 4 threads on my 4-core CPU). I will be looking into OpenGL optimisations.
Here's the code that matters:
Code:
    glEnable (GL_BLEND);
    glEnable (GL_TEXTURE_2D);
    glDisable (GL_DEPTH_TEST);

    glMatrixMode (GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrtho (-1, 1, -1, 1, -1, 1);

    glMatrixMode (GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    
    glPolygonMode (GL_FRONT, GL_FILL);

    glBindTexture (GL_TEXTURE_2D, fishbmc_texture);

    // get a lock on the texture pixels
    while (!screenbuffer->lock())
        usleep (1);
    
    // update texture
    glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, configuration->width(), configuration->height(), GL_RGBA, GL_UNSIGNED_BYTE, pixels);
    
    screenbuffer->unlock();

    glBegin (GL_QUADS);
    glTexCoord2f (fishbmc_left, 0.0f);     glVertex3f (-1.0f, -1.0f, 1.0f);
    glTexCoord2f (fishbmc_right, 0.0f);    glVertex3f (1.0f, -1.0f, 1.0f);
    glTexCoord2f (fishbmc_right, 1.0f);    glVertex3f (1.0f, 1.0f, 1.0f);
    glTexCoord2f (fishbmc_left, 1.0f);    glVertex3f (-1.0f, 1.0f, 1.0f);
    glEnd();

    glPopMatrix();
    glMatrixMode (GL_PROJECTION);
    glPopMatrix();
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #5
Disregard all after good morning...

The bad frame rates were caused by pulseaudio running. Works flawlessly without.
find quote
crash123 Offline
Senior Member
Posts: 260
Joined: Oct 2008
Reputation: 0
Location: New Plymouth, New Zealand
Post: #6
Looks good. Keep up the good work, i'm looking forward to it.

[Image: crash1235.gif]
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #7
neat. looks like it's just a quad so maybe some helpful chaps in here can port to dx as well..
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #8
spiff Wrote:neat. looks like it's just a quad so maybe some helpful chaps in here can port to dx as well..

Shouldn't be any problem at all. Just a textured rectangle, nothing else.
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #9
I noticed the "SetSetting" function never gets called - is this normal (and if so, what do I do instead to let the user choose parameters) or have I missed something?
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #10
I have posted some more screenshots at 26elf.at
find quote
Clumsy Offline
Team-XBMC Forum Moderator
Posts: 641
Joined: Feb 2004
Reputation: 0
Post: #11
Looks cool, looking forward to it !

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #12
--OUTDATED-- --OUTDATED-- --OUTDATED-- --OUTDATED-- --OUTDATED-- --OUTDATED--
You can download fishBMC sources from: fishBMC-3.2.0.tar.gz

So far it's an "experts only" release, but I'll try to make installation more user friendly.
(This post was last modified: 2011-01-27 17:36 by idefixs.)
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #13
In addon.xml, I can specify library_linux, library_osx, and so on...
BUT: How do I tell the system which bitness to use? Do I have to create two addon packages for 64/32bit?
find quote
idefixs Offline
Junior Member
Posts: 35
Joined: Jan 2011
Reputation: 0
Location: Austria
Post: #14
I have made an Add-On available here: 32bit 64bit
There's also a repo available here

ATTENTION: So far, only Linux 64-bit is tested. If you have success on other platforms, let me know.
(This post was last modified: 2011-01-19 12:27 by idefixs.)
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #15
idefixs Wrote:I noticed the "SetSetting" function never gets called - is this normal (and if so, what do I do instead to let the user choose parameters) or have I missed something?

Hello Idefixs !

I made the latest Refactor of ProjectM, Milkdrop settings handling. I can help you if you have any question regarding this.

I can tell that the SetSetting() function is get called each time when the visualization starts multiple times going through all settings you have in settings.xml. And of course when any setting is changed in GUI. For example if you check opengl spectrum's code

https://github.com/xbmc/xbmc/blob/master...m.cpp#L354

this function gets called 3 times with *strSetting values "mode", "bar_height", "speed" and their values in "value".

Note that the visualization gets stopped and restarted with screen changes.

There is even the possibility now that the visualization can save its own state like used preset, preset locked status. You can see this for example at Milkdrop code:

https://github.com/xbmc/xbmc/blob/master...C.cpp#L265

If you have any questions regarding this, just ask. Cheers, Alan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply