José Roca Forum
Web Site
News: Version 1.16 of the Windows API headers released
 
*
Welcome, Guest. Please login or register. September 09, 2010, 02:33:40 PM


Login with username, password and session length


PowerBASIC is a trademark of PowerBASIC, Inc.
This is not an official PowerBASIC site and we are not affiliated with PowerBASIC, Inc.
DISCLAIMER: The software and accompanying documentation are provided "as is" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. Because of the various hardware environments into which the software may be used, no warranty of fitness for a particular purpose is offered. The user must assume the entire risk of using the software. In no case shall any of the contributors to this project be liable for any incidental, special or consequential damages or loss, including, without limitation, lost profits or the inability to use equipment or access data. This is true even if we are advised of the possibility of such damages. We also don't have any obligation of fix eventual bugs or to add new features.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 »   Go Down
  Print  
Author Topic: BassBox  (Read 125660 times)
0 Members and 1 Guest are viewing this topic.
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #375 on: January 07, 2008, 11:31:39 PM »

These are two versions of Soundscape which should be free of glErrors, one of which Petr located in the Stars.

1. Soundscape.dll - a corrected version of the original with snowy peaks.

2. SoundscapeA.dll - an updated and racy version where the landscape is terraformed at the horizon, and flies forward at considerable speed.

I have switched back to using GDIplus. It is a little more suitable for our needs, but the FreeImage commands are still present in the TexImage Function, commented out. And it is nice to know that switching between the GDIplus and FreeImage is so easy.
Logged
Kent Sarikaya
Sr. Member
****

Karma: 3
Offline Offline

Posts: 466



« Reply #376 on: January 08, 2008, 12:56:14 AM »

Thanks Charles, the new A version is working nice and quickly but alas the flicker is back. The regular soundscape is working fine however now.
It must be something in my video card settings or installation as I am the only one having any problems, so don't worry about it.
I like this new version as the motion forward seems more natural and seeing the terrain in front spawning is nicer!
Logged
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #377 on: January 10, 2008, 10:43:07 PM »

Kent, this is an attempt at resolving the flickering problem. If it happens on your PC, it is bound to happen on others.

The scene rendering system is now two stroke. The first phase, prepares landscape strips and compiles them as required. The second phase deals exclusively with rendering. So glList building is not mixed in with scene rendering any more.

This plugin generates timing data in a file called SoundScapeReport.txt in the BBplugin folder.

Timings vary a lot but a typical set of figures on my PC looks like this:
Code:
Soundscape Diagnostics

Time Stamp Values in NanoSeconds:

Phase 1 prepare scene:  270763
Phase 2 render scene:   560572
2 Frame Interval:       33073730
wglMakeCurrent:         186194
clear buffers etc:      6574

Error checks:           0    0             0

The rendering only takes about 2% of CPU time and this does not seem to change by going into Max mode on my system.

« Last Edit: January 10, 2008, 10:47:13 PM by Charles Pegge » Logged
Kent Sarikaya
Sr. Member
****

Karma: 3
Offline Offline

Posts: 466



« Reply #378 on: January 11, 2008, 02:54:36 AM »

Thanks Charles, sorry to report flicker is there for soundscapeA, but soundscape original is fine.
The flicker is incredibly noticeable, and can be called tearing at fullscreen.

I do have vertical synch on in my video card as it says video synch set on with triple buffering gives good performance in speed. And I need that with this card as it is slow.

Here is my report listing, nice idea:
Code:
Soundscape Diagnostics

Time Stamp Values in NanoSeconds:

Phase 1 prepare scene:  18724440
Phase 2 render scene:   792080
2 Frame Interval:       80632500
wglMakeCurrent:         192911
clear buffers etc:      4451

Error checks:           0    0             0

Added after original post above:
Ok, I turned off vertical sync and disabled triple buffering, it cleared the problem. My frame rate went from 62fps to 66. Fullscreen there is a flicker now with 22fps but no massive tearing as before, obviously caused by slow video card.

Here is speed report with turned off settings:
Code:
Soundscape Diagnostics

Time Stamp Values in NanoSeconds:

Phase 1 prepare scene:  25743
Phase 2 render scene:   849023
2 Frame Interval:       58839843
wglMakeCurrent:         281991
clear buffers etc:      9880

Error checks:           0    0             0
« Last Edit: January 11, 2008, 03:14:27 AM by José Roca » Logged
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #379 on: January 11, 2008, 04:34:19 AM »

Thanks Kent, that is very interesting. It may well be that Max Mode on 1280x1024 resolution is too close to the edge for many video cards. All the full-screen video games I have seen so far turn the resolution way down. This is disguised by clever shading but if you look at the screen closely, you can see how blocky they are. Online Java driven games tend to work the other way, often limiting the viewport to postcard size.

But hardware specs are evolving so rapidly - what was state-of-the-art four years ago is now standard kit for home PCs, so these limitations are likely to be very transient.

The performance data, averaged out over several frames can be used to control features or quality level.

The curious thing is that the Original Soundscape uses much more CPU than the new one - the entire landscape is generated with every frame without using glLists for the strips of landscape, yet your video card can handle it. Vulcan also works the video quite hard in terms of polygon count but mostly on a pre-compiled glList. I wonder if the performance of your card is limited by old drivers.

Logged
Petr Schreiber
Sr. Member
****

Karma: 9
Offline Offline

Posts: 420


« Reply #380 on: January 11, 2008, 06:37:17 PM »

Hi Charles,

SoundscapeA rocks! That is exactly what I like!

Regarding technical issues, I still cannot see any problem here,
only tricky think could be creating display lists on the fly, not only in INIT section. I think this can make driver a bit scared, but as openGL reports no errors ... very interesting.

Regarding report, here it goes:
Code:
Soundscape Diagnostics

Time Stamp Values in NanoSeconds:

Phase 1 prepare scene:  16404
Phase 2 render scene:   883135
2 Frame Interval:       52824353
wglMakeCurrent:         129685
clear buffers etc:      176199

Error checks:           0    0             0

Kent, by flicker do you mean low framerate or really pulsing screen as on ZX spectum when too much lines rendered in combination with clear screen Smiley ?


Thanks,
Petr
« Last Edit: January 11, 2008, 06:39:44 PM by Petr Schreiber » Logged

AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #381 on: January 11, 2008, 07:48:04 PM »

Thanks Petr, if we can get this working reliably, the technique can be used for generating all sorts of non-repeating terrains.

Kent,

To test the hypothesis that generating gLists on-the-fly is causing the flicker I have added an invisible control to this version of Soundscape.

If you click on the top left corner of the scene (within 100 pixels) the landscape loop will be locked, and the landscape strip lists will not be renewed. The terrain will repeat itself in an endless loop and you will see gaps where it turns over. Clicking again will unlock the landscape enabling list generation again.

Locking the landscape in this way should eliminate the flicker. If not, then the problem lies elsewhere.

Thanks!

Logged
Patrice Terrier
Global Moderator
Hero Member
*****

Karma: 36
Offline Offline

Gender: Male
Posts: 1353


WWW
« Reply #382 on: January 11, 2008, 09:01:22 PM »

Indeed I can also see, from time to time, a kind of fugace redrawing echo that occured on the bottom of the screen especialy when there is a sound peak level

For me this is more an error in the programming loop, than a video graphic card problem.

I think that it occures while the current audio is being moved at the end of the list, then sometimes the peak are drawn hover the first plan, "looking like" flickering.

...

Logged

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
Kent Sarikaya
Sr. Member
****

Karma: 3
Offline Offline

Posts: 466



« Reply #383 on: January 12, 2008, 01:54:40 AM »

Guys, thanks for new versions. In regular screen size, it works fine. When I go fullscreen it steps and that is probably because of my video card not being able to handle the resolution at fullscreen.

Clicking on the corner made no difference in the stepping /flicker like feel. So it has to be my card. Since it runs fine at normal screen size, I am very happy, that is what I normally run it at unless I go to the couch and just relax and watch and listen from there.
Logged
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #384 on: January 12, 2008, 07:16:43 AM »

Well that indicates the technique is basically sound, thank you Kent. I will just have to watch out for fall-offs in performance.

Another thing you may have noticed is that if you click on the Vulcan scene, the terrain stops moving momentarily - the picking procedure seems to be inefficient at checking through a large number of polygons. - it seems to be much slower than rendering, - probably doing most of the work client-side. So I'll have to simplify the scene construction when in SELECT mode, which can be easily done by reducing the recursion level. Each step reduces the polygon count by a factor of 4.

Patrice, I'll see if there is a way of clamping the frame rate more precisely. I think it can be done on the Plugin side, locking into 60 fps for example. This would help slow moving plugins.
Logged
Patrice Terrier
Global Moderator
Hero Member
*****

Karma: 36
Offline Offline

Gender: Male
Posts: 1353


WWW
« Reply #385 on: January 13, 2008, 04:41:13 PM »

--Charles

I have attached a modified version of SoundscapeAA.bas using WimDATA instead of FFT and a new OGG file to help you diagnostic the problems.

While playing bennybenassi.ogg you will see the flickering when there are huge peak levels, and also the sound distortion that could occure when playing full screen.

As i said already, the flickering is caused by the current curve being drawn in the front before being moved in the background.

To see the change i have done, search for '//PATRICE in the source code.

...
 
« Last Edit: January 14, 2008, 03:30:53 PM by Patrice Terrier » Logged

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #386 on: January 13, 2008, 09:59:19 PM »

Scary peaks and fortresses of harmonics! After securing my speakers to the floor with Monti bolts, I played in full screen mode. but no audio distortion occurred on my XP machine.

In this version I have put in an attenuation function so their size will always be limited no matter what the volume might be - the peaks will scale down. Normal sensitivity is restored between tracks, when there is a mute period. Peaks at the very front will shrivel to minimise flashing in front.

Many thanks for giving this your attention Patrice, I hope the above steps will resolve the audio distortion on your system.

Code:
                 DO
                     IF k>=64 THEN EXIT DO
                     v=SQR(fft(k))*8*atten
                     IF v>4 THEN atten=4/v ' attenuation
                     IF v=0 THEN v=RND*.4: atten=1 ' restore sensitivity
                     vf(i1)=v
                     'vf(i1)=vf(i1)*.5+SQR(fft(k))*4 ' averaged height
                     INCR k: INCR i1
                 LOOP

Logged
Patrice Terrier
Global Moderator
Hero Member
*****

Karma: 36
Offline Offline

Gender: Male
Posts: 1353


WWW
« Reply #387 on: January 14, 2008, 12:44:26 AM »

--Charles

The new Soundscapea version solved the loop problem that caused the "flickering".

There is still sound distortion, however it could be very limited in using
v=SQR(fft(k+8))*8 ' avoid to use the first FFT values to suppress sharp drawing on the left side
instead of
v=SQR(fft(k))*8*atten



Code:
Soundscape Diagnostics

Time Stamp Values in NanoSeconds:

Phase 1 prepare scene:  21584748
Phase 2 render scene:   953664
2 Frame Interval:       41847564

Frame interval rt       :    2.09685867896618E-2
Frame per sec rtt       :    47.6903861014149

QueryPerformance Frequency:  14318180
QueryPerformance Counter:    50001799164
Time Stamp:                  6968873829435

Error checks:           0    0             0
« Last Edit: January 14, 2008, 12:53:36 AM by Patrice Terrier » Logged

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
Charles Pegge
Global Moderator
Hero Member
*****

Karma: 19
Online Online

Posts: 648



WWW
« Reply #388 on: January 14, 2008, 06:27:01 AM »

Yes adding an offset of 8 to avoid the base frequencies, gives a more even landscape. I have tried it with a variety of music and it looks okay. The base frequencies are quite interesting so I can still use them in another way.

But that that help to improve the audio quality on your PC?

The diagnostics show quite a high frame rate (it measures pairs of frames.). It should be around 30-33 but your sample shows 47 fps. The test only measures the last frame pair but I have not seen a figure that high on my machine.
Logged
Patrice Terrier
Global Moderator
Hero Member
*****

Karma: 36
Offline Offline

Gender: Male
Posts: 1353


WWW
« Reply #389 on: January 14, 2008, 03:29:37 PM »

--Charles

Yes, using an offset of 8 suppresses the lows level frequencie peak on the left and help to produce a softer landscape drawing.

I use the bennybenassi.ogg file to stress all my visual plugins and see if they don't produce audio distortion without using the equalizer. Of course if your turn On the equalizer altogether with bass boost, it is quite easy to produce saturation that would cause sound distortion.

My sample shows 47 fps, because I am using VISTA that is highly optimized to perform 3D operation and is a top notch for any intensive graphic application, on that aspect BassBox is a very good prototype to fetch the DWM VISTA limits.
All my tests are done in dual screen mode, with BassBox runing in 1680 x 1650 in plain 32-bit mode and full DWM composited mode.

The same thread handles OpenGL and GDIPLUS (the drawing of the view meter + oscilloscope). Audio decoding is processed in another thread.

...
« Last Edit: January 14, 2008, 11:22:02 PM by Patrice Terrier » Logged

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 »   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

IMPRESSUM
Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.26 seconds with 19 queries.