Yep, I'm with all of that - it does seem like a nice clean algorithm to me. What would be nice is to make the various parameters configurable so everyone can tweak the adjustment to suit their own preferences.

I presume there's an IOCTL call for reading config.ini already from a user app? If so the config stuff could go in there (I seem to recall other userland apps using this approach). I haven't checked whether GPSapp already has support for configuration settings - worst case scenario would be a few additional command line switches to tweak the volume adjustment.

If I understand your explanation correctly, then the need for hysteresis is removed too... Nice!