Author Topic: StandAlone source rebuilt.  (Read 30615 times)

0 Members and 1 Guest are viewing this topic.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
StandAlone source rebuilt.
« on: March 06, 2007, 01:23:10 PM »
All,

I thought I would chase the CPU utilization problem for a bit this afternoon and *may* have discovered the problem.

It is a real mess to gather up the required source code (I did not find all of it), but I think I have something that will work for our purposes.

There were several problems with their build and I can provide the details (Visual C++) if anyone is interested in replicating what I have found.

If you want to give this custom build a shot, here is the file:

http://home.comcast.net/~wuhu_software/files/OddcastV3StandaloneCustom.zip

Rename your existing OddcastV3Standalone.exe before unzipping this one so you can always go back to you were.

If the performance is verified on other machines, I will attempt to contact the author of the standalone and let them know what I have found.

Feedback is appreciated.

Thanks.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #1 on: March 06, 2007, 03:10:17 PM »
After playing with the new version, the improvement is not as good as I had hoped for on my machine.

It is a bit better, going from about the 30s to the high teens in CPU utilization.

It appears that the main encoding routines are sampling at 44Khz regardless of the streams you are uploading.

That being the case, I guess I would not really expect much lower CPU utilization.

It is possible to lower the interal sampling rate although this would create a custom version of the program.

Maybe if a I get bored...

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #2 on: March 06, 2007, 08:09:53 PM »
Quote from: "wuhu_software"
After playing with the new version, the improvement is not as good as I had hoped for on my machine.

It is a bit better, going from about the 30s to the high teens in CPU utilization.

It appears that the main encoding routines are sampling at 44Khz regardless of the streams you are uploading.

That being the case, I guess I would not really expect much lower CPU utilization.

It is possible to lower the interal sampling rate although this would create a custom version of the program.

Maybe if a I get bored...


Here's hoping you get bored.  :wink:

Any improvement would be a plus.  I suspect that's why so many people give up after giving it a try.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #3 on: March 06, 2007, 08:33:16 PM »
Quote from: "kray1000"
Quote from: "wuhu_software"
After playing with the new version, the improvement is not as good as I had hoped for on my machine.

It is a bit better, going from about the 30s to the high teens in CPU utilization.

It appears that the main encoding routines are sampling at 44Khz regardless of the streams you are uploading.

That being the case, I guess I would not really expect much lower CPU utilization.

It is possible to lower the interal sampling rate although this would create a custom version of the program.

Maybe if a I get bored...


Here's hoping you get bored.  :wink:

Any improvement would be a plus.  I suspect that's why so many people give up after giving it a try.


I will probably look in to it over the next few days.

Did you happen to try the build I made?

Thanks.

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #4 on: March 06, 2007, 09:33:35 PM »
Quote

I will probably look in to it over the next few days.

Did you happen to try the build I made?

Thanks.


Just now, yes.

The CPU usage seems to be exactly the same on my system... averaging right around 30% for me, using the August 2006 build.  I've tried other versions that didn't seem to make any difference.

If you happen to figure out why Oddcast doesn't initialize properly 95% of the time, let me know and I'll gladly test your build.  Having to be present to activate the stream when the machine is rebooting is getting old.  Someone could probably write a macro to automate this, but the ideal solution would be to fix the cause.  Maybe it's time to look at (or create) other alternatives... Winamp, for example, uses relatively few CPU cycles.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #5 on: March 06, 2007, 09:41:45 PM »
Quote from: "kray1000"
Quote

I will probably look in to it over the next few days.

Did you happen to try the build I made?

Thanks.


Just now, yes.

The CPU usage seems to be exactly the same on my system... averaging right around 30% for me, using the August 2006 build.  I've tried other versions that didn't seem to make any difference.

If you happen to figure out why Oddcast doesn't initialize properly 95% of the time, let me know and I'll gladly test your build.  Having to be present to activate the stream when the machine is rebooting is getting old.  Someone could probably write a macro to automate this, but the ideal solution would be to fix the cause.  Maybe it's time to look at (or create) other alternatives... Winamp, for example, uses relatively few CPU cycles.


One thing you can do to increase the probability that it will initialize is to launch in via a batch file on boot. In the batch file, you add a delay for around 2 minutes before launching oddcast. This seems to work most of the time.

In the meantime I will poke around to see why it does not work on startup but always works when you reselect the sound card.

Thanks.

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #6 on: March 06, 2007, 09:49:36 PM »
Quote from: "wuhu_software"


One thing you can do to increase the probability that it will initialize is to launch in via a batch file on boot. In the batch file, you add a delay for around 2 minutes before launching oddcast. This seems to work most of the time.

In the meantime I will poke around to see why it does not work on startup but always works when you reselect the sound card.

Thanks.


I've "manually" delayed launching the application as well as using software (StartWatch with a 2-minute delay) to delay the launch, with no change.  I haven't tried using a batch file, though.  What commands would you recommend I use?

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #7 on: March 06, 2007, 10:52:42 PM »
Quote from: "kray1000"
Quote from: "wuhu_software"


One thing you can do to increase the probability that it will initialize is to launch in via a batch file on boot. In the batch file, you add a delay for around 2 minutes before launching oddcast. This seems to work most of the time.

In the meantime I will poke around to see why it does not work on startup but always works when you reselect the sound card.

Thanks.


I've "manually" delayed launching the application as well as using software (StartWatch with a 2-minute delay) to delay the launch, with no change.  I haven't tried using a batch file, though.  What commands would you recommend I use?


If you already have a mechanism and it does not work, I would not bother with it but here is what I use:

@echo off
rem
rem Perform a 2 min sleep (note Sleep.exe must be in the Path!)
rem
Sleep 120000
rem
rem Sleep is done, launch Oddcast.
rem
cd "C:\Program Files\OddcastV3"
start /min "" /REALTIME "C:\Program Files\OddcastV3\OddcastV3Standalone.exe"
rem
rem Done!
rem

This relies on a simple program, sleep.exe that accepts milliseconds to delay as a parameter. If you hit any key, sleep will immediately exit.

Put the sleep program in the same directory as the batch file.

I have uploaded sleep.exe to my site:

http://home.comcast.net/~wuhu_software/files/Sleep.exe

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #8 on: March 06, 2007, 11:00:30 PM »
Quote from: "kray1000"
Quote

I will probably look in to it over the next few days.

Did you happen to try the build I made?

Thanks.


Just now, yes.

The CPU usage seems to be exactly the same on my system... averaging right around 30% for me, using the August 2006 build.  I've tried other versions that didn't seem to make any difference.

If you happen to figure out why Oddcast doesn't initialize properly 95% of the time, let me know and I'll gladly test your build.  Having to be present to activate the stream when the machine is rebooting is getting old.  Someone could probably write a macro to automate this, but the ideal solution would be to fix the cause.  Maybe it's time to look at (or create) other alternatives... Winamp, for example, uses relatively few CPU cycles.


If you want to give the test another shot, I have made more changes, including decreasing the internal sampling rate from 44K to 22K.

I am now seeing 2-4% with an occassional 15% spike (900Mhz AMD).

I am using the following enoder settings (In stand alone, right click your encoder in the window to change it's settings).

Bit Rate: 16
Quality: 0 (gray'ed out)
Samplerate: 22050
Channels: 1 (joint stereo unchecked)
Encoder: MP3 Lame Type
Servertype: Icecast2
ServerIP: audiostream.wunderground.com
*
*
Reconnect seconds: 10

http://home.comcast.net/~wuhu_software/files/OddcastV3StandaloneCustom.zip

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #9 on: March 06, 2007, 11:01:12 PM »
Quote from: "wuhu_software"

If you already have a mechanism and it does not work, I would not bother with it but here is what I use:

@echo off
rem
rem Perform a 2 min sleep (note Sleep.exe must be in the Path!)
rem
Sleep 120000
rem
rem Sleep is done, launch Oddcast.
rem
cd "C:\Program Files\OddcastV3"
start /min "" /REALTIME "C:\Program Files\OddcastV3\OddcastV3Standalone.exe"
rem
rem Done!
rem

This relies on a simple program, sleep.exe that accepts milliseconds to delay as a parameter. If you hit any key, sleep will immediately exit.

Put the sleep program in the same directory as the batch file.

I have uploaded sleep.exe to my site:

http://home.comcast.net/~wuhu_software/files/Sleep.exe


No harm trying it.  Maybe launching it from DOS would work better than letting Windows launch it.  Imagine that!

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #10 on: March 06, 2007, 11:03:22 PM »
Quote from: "wuhu_software"

If you want to give the test another shot, I have made more changes, including decreasing the internal sampling rate from 44K to 22K.

I am now seeing 2-4% with an occassional 15% spike (900Mhz AMD).

I am using the following enoder settings (In stand alone, right click your encoder in the window to change it's settings).

Bit Rate: 16
Quality: 0 (gray'ed out)
Samplerate: 22050
Channels: 1 (joint stereo unchecked)
Encoder: MP3 Lame Type
Servertype: Icecast2
ServerIP: audiostream.wunderground.com
*
*
Reconnect seconds: 10

http://home.comcast.net/~wuhu_software/files/OddcastV3StandaloneCustom.zip


Sure, I'm game...

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #11 on: March 06, 2007, 11:16:34 PM »
Quote from: "kray1000"


Sure, I'm game...


Well, it is a little less.  Still creeps over 30% but at least now it's dropping into the teens for me at times.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #12 on: March 06, 2007, 11:21:26 PM »
Quote from: "kray1000"
Quote from: "kray1000"


Sure, I'm game...


Well, it is a little less.  Still creeps over 30% but at least now it's dropping into the teens for me at times.


Couple questions:

What is your CPU?

What sample rate were you running previously?

Thanks.

PS - Not sure I can do much more with it... Buffers are replicated over and over in the source code. I am not really surprised it is a bit of a CPU hog. Very inefficient code. I have not even looked at the encoders (LAME MP3), just the stand alone code. ugh.

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #13 on: March 06, 2007, 11:29:36 PM »
Quote from: "wuhu_software"

Couple questions:

What is your CPU?

What sample rate were you running previously?


AMD Athlon 64 Processor (2.2 GHz, 2000 FSB).  Maybe running a P4 would give me better results.

Running 22050 before and after.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #14 on: March 06, 2007, 11:32:57 PM »
Quote from: "kray1000"
Quote from: "wuhu_software"

Couple questions:

What is your CPU?

What sample rate were you running previously?


AMD Athlon 64 Processor (2.2 GHz, 2000 FSB).  Maybe running a P4 would give me better results.

Running 22050 before and after.


Not that is strange... I am on an old 900mhz, not seeing 30% at all. I am seeing mostly mid teens for CPU utilization.

I am wondering if in your situation it has something to do with the sound card / Windows.

I have an old sound blaster live card. Running Windows 2000.

Hmmm.

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #15 on: March 06, 2007, 11:40:46 PM »
Quote from: "wuhu_software"

Not that is strange... I am on an old 900mhz, not seeing 30% at all. I am seeing mostly mid teens for CPU utilization.

I am wondering if in your situation it has something to do with the sound card / Windows.

I have an old sound blaster live card. Running Windows 2000.

Hmmm.


I am also running the ImageSalsa webcam software on that machine because of the fast bus speeds, but I doubt that's the issue since so many people are having this problem.

I have a piece-of-crap Realtek AC97 sound card.  I'm surprised my feed sounds decent at all.  I may have a SoundBlaster Live! card installed on one of my backup machines.  If I get bored this weekend, maybe I'll try Oddcast on it.

Running XP SP2.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #16 on: March 06, 2007, 11:45:04 PM »
Quote from: "kray1000"
Quote from: "wuhu_software"

Not that is strange... I am on an old 900mhz, not seeing 30% at all. I am seeing mostly mid teens for CPU utilization.

I am wondering if in your situation it has something to do with the sound card / Windows.

I have an old sound blaster live card. Running Windows 2000.

Hmmm.


I am also running the ImageSalsa webcam software on that machine because of the fast bus speeds, but I doubt that's the issue since so many people are having this problem.

I have a piece-of-crap Realtek AC97 sound card.  I'm surprised my feed sounds decent at all.  I may have a SoundBlaster Live! card installed on one of my backup machines.  If I get bored this weekend, maybe I'll try Oddcast on it.

Running XP SP2.


That is true, it seems to be a common problem. I guess we need to test some other machines. Will find someone tomorrow.

Just wondering, under control panel/system/sounds and multi-media, audio tab, under play back and recording devices advanced, is the hardware acceleration turned all the way up?

Another thought might be to check for the latest sound card drivers. You know how that goes, driver de jour in the MS world.

I am off for the night. Will look at this again tomorrow.

Thanks for testing.

Offline kray1000

  • Purveyor of wry
  • Forecaster
  • *****
  • Posts: 1336
    • http://www.roanokevalleyweather.com
Re: StandAlone source rebuilt.
« Reply #17 on: March 06, 2007, 11:50:52 PM »
Quote from: "wuhu_software"
Quote from: "kray1000"
Quote from: "wuhu_software"

Not that is strange... I am on an old 900mhz, not seeing 30% at all. I am seeing mostly mid teens for CPU utilization.

I am wondering if in your situation it has something to do with the sound card / Windows.

I have an old sound blaster live card. Running Windows 2000.

Hmmm.


I am also running the ImageSalsa webcam software on that machine because of the fast bus speeds, but I doubt that's the issue since so many people are having this problem.

I have a piece-of-crap Realtek AC97 sound card.  I'm surprised my feed sounds decent at all.  I may have a SoundBlaster Live! card installed on one of my backup machines.  If I get bored this weekend, maybe I'll try Oddcast on it.

Running XP SP2.


That is true, it seems to be a common problem. I guess we need to test some other machines. Will find someone tomorrow.

Just wondering, under control panel/system/sounds and multi-media, audio tab, under play back and recording devices advanced, is the hardware acceleration turned all the way up?

Another thought might be to check for the latest sound card drivers. You know how that goes, driver de jour in the MS world.

I am off for the night. Will look at this again tomorrow.

Thanks for testing.


According to Microsoft Update, I have the latest drivers.  Never made any changes to the hardware acceleration... the default I believe is "full".

Offline ncpilot

  • Forecaster
  • *****
  • Posts: 937
    • Monkey Junction Weather
Re: StandAlone source rebuilt.
« Reply #18 on: March 07, 2007, 10:11:46 AM »
I'll try it out tonight...
Marc
Wilmington, NC
"Monkey Junction Weather"
Davis VP2 wireless, WeatherLink

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #19 on: March 07, 2007, 11:58:44 AM »
Ok, I looked over the code and found more snafus.

Try the latest version and let me know what you see.

Thanks!

http://home.comcast.net/~wuhu_software/files/OddcastV3StandaloneCustom.zip

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #20 on: March 07, 2007, 12:35:02 PM »
Just a quick note, there is noticeable correlation between oddcast CPU utilization and other socket based applications.

If I run Yahoo messanger that occasional polls the server, I can see the oddcast CPU utilization go up.

I am guessing this would have something to do with the Winsock DLL although that would take more digging.

Try running this latest version with no messanger, browser, or other socket based applications to see if it has an effect on your machine.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #21 on: March 07, 2007, 05:10:57 PM »
Quote from: "kray1000"
Quote

I will probably look in to it over the next few days.

Did you happen to try the build I made?

Thanks.


Just now, yes.

The CPU usage seems to be exactly the same on my system... averaging right around 30% for me, using the August 2006 build.  I've tried other versions that didn't seem to make any difference.

If you happen to figure out why Oddcast doesn't initialize properly 95% of the time, let me know and I'll gladly test your build.  Having to be present to activate the stream when the machine is rebooting is getting old.  Someone could probably write a macro to automate this, but the ideal solution would be to fix the cause.  Maybe it's time to look at (or create) other alternatives... Winamp, for example, uses relatively few CPU cycles.


A fellow stand alone oddcast user posted a tip a while back on the oddcast form but I never checked it out until now.

He said that when he download the new bass DLL, the startup problems went away.

Here is a link to the last bass audio library.

http://www.un4seen.co.uk/files/bass23.zip

Inside that .zip file is the new bass.dll, unzip it to your oddcast stand alone directory (you might want back up your bass.dll first, exit the stand alone before attempting a rename).

Let me know if it works.

On my system, it never would work right after a boot.

I launched it immediately, and it worked.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: StandAlone source rebuilt.
« Reply #22 on: March 07, 2007, 07:54:30 PM »
Well, you want to hear something funny?

All the changes I did to reduce the sample rate and fixing really bad code...

As it turns out this was relieving some internal issue on the old bass.dll, probably it's buffer management.

The new bass.dll will not only fix the startup issue but *also* the cpu utilization issue.

I am running the orignal Aug 7 release of standalone.exe with the new bass.dll, cpu utlization is 2%.

Now THAT is funny!!!

Offline ncpilot

  • Forecaster
  • *****
  • Posts: 937
    • Monkey Junction Weather
Re: StandAlone source rebuilt.
« Reply #23 on: March 07, 2007, 09:39:19 PM »
Didn't fix it on my machine, still in the 10-15% cpu range...

On an Athlon 64 3000+...

That's still using the "old" version of the program, not yours...

Next I guess I'll try your version...

Also, let it run longer on your machine, I found that sometimes cpu utilization increases over time...
Marc
Wilmington, NC
"Monkey Junction Weather"
Davis VP2 wireless, WeatherLink

Offline ncpilot

  • Forecaster
  • *****
  • Posts: 937
    • Monkey Junction Weather
Re: StandAlone source rebuilt.
« Reply #24 on: March 07, 2007, 09:48:53 PM »
Running your "hacked" program, with the new bass.dll, I get 3-5% cpu...

But, I'm also picking up a weather station in California now... ??

 :lol:  :lol:  just kidding...
Marc
Wilmington, NC
"Monkey Junction Weather"
Davis VP2 wireless, WeatherLink

 

anything