PDA

View Full Version : BASS- High Memory/CPU Load



DarknessX
02-06-2007, 06:40 PM
IDE: Pure FPC
System: WinXP, 2.8ghz Celeron CPU, 2.5gb RAM
Libraries/API: BASS/BASSFPC

Ok, well, straight to the point...
I am doing a small practice program, to make it easier for me to do audio with BASS...


http://ace.pastey.net/48931


Ok, so theres my program. Now, when it is running, it uses about 60-70K of ram, when playing music, and 80% of my processor, according to task manager. I had originally made the same program, but using a port of BASS to FPC... No clue where I found it, but it all worked, minus a whole load of features. So, I decided to switch to the real BASS. Now, my original program, took a mere 4k ram, whether it was playing music or not. It showed 0% on the processor requirement.

As you can probably see in the code, I have 2 plugins loaded, but neither are used, so I commented them out, and it gave me somewhere in between 60% and 85% CPU usage, and 50, 880K memory, constantly. Slightly better, but nonetheless, horrible.



http://ace.pastey.net/48932


That's the source, using the BASSFPC.



http://rapidshare.com/files/34864726/code.rar.html


Thats both sources, .pas files, both compiled executables, plus example playlists. I realize it might not be fun to make a playlist, so I have a 'playlist converter' which converts m3u playlists to dxp playlists... Not included. So just put the paths to 3-4 songs in the file and make sure the last line of the file says 'last'. Bass source, aswell as BassFPC source, is included.

How can I get the memory requirements back down to what the BASSFPC one has? My program is meant to be in the background of games, with a VERY low memory imprint, and that, sadly, is not low enough. WMP has 5% or so CPU, and 10k RAM.

Please, any help would be appreciated.


EDIT : If you are using the New code, type at the menus:
create
load
play
to create, load, or play a playlist. In songs, type next to go the next one. Previous feature isn't implemented yet. pause and stop both work, and quit quits the program..

If using the old one, with BASS FPC, type:
create playlist
load playlist
play playlist

to create/load/play the playlist. You can use the same playlist in both. While playing a song, use:
next
prev
goto
volume
to switch songs. Volume sets the volume. To use goto, type:
goto
then at the prompt, type the number of the song to jump to.

EDIT EDIT:
The new code doesn't have error reporting yet... Very minimal. So if the program isn't working, try it with the original code, and if it loads fine, then it's a program bug- if not, the original code will report the errors.