I've solved this problem by myself. May be it's good to remove this thread.
But if smb wants to know, the problem was in:
Code:
local all_info = io.popen("amixer sget PCM"):read("*a");
local value = string.match(all_info, "%d+%%");
io.popen(...) returns nil sometimes, so error occurs in "string.match(all_info, "%d+%%");"