Write your own Einstein@home screensaver

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

@ Oliver : Thank you, you've

@ Oliver : Thank you, you've been very helpful. I'll look into all of that. :-)

@ Bikeman: No, I can't find libaudio either! But Google immediately indicates a number of sites to obtain it from.

Cheers, Mike.

( edit ) It seems that 'pulseaudio' is used in more recent Linux distros.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

Ok, got annoyed with the

Ok, got annoyed with the sound business. SUSE didn't have the required version for ESD ( >= 0.2.8 ), the sound driver. Nothing has been written for this distro that would satisfy the SDL build. Found the esd 0.2.8 package to compile with but my Suse isn't an accessible host/target for the script, written ~ 2004.

So who needs sound for a screensaver?? Not me ..... :-)

Looking in 'build.sh' at 'build_generic()' function at around line 214+ the configure for SDL build can be altered to remove building of the sound aspects. If you go to :

your_project_root_directory_here/3rdparty/sdl/

and type

./configure --help

you'll get the options for the SDL build that appear below. Now replace lines 214 to 221 in 'build.sh' with these :[pre]
if [ "$1" == "$TARGET_MAC_INTEL" -o "$1" == "$TARGET_MAC_PPC" ]; then
$ROOT/3rdparty/sdl/configure --prefix=$ROOT/install --enable-audio=no \
--enable-oss=no --enable-alsa=no --disable-alsatest \
--enable-alsa-shared=no --enable-esd=no --disable-esdtest \
--enable-esd-shared=no --enable-pulseaudio=no \
--enable-pulseaudio-shared=no --enable-arts=no --enable-arts-shared=no \
--enable-nas=no --enable-diskaudio=no --enable-dummyaudio=no \
--enable-mintaudio=no \
--enable-shared=no --enable-static=yes --enable-screensaver=yes \
--enable-video-x11=no >> $LOGFILE 2>&1 || failure
else
$ROOT/3rdparty/sdl/configure --prefix=$ROOT/install --enable-audio=no \
--enable-oss=no --enable-alsa=no --disable-alsatest \
--enable-alsa-shared=no --enable-esd=no --disable-esdtest \
--enable-esd-shared=no --enable-pulseaudio=no \
--enable-pulseaudio-shared=no --enable-arts=no --enable-arts-shared=no \
--enable-nas=no --enable-diskaudio=no --enable-dummyaudio=no \
--enable-mintaudio=no \
--enable-shared=no --enable-static=yes --enable-screensaver=yes >> $LOGFILE 2>&1 || failure
fi [/pre]which as far as I can tell eliminates all sound components. Then rebuild. Worked a treat for me, have done a --linux build with no problems. :-) :-)

Oh, and the libdirectfb-dev came in just fine.

Cheers, Mike.

( edit ) Of course this implies that one does not later do this :

SDL_Init(SDL_INIT_AUDIO);

and like sound functionality.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bikeman (Heinz-Bernd Eggenstein)
Bikeman (Heinz-...
Moderator
Joined: 28 Aug 06
Posts: 3,522
Credit: 693,653,834
RAC: 110,701

Hi! Sounds great (no pun

Hi!

Sounds great (no pun intended :-) ). I suppose that the best way to keep track of all the modifications is to prepare patch files (e.g. for eliminating the audio from SGL in the build script) and post it here and/or sent it to Oliver directly.

Should we do this?

CU
Bikeman

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

Here it is ... Cheers,

Here it is ...

Cheers, Mike.

( edit ) The only other 'optional' components for SDL operation [ ie. those that aren't initialised regardless on using SDL_Init() ] for our purposes would be CDROM I think. Of course we need video and I expect the timer too ....

( edit ) --win32 build successful ( and ran on a windows machine ) :-)

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Oliver Behnke
Oliver Behnke
Moderator
Administrator
Joined: 4 Sep 07
Posts: 981
Credit: 25,170,813
RAC: 5

Hi Mike and

Message 77992 in response to message 77989

Hi Mike and Bikeman!

Quote:

So who needs sound for a screensaver?? Not me ..... :-)


Who uses Suse? Not me ;-)

To be honest, Bernd and I discussed this a couple of months ago and I wanted to keep all of SDL's nice features in the framework because you just never know. There could be someone out there who comes up with a screensaver that makes use of audio (hopefully optional) or even a joystick. The build dependencies "only" affect potential developers after all because we use fully static builds...

Quote:

Oh, and the libdirectfb-dev came in just fine.


Great!

Quote:

I suppose that the best way to keep track of all the modifications is to prepare patch files (e.g. for eliminating the audio from SGL in the build script) and post it here and/or sent it to Oliver directly.


As stated above, I'd like to keep this particular feature in "mainline" but we should certainly retain all "optional" patches in this thread. I think it would be even better to have some sort of a wiki for this kind of content (hm, will BOINC's upcoming Drupal CMS support that?)... If you are familiar with git you may of course clone our repository, make your personal changes and publish (e.g. at github) your repository - that's how distributed SCM works :-)

Best,
Oliver

Einstein@Home Project

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

Fair enough. I wasn't wanting

Fair enough. I wasn't wanting to change the framework, I was just so pleased to localise my problem and get a successful build. :-)

.... and enjoying the scripting. So now the framework is in place I can get cracking on the content! :-)

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

Thinking out loud. :-) So

Thinking out loud. :-)

So for an initial/minimal stab at this, I'll use :

screen-size = 800 x 600

bits-per-pixel/color-depth = 16

( nominal ) frames-per-second = 20

and worry about other modes/options for later.

I'll also seek double-buffering if available, as with SDL you can attempt to set this with SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER) and then use SDL_GL_GetAttribute() to see if you got it - maybe set a flag, and then only swap at end of redraw accordingly. All alternately not check the success of the setting but just call SDL_GL_SwapBuffers() anyway, as it does nothing if double buffering is not about.

Cheers, Mike.

( edit ) Here's a useful wiki for all of this stuff.

( edit ) Blush ..... well a clever bloke would look at and notice the framework already written! To wit, the WindowManager class .... and others. :-)

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bikeman (Heinz-Bernd Eggenstein)
Bikeman (Heinz-...
Moderator
Joined: 28 Aug 06
Posts: 3,522
Credit: 693,653,834
RAC: 110,701

This is fun! Mostly

This is fun!

Mostly sticking to the existing code (I'm not good in computer gfx ), I'm trying to visualize the ongoing computation similar to the TOPCAT visualizations I've posted here earlier. Before completing the code that actually reads the checkpoint file, I used some static example data to see what the visual effect would be like. This is a screenshot showing this prototype with constellation and star features toggled off to reduce the clutter


What do you think? BTW,in the finished thing, the crosshair marker would always be at the edge of the rainbow pattern, "dropping" new rainbow-color-map pixels into the sphere as it (very slowly) moves across the sky.

Bikeman

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,578
Credit: 306,459,890
RAC: 190,463

RE: This is fun! ......

Message 77996 in response to message 77995

Quote:
This is fun! ......
What do you think? BTW,in the finished thing, the crosshair marker would always be at the edge of the rainbow pattern, "dropping" new rainbow-color-map pixels into the sphere as it (very slowly) moves across the sky.Bikeman


Beautiful! I think it's precisely these sort of ideas that are being sought to include using the framework. Nice idea to 'paint' the pattern on, in real time, so to speak.

I'm ( ambitiously ) working/designing a basic solar system model - to be inserted within the sphere's volume, while the sphere's radius size is pushed out to some large size. I think I'll keep the starfield but drop the constellation lines/connectors. Instead of rotating the sphere I'll shift the viewpoint ( which is equivalent really in OpenGL terms anyway ) - try some 'manoevring' using the keyboard, orbits etc. I'm also thinking of a decal-like pixellated picture/texture ( on the inner/distant celestial sphere in the background ) of that famous picture of Einstein poking this tongue out! :-) The resource coding assistance part of the framework will be invaluable for that.

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bikeman (Heinz-Bernd Eggenstein)
Bikeman (Heinz-...
Moderator
Joined: 28 Aug 06
Posts: 3,522
Credit: 693,653,834
RAC: 110,701

RE: . I'm ( ambitiously )

Message 77997 in response to message 77996

Quote:

.

I'm ( ambitiously ) working/designing a basic solar system model - to be inserted within the sphere's volume, while the sphere's radius size is pushed out to some large size. I think I'll keep the starfield but drop the constellation lines/connectors. Instead of rotating the sphere I'll shift the viewpoint ( which is equivalent really in OpenGL terms anyway ) - try some 'manoevring' using the keyboard, orbits etc. I'm also thinking of a decal-like pixellated picture/texture ( on the inner/distant celestial sphere in the background ) of that famous picture of Einstein poking this tongue out! :-) The resource coding assistance part of the framework will be invaluable for that.

Cheers, Mike.

Wow!! That's far more complex than what I think I could do in a reasoable time span. I'm looking forward to see Albert Einstein's portrait in the screensaver, nice idea!

CU
Bikeman

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.