PocketMatrix forums

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

Hekkus Sound System 0.99.rc1 released!

New version of the Hekkus Sound System, this time the main features is not only the support for symbian devices but also MODs with up to 32 channels and stereo WAVs. Some optimizations and bug fixes as always ;)


Changes in this version:
<B>* Symbian support added (Series60 smartphones)

* added support for stereo WAVs
* added support for ProTracker modules with up to 32 channels</B>

* added a lot of new function return code (for debug porpuose)

<B>* optimized sound mixer functions
- if you don't play anything the mixer do nothing :)
- new channels loop that consume less cpu cicles</B>

* no more source code included (if you want the source code please provide a donation :))
* no more static lib distribution, only .dll

<B>* changed classes name!
- Sound -> hssSpeaker
- Channel -> hssChannel
- Module -> hssMusic
- SoundFX -> hssSound</B>

* added new driver system to support multiplatforms dev
* adjusted volume setup to support Symbian platform
* deleted const freq tables, now are calculated when needed
- so now you can use whatever output frequency you want
- 30kb of const data are gone

* added ability to set Musics and Sounds position at playing time
* enhanced Musics and Sounds load to memory functions
* fixed memory leaks on Musics and Sounds load from file (thanks bluescr and A. Cicak)
* fixed problems with changing Musics and Sounds frequency or speed (thanks Miguel Vanhove)
* fixed minor cosmetic bugs


Enough changes for this new version, don't you think?

As always you can find the latest files on my website www.shlzero.com
Cool! Can't wait to see how many fps more I will get from this in my test demo.

Btw, I am using your library in my programming language that is going to be released soon. I basicly added a bunch of easy high-level functions to the language that points to your library functions.

I really enjoy it so far. Keep up the good work!

Regards,
kornalius
I'm going to see about putting this into my game tonight... The class name changes will make it a little more work then I'd like, but nothing too substantial.

I'm really interested to see what DevPartner finds... I've noticed it was finding a number of memory leaks and some other things, but it sounds like you may have take care of at least most of them. Would you like me to send you what it finds this time around?
No new CHekkusGapiApplication? Just edit the one we have?
I personally wouldn't use the modified GD framework class anyway... I've always, even when I was using PocketFrog, just added Hekkus functionality myself. Not like it's any big deal, and it keeps the graphcis library and sound library more isolated I think, easier to swap out if you want to move to a different library. Just an aside...
Yeah it doesn't seem like it's doing a lot for me, but it's in there now so I may as well keep it.
More than just class name has changed, it seems function names have also changed. The whole API has changed.
Also the lib directories have changed.

Gersen you have to remember to note details like this. The best way is to write them down as you do them, so you have a list when you are done. (If I missed this info somewhere, I apologize.)
OK here's more.

Error codes were not added, they were changed.

So if you were previously doing error checking (as you should be), then you will have to change it all before your application will run properly. This is a runtime error, not a compile time error.

So with all these changes, converting from 0.98.0 to 0.99.rc1 is not a 3 minute job, it's more like a 30 minute job. Now I just hope it's stable enough that I don't have to convert back...
kornalius wrote:Cool! Can't wait to see how many fps more I will get from this in my test demo.


Very interesting your programming language, let me know if the new version improve your fps :)

fzammetti wrote:I'm really interested to see what DevPartner finds... I've noticed it was finding a number of memory leaks and some other things, but it sounds like you may have take care of at least most of them. Would you like me to send you what it finds this time around?


Of course, send me all you want, I'm always around to squeeze some bugs ;)
As you have suggest I have added a new set of return code for some functions, it really helps a lot more than a boolean :)

mlepage wrote:No new CHekkusGapiApplication? Just edit the one we have?

Later I'll add on my website a new samples for GD 2.04 and 3.00 for Hekkus 0.99 and it will contain the update CHekkusGapiApplication. But all I have to do is to change the class name and the return code to the open function.

mlepage wrote:More than just class name has changed, it seems function names have also changed. The whole API has changed.

I have changed some function to reflect the new class names, so for example playMod was changed to playMusic, playSFX was changed to playSound and so on. If you use the replace function of your editor you can save some time... :)

mlepage wrote:Also the lib directories have changed.

Yes, I have written somewhere that now hekkus is shipped as a .dll library so the directory have changed (there is a dll directory that include all the dll) and the debug version are gone (without the source it isn't so userful to have a debug dll version). Oh, and from now you have to include the right dll on your distribution package or your app will end with a popup that request the hekkus library.

mlepage wrote:Error codes were not added, they were changed.

added and changed. With older version the return code was always a boolean, now it is an int that can return a lot more information. Always if the function succed it now return HSS_OK. I have update the documentation (but I admit that I have to improve it) so you should give it a look.

So with all these changes, converting from 0.98.0 to 0.99.rc1 is not a 3 minute job, it's more like a 30 minute job. Now I just hope it's stable enough that I don't have to convert back...

I'm sure you will find 0.99 very stable, I have worked a lot on this new version and I'm pretty happy of the result :).
Oups, now that I see that there is a lot of changes in function names and class names, I will have to wait a bit since the game API of PPL is not the priority at this time. So no fps increase for me today! :D

regards,
kornalius
It's not so bad once you know what to expect.
OK, something is different.

In my game, when minimized (using CGapiApplication::Minimize or due to alarm) or when gameplay is paused, I call Speaker::pauseMusic. To resume I call resumeMusic.

This worked fine before. Music was halted, and whatever sound effect was playing soon finished, and my game didn't play any more sound effects while minimized or paused.

Now, what happens is the music and sound effects just keep looping like its stuck. The sound does not stop, it is still coming through the speaker.

This happens on both the PC and the Pocket PC.
BTW, any particular reason the global functions are named suspend/resume but the sound and music functions are named pause/resume?
Just a cut and past from the mail I have written to mlepage...

Fixed. It was a little bug. Basically I don't have debugged the only one new internal function that I have added to 0.99 (I'm feeling a bit stupid)... Ok, now rc2 should be perfect. I have changed some other function names, sorry. I have added a s when the function operate on all Sounds or Musics (plural this unknown) and I have changed the resumeMusics/Sounds to unpauseMusics/Sounds.

I promise to not touch the function name anymore for v. 0.99.x

As a little note, when your app is minimized you should call suspend and resume when it is return fullscreen. Why? Because it stops the sound output and suspend the sound thread. If you don't call suspend all the sound processig still work even if your app is minimized. pause/unpause functions is used if you want to pause all Sounds and/or Musics while your game is running.
gersen wrote:I have added a s when the function operate on all Sounds or Musics (plural this unknown) and I have changed the resumeMusics/Sounds to unpauseMusics/Sounds.

I promise to not touch the function name anymore for v. 0.99.x


Plural of Music is Music (don't you love english :) ). I wouldn't mind if you changed all the Musics back to Music.

I can't link to hss.lib using VS2003, although I can using VS6. I could get around this previously by adding all the files to the project and then compiling everything but that is no longer an option :(.
Mr X wrote:Plural of Music is Music (don't you love english ). I wouldn't mind if you changed all the Musics back to Music.

Yes, I don't love english :)
Uhm, and if I say that Music is not refer to a song but to my (hss)Music c++ objects? ;)

Mr X wrote:I can't link to hss.lib using VS2003, although I can using VS6. I could get around this previously by adding all the files to the project and then compiling everything but that is no longer an option.

That's not a good news. Microsoft probably have changed something on .lib or .dll specification for c++ from vs6 to vs2k3. I will try to investigate on the next days.
gersen,

Do you already have a solution for this problem with linking the hss.lib in VS2003 ?!
I have the same problems, and do not really want to go back to VS6 :cry:

Note: I get the LNK2019 linker errors for the methods that return an (unsigned) int (a s32 or u32) or that have a parameter that is of type s32 or u32.
For instance the hssSpeaker.suspend() (returns void and void parameters) does link OK !
Hopefully this helps...
I have fixed the vs.net linker problem. I have to say thanks to Centaur that have pointed me to the right direction. I chaged the data definition of my library, I have replaced the vary __int16, __int32 etc. with standard types (short int, int etc.) and now magically the dll works even on vs.net! 8O

I have added to my webpage a new Hekkus version (0.99.rc3) that fixes this and some other little bugs. Download it at http://www.shlzero.com
Conan · 14 May 2004, 04:56 UTC — Hekkus now implemented in my game, question about file types
As I'm new to music can someone list the file extensions which work with Hekkus as I don't know any other than .mod & .wav (in version 0.98)

Don't see anything I understand in the docs though I'm sure if I already knew PC music I would be able to follow.

ps: Now Hekkus is installed I need a few days to source sounds & incorporate in the game, then I need to add the registration code & then it's time for beta testing at long last :)
Oh well, Hekkus works only with .mod and .wav.
No problem. I just needed to know what to work with. Almost all the tunes I have are .mod but there are .it & others. I can ignore them.

ps: re: lack of PAYPAL issue, I new have a worldpay account. Is that something you could use to take a donation?
I use paypal only because it can transfer donations directly to my bank account. I will try to see if worldpay support bank transfer and if it is easy to sign in I will open an account.
Conan · 14 May 2004, 11:32 UTC — loading a module from file fails ?
Code:
//sample tune for background music
m_module.load(_Module.GetModuleInstance(), IDR_MOD);
TCHAR fullpath[MAX_PATH];
int pathlen = PocketPC::GetFullPathName(_T("ars.mod"),fullpath);
int retcode = m_module.load(&fullpath;);
m_module.loop(true);
m_sound.playMod(&m;_module);

The .load from a resource works and the tune plays. The load from a file returns true but no music, using exactly the same .mod file.

What's wrong. Am I mis-using fullpath (I see you use it yourself in the load code) or is my syntax wrong in some way?

(I'm only using one load at a time obviously)
I've not familiar with this library, but shouldn't this:
int retcode = m_module.load(&fullpath;);

Be this:
int retcode = m_module.load(fullpath);

Otherwise you are passing a pointer to a pointer to load().

Dan East
Yes, dan is right, if you use int retcode = m_module.load(&fullpath;); you are passing a pointer to a pointer and only god know what can happen.

First of all you should use the latest version of the library, don't know what version are you using but I remember that there was a bug on the load from file somewhere on version 0.97.x

Second on the load from file I use a function that do the same thing that PocketPC::GetFullPathName do so there is no need to call it before the module load.

Try to load something else (like a wave or another module) without using PocketPC::GetFullPathName and let me know if it works.
Sorry Thomas & Dan, the & crept in as one of my attempts to figure it out. I can follow addressing modes in assembler no problem but C++ pointers are just mad & I can never quite make my mind up about * & etc.

I changed the code to pass just the file name and now the return is false. I double checked that the .mod is in the correct place. I will do as suggested & try latest version. Have downloaded it but have to work out what to do as there's nothing explaining what to do with the dll's

ok, an hour wasted trying to get the .dll to be recognised. Also there's a .lib, I though the .lib was gone. Please explain how to link in the .ddl Off to look at FMod's docs as I had that working & it uses a dll so that might tell me the answer.

So having looked at FMod's docs it seems I don't use the dll at the build stage so I will go back to the .lib however I'm only building in debug and there's not a debug version. Off to the Hekkus site for another look.

Ok, got it to build in release mod

and the .mod plays now with the latest version, so even in V0.98 it's broken
I know that I should add more docs for Hekkus, but I don't have much time and when I can I prefer working on the lib insted of writing bored docs.
The best thing to do if someone want to understand how to intagrate and use my library is look at the source of one of the samples that are present on the download page of Hekkus. There is for example a PF 7.0 sample that explain how to use it with the latest Hekkus version.

With version 0.99.x you can use the same .dll for debug and relese builds, without the source code there is very little interest to have a debug .dll.
If anyone needs help with Hekkus, feel free to IM me and I'll do what I can. I've now used Hekkus in two projects, one GD and one PF, and while I can't promise I can answer every question, I can probably assist you somewhat (and I wrote the sample that Thomas is referring to in PF 0.7.0).
Thanks Thomas & Frank. I had seen the sample with the PF download on Thierry's site but it's out of date.

One question Frank, Is the big number in the line

code] m_speaker.open(22050, 16, true, 1, 16);[[/code] a buffer size?
Small mods play & big one's don't
The sample for PF 7.0 on the Hekkus download page are updated and use Hekkus 0.99.x.

From the Hekkus documentation:

s32 hssSpeaker::open (
u32 freqmix,
u32 bps,
bool stereo,
u32 maxmodchannels = MUSIC_MIN,
u32 maxsfxchannels = SOUND_MIN
)


Initialize the Hekkus Sound System.

Open sound output at freqmix, setup a thread for sound update and alloc specified channels.

Parameters:
freqmix output rate in hz.
bps select 16 or 8 bit output.
stereo enable stereo output (true == stereo, false == mono).
maxmodchannels number of ProTracker channels to allocate.
maxsfxchannels number of Wave channels to allocate.

First parameter is the output rate, common value are 11025, 22050 and 44100.


Small mods play & big one's don't


when you load the big one mod what the load function return? With version 0.99.x all the function return an int and not a bool so you can check what is wrong when functions failed (could be an out of memory problem or an incorrect module format).
I will let you know the return value as soon as I get the debug version working again. I now have PF & Hekkus working fine but only in release mode. Debug mode's project settings are messed up after me messing around yesterday.
The return value I get when trying to load a module is -200.

Can you tell me what this means & also is there a list of return codes?

thanks in advance
You can find all the return codes on the file hssErrorDefs.h under the include directory of your Hekkus copy.

The error code -200 mean file not found, later I will look at the code but I'm pretty sure that the load routine isn't buggy.
ok, load from a .mod file works if you give it a text string, eg: "thismod.mod" but not if I give it a TCHAR containing the same string.
Will test more later but managed to get tune selection, on off & volume working
TCHAR is unicode, "This is a string" is not. Does Load take a char or TCHAR?

Dan East
The load take a TCHAR, so if you put the same string on a TCHAR var and call the load routine it have to work. Are you sure you are passing the right pointer? Can you post the code that don't work?
ok, take me out & shoot me. The load from file works fine. For some reason I had not noticed that I was using _tcscat instead of _tcscpy to load up the string & I had never looked at the string contents to check during debugging.

As I have said many times before I'm writing my first real C++ program & it's sometimes a struggle. (of course we have patient & knowledgeable people like Dan East around on PM to give a nudge in the right direction)

I will press on & get the sound effects implemented today.

ps: Re the donation payment if you cannot use Worldpay I will just send a cheque & add on something to cover your currency conversion costs as it's safer than a parcel containing Euros.
Conan · 22 Jun 2004, 09:54 UTC — Just checking the DLL thing again.
Can you be certain that the hss.dll supplied works on PPC2000? I'm jast asking as I cannot find any reason why Space Treker will not run on my old iPaq. As far as I'm concerned everything needed is supplied by the setup excluding gx.dll which is there & working.

ps: How about agreeing a payment method? Remember I cannot/Will not use Paypal (cause they are dodgy in my opinion)
Uhm, try this, remember to rebuild (not just linking) all your game with the .lib and .dll on the package.

Later I will send you a mail to discuss the payment, thank you.
Here's what I tried:-
1. rebuild all for PocketPC platform (using existing LIB & DLL which work with PPC2002.
2. This still gives the 'something missing' error
3. copied in just the dll you sent. Program stops giving the error & now crashes silently.
4. The crash happens on m_sound.playMusic(&m;_module)

Anything you want me to try? In the meantime I will try the sample mod & see if it plays, No it still crashes using the sample ars.mod.
You could try this,

- rebuild your game for ppc2000 with the .lib that I sent.
- manually copied the .dll that I sent.

try also this rotozoom+hekkus sample that I have compiled for ppc2000 and tell me if it works.
Attachments:
rotohekkus-ppc2000.zip (40 KB)
yes, your demo works, off to rebuild using the lib (I did not want to use it in case it messed up my project in any way but will do so now)

When I put the new hss.lib into the ppcarm lib folder I get 11 hss linker errors after a rebuild all or an ordinary build. When I put the original one back it links fine.
If the demo works you can download Hekkus v. 0.99.1.beta3 and your game shloud work too.

0.99.1.beta3 is just a bugfix relese, no new feature and the most change are on the symbian version so don't worry about the beta on the name and use it on your game :)
I get these linker errors with the latest beta version:- (the LIBC one is not an issue)
Linking...
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
scans.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
tactical.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
trade.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
warp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
bases.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
impulse.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
input.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
orbit.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playSound(class hssSound *,bool)" (__imp_?playSound@hssSpeaker@@QAEHPAVhssSound@@_N@Z)
input.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall hssSpeaker::playMusic(class hssMusic *,bool)" (__imp_?playMusic@hssSpeaker@@QAEHPAVhssMusic@@_N@Z)
Debug/treker.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

treker.exe - 10 error(s), 1 warning(s)


update: PocketPC 2002 version works fine. Off to see why 2000 & XP versions don't

update: PocketPC 2000 iPaq 3650 working fine for first time ever. Many thanks :)
Not sure what's wrong with XP thought? back to work
My projects just link correct with the latest version, just check if you are using the latest Hekkus .lib and remember to rebuild all your project.
Yes, all working now. The rebuild all was needed.

Sorry, I'm doing 10 different things at once & I'm not concentrating enough on one thing.

I sent the latest dll & game .exe out to two testers for feedback.

update: I borrowed an iPaq h4150 WM2003 & tested. Game worked fine.

update 2: Both testers report success :) so we seem to have it working on all OS's.

ps: What did you fix in the latest beta that resolved the issue?
pps: sorry about the football last night. Italy were very unlucky.
Thomas, I'm getting a problem with the game crashing on notifications and on power down/up with owner information displayed at startup. I have been trying everything possible with Thierry so now I'm asking if there's any known issue with Hekkus causing crashes in this way?

(the game is now live & on sale so this is a real issue)
Conan wrote:
ps: What did you fix in the latest beta that resolved the issue?
pps: sorry about the football last night. Italy were very unlucky.


I've missed this post, sorry Conan.
For the first ps, I don't remember ;)
For the second Italy didn't was unlucky, Italy simly didn' play well. And even worse our most important player (and really we didn't know before) was a lama!

Conan wrote:
Thomas, I'm getting a problem with the game crashing on notifications and on power down/up with owner information displayed at startup. I have been trying everything possible with Thierry so now I'm asking if there's any known issue with Hekkus causing crashes in this way?

(the game is now live & on sale so this is a real issue)


What devices give you this problem? Have you tried to use the latest Hekkus version? On the latest version (0.99.1.rc3) I have worked hard to correct the power on/off hang on a few new ppcs (1940, 4355 and maybe others).

Try to disable Hekkus, simply comment the speaker.open function call on your game. All the other Hekkus function calls do nothing if you haven't opened the speaker object. In this way we will find out if it is a Hekkus bug or not.
I'm using Release 0.99.1.beta3. It fails on my Axim & on a user's device which I'm finding out about now.
Will report back after various tests.

the user has a iPAQ 5550. On my Axim I'm testing notifications (reminders) and Owner info at startup. As far as I can tell the notifications don't crash my Axim, just the owner info screen which most people don;t have on anyway. Still testing away.
has anyone used Hekkus with VS2005?? If so can you get it to link and then run correctly? I'm still trying to make it work. It appears to be set up correctly re: include & lib.
My current errors are:-
Code:
Linking...
input.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl hssMusic::load(wchar_t const *)" (__imp_?load@hssMusic@@QAAHPB_W@Z) referenced in function "public: virtual void __cdecl MyGame::StylusDown(class Frog::Point)" (?StylusDown@MyGame@@UAAXVPoint@Frog@@@Z)
treker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __cdecl hssMusic::load(wchar_t const *)" (__imp_?load@hssMusic@@QAAHPB_W@Z)
Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Release/treker.exe : fatal error LNK1120: 1 unresolved externals

The lib is definately being found cause if I take the lib out of the list I get lots of linker errors ?
wchar_t... If it's being treated as builtin, change it. If not, also change it. I think it wasn't up to VS2005 and now is.
it's the music load function only that has the issue. When I comment out the game builds. I will examine the way it works & see if I can fix & will let the author know also.
If I set the switch which controls 'treat wchar_t as built-in' to No (/Zc:wchar_t-) then PocketFrog fails in a similar way to Hekkus (The PF lib has been built for VS2005, Hekkus has not)

The Hekkus load function is being passed the name of the module to load as TEXT("filename.mod") and expects to see a wchar_t so I don't know what to do to change the function to work.

In the Hekkus .h file hssData.h there are a couple of lines setting up this function so it's these that fail however there seem to be plenty of other places where something the same seems to work.
There must be something different between loading a file from a resource & loading a file from the file system.
Conan · 15 Nov 2005, 13:51 UTC — Success - at least it builds now
I had to set both projects (PocketFrog and my own game) 'treat wchar_t as built-in' to No (/Zc:wchar_t-) to get a successful build. Now I just have to make the game work :)
I now have Hekkus linking and running with a sample playing WAVs. I just need a few minutes later today to add in music.
Problems were:-
a) getting it to link
b) working with sample code which was not correct.
Once I created a Hekkus sample from scratch it all worked.