Changes The return value from nanosleep wasn't being checked. It is now checked and nanosleep restarted if needed. This may fix some problems with the volume fading.