Skip to main content
GameDev.net gamedev.net
🔒 Locked

Modula - PLEASE TEST IT!

Started by Crispy Apr 29, 2004 at 2:56 PM 12 replies 600+ views
Original Post
Crispy
Crispy
Please download the following archive , which contains my primitive Modula v0.11 mod player for Windows. There's a text file called 'Modula v0.12.txt' in there that contains more info on the player, but the main points are following:
  • I've been working on this for ~2 months now and I'm tired of testing
  • There are no excessively violent bugs that I can find
  • For that reason I need other people's help in tracking down any format errors or miscellaneous bugs
  • Two files have been included, obtained from www.modarchive.com, for quick testing
  • Files can be played by dragging them into the player window and pressing Play
  • The player can only be minimized into the system tray and closed via the window termination button while restored
  • The player may have buffer focus conflicts with other programs - if this happens, just close Modula
  • In the minimalistic listbox, reside all of the samples that can also be played by clicking on them. This will cause a volume change in the overall volume level of the playback - this is not a bug
  • Some clicking (sound distortion when notes change) is OK for the time being
  • WinAMP has no proper right to automatically pan the channels in mods: I disapprove!
edit: typos

TCP - Transmission by Carrier Pigeons
   
[edited by - Crispy on April 30, 2004 7:22:31 AM] [edited by - Crispy on May 1, 2004 9:30:59 AM]
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Jesper T
Jesper T
Works good, even the surround seems to work (even though I'm missing sub and center on my system so I cant really test it good). As for the problem, depending on your implementation you might not have to do this, but check that you are calling EndPaint() after drawing it is done.

Edit:

DX 9
Creative SB Live



[edited by - Jesper T on April 30, 2004 5:42:09 AM]
Crispy
Crispy
Thanks for the feedback. Can you also give me some specs - namely your DX version and soundcard specs.



Come on, people - all you have to do is download it and play some music ! It''s not like you don''t do that... like... all the time... or something...

Hmm. Ambiguous, wasn''t I?




TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Eleventy
Eleventy
Ran fine here, and sounded good - but it used up ~50-80% of my CPU the entire time it was playing. In the readme file it said that it only used ~5%. When it would go up to 80% the sound would start stuttering.

About your problem - perhaps the windows BitBlt() function is broken itself. For instance, right now I'm developing a program that will close/restart any application(s) that you specify which are leaking USER or GDI objects. Every time it restarts an application for some reason my program leaks 9 HANDLE objects - I can't figure out why because I checked over my source code and nothing at all is being leaked. The only thing I can think of is that some of the windows functions, such as CreateProcess(), are faulty themselves. Maybe you should try drawing using a different function.

System Specs:
Athlon XP 1800+
512MB RAM
Creative SB Live!

EDIT: On second thought about my problem - I just fixed it. It was something buggy in my code. (I had a function using the same handle as the input and output parameter).

My Site

[edited by - Final_Divinity on April 30, 2004 1:48:02 AM]
Eleventy
Peon
Peon
I really doubt that BitBlt is the problem. I am a real scrappy and messy coder and I have my GDI game (that uses BitBlt to display graphics) running in the background right now and my memory is definetly constant. I didn't do anything fancy to my knowledge and if I did, it's unintentional. Hell, I don't even clean up after myself; a lot of my classes don't even have a destructor right now.

I do use the STL extensively, so that might have cleaned up some of my mess for me. I don't see anything wrong with the call to BitBlt off of my head.

That being said, it is very cool. I wish I could write something like that.

EDIT: Just to clarify, we are talking about RAM usage right? Not CPU time?

[edited by - Peon on April 30, 2004 3:11:06 AM]

[edited by - Peon on April 30, 2004 3:11:56 AM]
Peon
boolean
boolean
Sounds cool. I tried playing ''vampbhc.mod'' in both Modula and Winamp, and noticed that yours did sound better. More Basey and clear. Good work!

Just wondering, does this play only mod files?

Bugs:

1) When Modula is minimized, the song currently playing stutters for a second or two while the program is minimizing (I have a beefy computer, so its not my com slowing down)

2) While the program is sitting there playing no songs, it still uses 50% of my CPU (A 3.09Ghz P4). :S

3) As mentioned, my RAM was slowly eaten as the program ran. Also, even though I turned off the spectrum, it did not release the RAM (I had to close the program). Could there be something in the code that is not telling it to use the RAM that has already been allocated to it?
Crispy
Crispy
Mmkay - fixed the memory leak: I wasn''t aware you couldn''t call draw functions safely outside of WM_PAINT (which I was doing without even calling BeginPaint() or EndPaint()). I''ll update the original post in a little while to reflect the changes.

>> That being said, it is very cool. I wish I could write something like that.

Hey - that sounds like a compliment! Cheers - I actually needed one, given that few are aware enough to appreciate these things. BTW, 60% of the time was spent on getting the damn spectrum working properly - I''m not too far from making it customizable (ergo, called an equalizer), but there''s a few technical issues I don''t have time for just now. Loading a mod file is easyish, playing it can be slightly nastier. I spent 2 weeks scratching my head as to why it was sounding really bad, only to find that I''d, for some weird reason, decided that the samples stored in mod''s are 16bit (well, they''re 8bit). Other than that, I tried to follow the rulebook as much as possible and so far I haven''t had a reason to look at any other open source projects, which I''m kinda glad about.

>> Ran fine here, and sounded good - but it used up ~50-80% of my CPU the entire time it was playing. In the readme file it said that it only used ~5%. When it would go up to 80% the sound would start stuttering.

That is weird. Are you sure your drivers are OK? Here''s what I had in mind with the 5% thing: the player needs a negligible amount of resources to work (0.2-1% of CPU time) and for me it''ll be glad enough when it gets it. However, since there''s an additional normal priority thread running in the mixer and I don''t have any Sleep()''s or other resource-skipping calls in it, it sucks up as much as it can. However, this should only be superficial - for me the OS (Win2k) successfully sees that it only needs very few resources and when I ran a 6 minute RAR archiver in the background with low priority, 99% of the CPU was dedicated to it, not Modula. Ergo, the stutter you''re getting is weird - if you can, please try out the newer version I''m uploading in a few minutes - it has several things changed, including the memory leak for the spectrum.

Cheers to everyone who replied - I''ll be updating the link everynow and then, so feel free to check out the newer versions as they come online!





TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Crispy
Crispy
quote:
Original post by boolean
Sounds cool. I tried playing ''vampbhc.mod'' in both Modula and Winamp, and noticed that yours did sound better. More Basey and clear. Good work!



Cheers!

>> Just wondering, does this play only mod files?

Yes. XM, IT and S3M are somewhat different.

>> 1) When Modula is minimized, the song currently playing stutters for a second or two while the program is minimizing (I have a beefy computer, so its not my com slowing down)

I know. That sucks - it''s a Windows thing - happens regardless of which window you restore/minimize. I suppose a longer buffer than ~40 ms would fix it, but right now the player is optimized for a specific buffer length...


>> 2) While the program is sitting there playing no songs, it still uses 50% of my CPU (A 3.09Ghz P4). :S

Yep - I addressed this in my previous post. This is normal right now - will try to fix it ASAP.

>> 3) As mentioned, my RAM was slowly eaten as the program ran. Also, even though I turned off the spectrum, it did not release the RAM (I had to close the program). Could there be something in the code that is not telling it to use the RAM that has already been allocated to it?

It doesn''t have to release any RAM unless you load a different song or close the program since it reads the song into memory in high quality floating point format and keeps it there.

Thanks bunches for the feedback, though!

Uploaded v0.11b, which includes three different mod files. Two of them are from one of the coolest game ever. Cookies to those who guess which game these are taken from!






TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Peon
Peon
Just downloaded the new version -- I like the old one better This one crashes if I try and move it anywhere except where it starts, or if I drag a song onto it. Not sure why... just gives me an illegal error (so basically you can't do anything with it, except click the boxes and whatnot)

Also, by saying DrawCalls, do you mean that you can't ball BitBlt outside of WM_PAINT? I call mine from wherever I want and it still works; not sure if this is what you are referring to though. If you do find a way to prevent the program from eating all the CPU (when it is just sitting there) I'd be interested in hearing it. It seems like all my programs tend to do this (though the memory usage is constant)

[edited by - Peon on April 30, 2004 5:40:18 PM]
Peon
Crispy
Crispy
quote:
Original post by Peon
Just downloaded the new version -- I like the old one better This one crashes if I try and move it anywhere except where it starts, or if I drag a song onto it. Not sure why... just gives me an illegal error (so basically you can''t do anything with it, except click the boxes and whatnot)

Also, by saying DrawCalls, do you mean that you can''t ball BitBlt outside of WM_PAINT? I call mine from wherever I want and it still works; not sure if this is what you are referring to though. If you do find a way to prevent the program from eating all the CPU (when it is just sitting there) I''d be interested in hearing it. It seems like all my programs tend to do this (though the memory usage is constant)
quote:


That''s interesting since it runs just fine on my computer. I have DX8.1a and Audigy 2 Platinum Pro. I suppose it''s a coding issue, though, possibly related to some subtle change from v0.11. Anyway, one of my frinds also had the same problem, but I dismissed it as "unique". Since you brought it up just now, I''m getting a little worried - would you be willing to be a test subject who I could send the player and have it tested (since I only have access to 2-3 different computer configurations)? Also, what is your computer configuration anyway?

>> If you do find a way to prevent the program from eating all the CPU I''d be interested in hearing it

Calling Sleep(1) when no CPU resources are needed should be enough, though I''ll be sure to notify you if I find a better way!




TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Peon
Peon
quote:
Original post by Crispy
quote:
Original post by Peon
Just downloaded the new version -- I like the old one better This one crashes if I try and move it anywhere except where it starts, or if I drag a song onto it. Not sure why... just gives me an illegal error (so basically you can't do anything with it, except click the boxes and whatnot)

Also, by saying DrawCalls, do you mean that you can't ball BitBlt outside of WM_PAINT? I call mine from wherever I want and it still works; not sure if this is what you are referring to though. If you do find a way to prevent the program from eating all the CPU (when it is just sitting there) I'd be interested in hearing it. It seems like all my programs tend to do this (though the memory usage is constant)
quote:


That's interesting since it runs just fine on my computer. I have DX8.1a and Audigy 2 Platinum Pro. I suppose it's a coding issue, though, possibly related to some subtle change from v0.11. Anyway, one of my frinds also had the same problem, but I dismissed it as "unique". Since you brought it up just now, I'm getting a little worried - would you be willing to be a test subject who I could send the player and have it tested (since I only have access to 2-3 different computer configurations)? Also, what is your computer configuration anyway?

>> If you do find a way to prevent the program from eating all the CPU I'd be interested in hearing it

Calling Sleep(1) when no CPU resources are needed should be enough, though I'll be sure to notify you if I find a better way!




TCP - Transmission by Carrier Pigeons






Sure, feel free to send me new versions of the program; send them to this email

I'm running a 1.8ghz Pentium 4 mobile (a laptop) with 224 RAM, 32 MB non-descript ATI video card... for sound, I'm not sure to be honest, I looked around and the best I could come up with is HP (Hewlett Packard) ALI Audio... probably some sort of integrated cheap sound card, I guess, not sure. I believe I have the most recent version of DirectX.



[edited by - Peon on April 30, 2004 7:59:35 PM]

[edited by - Peon on April 30, 2004 7:59:52 PM]
Peon
Crispy
Crispy
Thanks for the support, Peon. I think I won''t be bothering you with minor updates, but it''d be great to have more major releases (magnitude x.y, as opposed to x.yz) tested on as many systems as humanly possible. Anyway - I''ve updated the player in the original thread - it looks a lot more like a real player now, has several new items of functionality and, most importantly, doesn''t crash. It''s v0.12.


A propos - cookies as still waiting their owners for guessing what game two of the mod''s that come in the archive are taken from!





TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
NewbJ
NewbJ
I have DX 9.0b and a Yamaha AC-XG WDM sound card...everything seems to work great...the only problem I''ve encountered is that if I''m playing a song in the background and using the scrolling wheel on my mouse to scroll through something like a website, the song skips, both when the program is minimized and maximized...I know you already know about this, but I''m just telling what happens

otherwise, good player!

-Jacob

Crispy
Crispy
Yes - I know that such a problem exists. However, I''m undecided on its nature and cure. For instance, WinAMP seems to do just fine with a buffer that is only 200 ms long (minimum possible length). Indeed, the buffer I''m using is only 4096 bytes, or (4096 / (44100 * 2 channels)) = ~46 ms long. Most likely, there''s the problem, but I wouldn''t really know... WinAMP seems to be doing a lot of things one wouldn''t normally notice very nice and clean...




TCP - Transmission by Carrier Pigeons

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.