PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Hekkus Sound System 0.98.rc1 released!

I have released a new version of HSS. I have changed a bit the way hekkus initialise its internal buffer so before to release the final version I need some feedback on how it works on your games/ppcs.

Changes in this version:
* added frequency and speed function to Modules and SoundFXs
* changed a bit the way hekkus calculate the mixer buffers length
* fixed finetune/sample 31 PT mod bug (thanks muff for report)
* fixed minor problems on 'note cut 0', 'set offset continue', 'pattern loop', 'set speed 0' PT mod effects
* fixed minor problem on "vibrato" PT mod effect (thanks muff)
* fixed (again) the finetunes PT mod table

I have also setup a new forum on my website so if you have questions or problems with this library feel free to post on it instead to send me a mail :)
On the forum I have starded a thread to know if you are interested on a symbian port. Just check the forum and write what you think.

You can download the new version on my website http://www.shlzero.com
Cool Gerson, I will have to try it out in the next few days!
Hi Gersen,

Got your latest copy and all .mod now plays well on my X-Fighter ;-)

So far I havent noticed any bugs or pause.

Regards.
Gersen, I am considering using your sound library in one of my own projects...

Do you have any numbers related to performances? (ex: CPU load vs number of channels / sound quality, memory usage, ...)

Got your latest copy and all .mod now plays well on my X-Fighter ;)
So far I havent noticed any bugs or pause


I know, I know, good news :)



Gersen, I am considering using your sound library in one of my own projects...

Do you have any numbers related to performances? (ex: CPU load vs number of channels / sound quality, memory usage, ...)


Hi Thierry,
I'm programming a little benchmark program to test the speed of my sound system (I know that it is fast but I don't know how :)), it should be ready tomorrow or the day after. I will also post some numbers related to memory usage.
Thierry, in a completely arbitrary way I can tell you that Hekkus performs very well. I used it for Invasion: Trivia (PocketFrog based) and am now using it in K&G; Arcade (GapiDraw based).

In both cases there is no effect on frame rate when sound functions are in use. For example, in both games at various points I have a .mod playing in the background and then have sound effects firing off more or less randomly as the game action goes on, and I've turned off sound functionality to see if the frame rate was affected. It was not. Frame rates remain steady, even in relatively complex parts (graphically) with a good number of sound effects firing simultaneously (perhaps five SFX simultaneously I'd say).

Obviously this isn't a scientific measure, and your mileage may of course vary based on what your doing, but my impression is that Hekkus is exceptionally well done in terms of performance. I'd be surprised if Gersen's benchmark numbers, as your experience with it as well, idn't agree with my observations.
Fzametti:

I have no doubt that Hekkus performs very well. It is simply that I am at the planning phase for my project and I wish to have an idea of the CPU/memory load that will be incurred. Every % I gain on sound means more GFX goodies.

Gersen:

Thanks, I look forward to your results!
Ok, finally I have some numbers that confirm all the good words that fzammetti have spent on my sound library :)
I have build a little program with gapidraw to test my library on my ipaq 3950. I have
also build a totally identical version with fmod to compare my value with the state
of the art ;)


The test was made on my ipaq 3950 with a gapidraw (2.01b) app playing
- 1 ProTracker module (4 channel)
- 8 simultaneous 8bit mono waves

I have used for all tests Hekkus ver. 0.98.rc1 and fmod ver. 3.71

Image
The average cpu usage without sound was 50%


(*) The library cpu usage are taken from two different function so they can't be comparable.
If you made some simple operation you can see that all the two library's cpu % are accettable. For example Hekkus at 22KHz/16/stereo have a 67% cpu usage and at 11025KHz/16/Stereo 63%. So you have and increase from one to the other of 4% (67% - 63% = 4%).
You get the same value if you caluculate the delta from respective Library Cpu Usage %(10% - 7% = 3%). This works for all the % for hekkus and for fmod, just try.

(**) It seems that you can't specify with fmod the bit rate and mono/stereo output but as you can see the low quality value are very similar to the hi quality ones because on the mixer I work with 32bit value and then I scale all with shifts to fit 16 or 8 bit value (and I think that fmod works similar).


What can I say? Only that my library is very fast :)


Now I'm cleaning a little the benchmark program then I will post here the link so if someone want to verify my numbers...


Memory usage:
Hekkus is ultra memory optimized (it was born on the GBA and the little nintendo machine don't have a lot of memory to wrast)

Image
Const data (tables for mod playing) 32kb


Just a little addition, this is the most userful table. I have measure the time my sound library spent to process 1 second of sound data (with 1 module and 8 waves playing)

Image

So if you want to know how time my library spent on your 30fps based game just pick the right mixer mode and divide it by the fps, in this case 30.
For example on a 30fps game and a mixer mode of 22050/16/stereo hekkus consume 84/30= 2,8 ms per frame. Not too bad ;)
As a developer I look for 4 things in a library: Fast, Bug-Free, Small and FREE. Hekkus meets all four, so this sounds like an Announcement-grade thread to me. ;)

Gersen, thanks for your contribution to the community! If you could add support for a mod format with more than 4 channels then your library would be nigh unto perfect. :D

Dan East
Awesome Gersen, I will use your library (starting next year =)
You make that sound so far away, Thierry. :)

Well done, Gersen. When I finally get around to updating Pod, I'll be using it (again).
Thank you guys! :)

I'm working on a XM player but I have a lot of other works to do (like my second ppc game) so I can't give you a release date... One day next year is all what can I say :)
Shame it isn't 2000, otherwise could say next millenium :P

*audience groans*

Good luck with your next game though, if it's anything like Rainy Colours, it'll be something to wait for.
It's a shame it does not support .IT files. Speaking of which, does anyone know of a good utility that I can convert .IT files to a format supported by hekkus?

-B
Modplug is an editor that will load and save mod, xm, it, and s3m files (http:www.modplug.com).

It's free, too.

I do have one problem with it. It doesn't seem to "tune" each sample in my mod files - where it does handle it when editing a s3m. I don't know if it's a bug or there's something about mods. Other than that, it's great. So, you may run into problems when doing the conversion. Try it out.

If anyone else has any experience with tuning (transposing) waves in mod files, please post...
I'd be cautious about using Modplug. It's not 100% compatible with the IT format and also introduces some unofficial extensions. More information can be found at the following site: http://dumb.sourceforge.net/index.php?r ... oc=modplug

Just to be on topic, thankyou Gersen for an excellent sound library!
I should have asked this earlier, but pertaining to the performance of Hekkus 0.98... Is this better or worse than the older versions? (I currently am still using 0.96).

Also, does having the sound class open, but without calling playSFX or playMod, cause much load - if any? The reason I ask is that I leave it running even if sound is disabled. Maybe that's not the way to do it, but it seemed right at the time.
Thanks for the feedback guys, it seems to work "ok", I've a few problems with songs that have high bpm settings (i,e 188), when converted to MOD it drops it back to 125, and cant be changed, and thus wont play correctly (to slow).

-Thanks
What about a program that just changes the lengths of the notes? Or can you adjust the speed during playback?
fast_rx:
performance are the same on version 0.96 and 0.98 so you should use the latest version that fixed a lot of bugs.
When you disable sound in your game you should close the sound object but my library are designed to use the slowest resource that it can when you don't play anything so you can just keep it running without much problems.

brendan:
The value that are set on the ModPlug Tracker on "Initial Settings" are not used by the mod format, but it is converted on the right value with command (FXX: Set Tempo and Set Speed) on the Pattern data song. So the tempo and speed should be converted right. However .IT have a lot of other features that mod format don't support and converting .it to .mod is not so userful. It's more convenient to write song directly in mod format :)
Gersen, is there any way to poll the status of specific channels in the mod file? I had this crazy thought of sync'ing some in-game movements with the music. At first, I thought of modifying your sound library so that I could see when a effect code EF was issued (since it appears to be unused by Modplug). But maybe just peeking at the current notes would be enough...
With the new version you can check the row of the mod that are playing.
You can download the new version at http://www.shlzero.com/downloads/hss/He ... 8.5.b1.zip

Changes:
* added support for ProTracker modules with up to 32 channel
* added ability to set Modules and SFXs position at playing time


With this version you can use the u32 Channel::position(); function to retrieve the actually row on a playing mod.
thanks for this library gersen! good work!
fast_rx wrote:
Also, does having the sound class open, but without calling playSFX or playMod, cause much load - if any? The reason I ask is that I leave it running even if sound is disabled. Maybe that's not the way to do it, but it seemed right at the time.


With sound open but nothing playing, my framerate dropped from 30-27 fps. This is probably due to the high priority thread that keeps running.

I tried checking the number of playing channels each tick and suspending the sound object when nothing is playing. This just gave me jerky action when resuming :-(.

Sean
new version of hekkus have some code to save cpu usage if there is nothing playing but only with the upcoming 0.99 version I have truly optimized the mixer functions for this case. On 0.99 I have also optimized the way sound channels are processed and now you can allocated how many sfx and mod channels you want and Hekkus will always process only the channels that are playing.

The new 0.99 version will be shipped without code and on .dll format. I have received some mail that have asked for a update to the .net port. Now that Hekkus is a dll should be more simple to do a .net port (I don't have vs.net...). Anyone interested? Sean :) ?
Any chance you can keep it as a .lib as well as a .dll. Simply put, .dlls scare me. :)

-John
gersen wrote:new version of hekkus have some code to save cpu usage if there is nothing playing but only with the upcoming 0.99 version I have truly optimized the mixer functions for this case. On 0.99 I have also optimized the way sound channels are processed and now you can allocated how many sfx and mod channels you want and Hekkus will always process only the channels that are playing.


Cool. That should be good.

gersen wrote:The new 0.99 version will be shipped without code and on .dll format. I have received some mail that have asked for a update to the .net port. Now that Hekkus is a dll should be more simple to do a .net port (I don't have vs.net...). Anyone interested? Sean :) ?


I will do a .net update when .99 comes out. I have been away from PPC programming for a while, finishing off Pics Print 2. Now that it is out, I can get back to playing with the PPC.

If you are supplying a dll :(, then you will need to create c style wrapper functions that pass an object reference as the first paramenter. .net can't read c++ name mangling. Email me and I will send you code I use.
How is the beta?

I'm looking at releasing a game next week. Should I stick with 0.98.0 or investigate the 0.98.5b3 version?
Presto wrote:Any chance you can keep it as a .lib as well as a .dll. Simply put, .dlls scare me.


No, I'm sorry. I dislike .dll too but I have decided to switch to .dll for two reason: one is that on the symbian port to use some necessary functions for the port you have to compile the library as a dll (you can't call this functions from a static lib, odd but true 8O) so for homogeneity I have compiled as a dll the ppc version too. Other reason is that I have downloaded some ppc game demos and I have discovered that they use Hekkus for sound but the author don't have send a single word to inform me for the release of its game. All what I'm asking for the use of Hekkus is that you send me a mail if you use it (and provide a donation if you sell something), maybe with a .dll in their game directory more people will find 2 minutes to write a mail :)

Mr X wrote:If you are supplying a dll :(, then you will need to create c style wrapper functions that pass an object reference as the first paramenter. .net can't read c++ name mangling. Email me and I will send you code I use.


So a lot of work... I don't have the time to do a .net port and I don't even have a .net compiler so it's hard for me to write something without the ability to run and debug it ;)
What I'm searching is someone that have time and know how to do a quick wrapper for .net. Maybe someone that are actually using the .net port... :)


mlepage wrote:How is the beta?

I'm looking at releasing a game next week. Should I stick with 0.98.0 or investigate the 0.98.5b3 version?


You should investigate the new 0.99.rc1 version. I have started a new thread somewhere to announce changes and new features (http://www.pocketmatrix.com/forums/viewtopic.php?t=15636). 0.99.rc1 is more optimized than 0.98.x and more debugged than any 0.98.5beta.
gersen":1zk5sqfe]


It's not that much work. I have a wrapper for 0.97.6 so it all depends on how much it has changed from that. I am quite happy to do it, but it means that I will have to write a second dll. Dot net cannot call c++ dll's directly, so you need wrapper functions to give a c interface.

Ie a whole bunch of
Code:
bool __stdcall Sound_open(Sound* pSound, u32 freqmix, u32 bps, bool stereo)
{
return pSound->open(freqmix, bps, stereo);
}

routines that are exported.

I'll be having a play with hekkus this week for my yeti port so I'll investigate then.

How about if I create the .h,.cpp files and send them to you for inclusion.



Sean
It's not changed a lot from version 0.97.6. The function are pretty the same, some have slighty changed its name and some have changed the return type. I'm not releasing the code anymore, if you can compile a .net dll wrapper to the new hekkus 0.99 version I will include it on the standard package. If you can also send me the code I can update it with the newer release and you can only recompile it when needed. Let me know.
I'll do something this week and send it in