Beta release 3.1b

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas » Thu Sep 04, 2014 12:17 pm

nice addition really , but there is some performance issue , the player take long time to start playing big ogg files ( 3min.... ) .

i suggest using :
http://code.google.com/p/zengl/source/b ... ib_ogg.pas

its much faster .

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Thu Sep 04, 2014 4:25 pm

Ville, Kjell, others, do you know how to effectively pause and resume OGG sample playing? Another feature would be to get/set playing position.

User avatar
Kjell
Posts: 1669
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Thu Sep 04, 2014 5:04 pm

Hi airpas
airpas wrote:nice addition really , but there is some performance issue , the player take long time to start playing big ogg files ( 3min.... )
Only had a quick glance at the source, but it seems that OGG files are decoded entirely before they start playing. In that case there's still a lot of room for improvement ( by decoding only the section that is needed for playback during the next frame ).

@Rado1 - Other than setting BaseNoteNr to the inverse of what you used as NoteNr in PlaySound ( with ByReference enabled ) i don't know any tricks :(

K

BeRo
Posts: 12
Joined: Tue Nov 11, 2008 3:57 am

Post by BeRo » Thu Sep 04, 2014 8:19 pm

Ville: Can you implement on-the-fly-decoding-while-playing for bigger .OGG's also? You can find example source for it in my mail from the last month. Because bigger .OGG's (for background music and so on) are no longer a load-time-performance issue then.

And for mobile devices with slower CPUs, you can use the C version of the ported library, which I've sent also to you last month :)

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Fri Sep 05, 2014 9:04 am

airpas wrote:i suggest using :
http://code.google.com/p/zengl/source/b ... ib_ogg.pas

its much faster .
Because it uses an external library :). For the built-in components in ZGE I like to have all functionality in single exe-file. You can use external libraries to play music in ZGE already thanks to the work that Rado1 have done.

Yes, there is still work to be done on performance/memory requirements. Using the Sample-component that allows SampleExpression is the nicest way to integrate the library (because then Samples work like other procedural content in ZGE: bitmaps and meshes) but the way the Sample compoent is designed requires it to be fully decompressed before playback which has some obvious disadvantages. I'll see what I can do.

User avatar
Kjell
Posts: 1669
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Fri Sep 05, 2014 10:14 am

Hej Ville,
VilleK wrote:Using the Sample-component that allows SampleExpression is the nicest way to integrate the library (because then Samples work like other procedural content in ZGE: bitmaps and meshes) but the way the Sample compoent is designed requires it to be fully decompressed before playback which has some obvious disadvantages.
How about a Streaming checkbox on the Sample component? When enabled only the samples required for playback are decoded ( in case of a OGG ) / generated ( executing any SampleExpressions ) on the fly .. which could also serve as a foundation for custom real-time synthesizers ( such as SFXR ).

K

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Fri Sep 05, 2014 12:49 pm

Kjell, that is a good suggestion. Only I'm not sure that ZGE scripting is fast enough to generate samples in the speed that the audio thread requires. So SampleExpressions might not be possible that way, at least not on mobile.

Meanwhile, I made some small changes in ZGE to make sample loading faster and also reduce memory overhead.

http://www.zgameeditor.org/files/ZGameEditor_beta.zip

BeRo
Posts: 12
Joined: Tue Nov 11, 2008 3:57 am

Post by BeRo » Sat Sep 06, 2014 7:27 am

VilleK wrote:Kjell, that is a good suggestion. Only I'm not sure that ZGE scripting is fast enough to generate samples in the speed that the audio thread requires. So SampleExpressions might not be possible that way, at least not on mobile.

Meanwhile, I made some small changes in ZGE to make sample loading faster and also reduce memory overhead.

http://www.zgameeditor.org/files/ZGameEditor_beta.zip
You can try on-the-fly dynamic native code generation for x86 (and ARM) like how I'm doing it in my aulan stuff, which is a audio-oriented programming language from me together with a compiler which generates fast native x86 code, which i've used at my demoscene 64k and 8k farbrausch intro productions: https://www.youtube.com/watch?v=ezlx_DqfiSM and https://www.youtube.com/watch?v=U-eMhwPwptw and https://www.youtube.com/watch?v=a2q8V7vsAyA . techtalk from me and my workmate red about it: https://www.youtube.com/watch?v=HV3S_H28s2E .

airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas » Sat Sep 06, 2014 10:46 am

Hi BeRo ,
wow , you've made some real interesting stuff
about using your BeRoAudioOGGVorbisTremor in android , do you think (fpc trunk ) can optimize your library better, especially they add alot of improvment for ARM target ?

BeRo
Posts: 12
Joined: Tue Nov 11, 2008 3:57 am

Post by BeRo » Sat Sep 06, 2014 12:40 pm

airpas wrote:Hi BeRo ,
wow , you've made some real interesting stuff
about using your BeRoAudioOGGVorbisTremor in android , do you think (fpc trunk ) can optimize your library better, especially they add alot of improvment for ARM target ?
"They" are mostly two workmates of me at my reallife job at Viprinet, which've improved the ARM target from FPC.

But yeah, i think, that FPC could optimize BeRoAudioOGGVorbisTremor for the ARM target better than two years ago, anyway old devices like the Galaxy S2 (i9100) and older could still be problematical, but someone would have test out it, who has still so such old (but not too old) device(s) from the 2010-2011 years, since I myself have only clearly too new (Galaxy S3, Nexus 7 2013) and clearly too old devices (HTC G1, Nexus One, Galaxy S i9000).

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Sun Sep 07, 2014 5:42 pm

Airpas, I asked BeRo the same question earlier via email and he replied that he recommend his own build and packaging of FPC: http://www.crossfpc.com/

I haven't had time to try it myself yet but if you or anyone have time to try building ZGE Android using that version of FPC (or trunk) I'd be very interested in hearing if performance is better.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Sat Sep 27, 2014 8:24 am

If you compile ZGE applications for Android and run them on KitKat, you maybe observed that it is not possible to read/write files from/to sdcard. After some exploration in ZGE sources I found the problem... of course it was somwhere else :? -> missing permission required for KitKat, not the previous Android versions. You simply add the following line to the AndroidManifest.xml file:

Code: Select all

...
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
...
In meantime, I also updated the ZGE sources so this change will appear in the next ZGE beta. Please note, that to apply it to the existing project, you must either manually modify your AndroidManifest.xml or delete the file and compile again.

airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas » Sun Sep 28, 2014 11:50 am

I haven't had time to try it myself yet but if you or anyone have time to try building ZGE Android using that version of FPC (or trunk) I'd be very interested in hearing if performance is better.
seems no difference , i tested them all (crossfpc , fpc(trunk) , delphi) but only for win32 , in some cases fpc is much faster especially with -O4 switch .

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Tue Sep 30, 2014 7:17 am

airpas wrote:in some cases fpc is much faster especially with -O4 switch .
Interesting, how did you come to this conclusion? Did your ZGE projects run at higher framerate or something?

airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas » Sun Oct 05, 2014 8:24 pm

no i didn't use zge in this benchmark, i just build some of my old sdl demos using the 3 compilers . and as i said FPC did a great job .

i like this compiler very much :)

Post Reply