Author

Topic: "screensaver" mode (Read 7596 times)

sr. member
Activity: 252
Merit: 250
September 08, 2010, 02:32:32 PM
#4
Last time I checked (that was fairly long time ago, around 2006) Seti@Home used BOINC infrastructure. That middleware has advanced means of controlling CPU usage, supports automatic signed updates for all platforms and has many other sweet features,  but unfortunately it's centralized and we cannot use it as is. But maybe we can develop an alternative client able to work under control of BOINC, so people can for example specify how much CPU they dedicate for BTC and how much for Seti@Home and other BOINC projects.
sr. member
Activity: 520
Merit: 253
555
September 07, 2010, 09:37:48 AM
#3
Actually, I only use simple screen blanking in Linux, set via xset. I have also used xset to monitor the display status, this only needs a script running constantly in the background. Here, when the display turns off, bitcoin generation is turned on, and vice versa.

Code:
#!/bin/bash

CMD="/home/teknohog/distr.projects/bitcoin-svn/bitcoind setgenerate"

OLD_STATE=""

while true; do
    STATE=`DISPLAY=:0 xset q | grep Monitor | awk '{print $3 $4}'`

    # Collapse all "off" states into one
    case $STATE in
        inStandby|inSuspend|Off)
            STATE=Off
            ;;
    esac

    # Only run the command when the display state changes:
    # on to standby -> start generating
    # standby to on -> stop generating

    if [ "$OLD_STATE" == "On" ] && [ "$STATE" == "Off" ]; then
        $CMD true
    elif [ "$OLD_STATE" == "Off" ] && [ "$STATE" == "On" ]; then
        $CMD false
    fi

    OLD_STATE=$STATE

    sleep 1
done
sr. member
Activity: 520
Merit: 253
555
September 07, 2010, 08:44:58 AM
#2
it would make more sense if bitcoind only ran generation when the system was idle, and then it could run at 100%

Is this feasible at all?  I guess I could write some cronjob that checks CPU activity and turns on/off the daemon... not sure)

Seti@Home was originally a screensaver application, so the entire program started and stopped like any other screensaver. But Bitcoin needs to be running all the time for the network to function.

Therefore, the screensaver could be a script that runs "bitcoind setgenerate true" as it starts. The script then stays in an idle loop, and when the screensaver turns off , it catches the termination signal and runs "bitcoind setgenerate false". Or do the equivalent using JSON-RPC, which is a little more elegant, as it does not need execute permissions for bitcoind itself. This should be easy to do in Linux, I'm not sure about other systems.
full member
Activity: 546
Merit: 101
September 06, 2010, 06:40:13 PM
#1
I've been running bitcoind in the background (genproclimit'd to half my cores) for the past while, and it's mostly been fine, but today I tried to play an HD video with VLC and my system overheated and shut down after 10-15 minutes.  I got to thinking: it would make more sense if bitcoind only ran generation when the system was idle, and then it could run at 100%

Is this feasible at all?  I guess I could write some cronjob that checks CPU activity and turns on/off the daemon... not sure)
Jump to: