I have a python script that is using pygame to load sound and play them. When I run my script without sudo, it is working fine. But when I run the script with sudo, I get these errors:
Home directory not accessible: Permission denied
ALSA lib pcm_mmap.c:341:(snd_pcm_mmap) mmap failed: Invalid argument
Does anyone have any idea on why this is happening? I would like to understand what's going on and not only get a quick fix in case this happens again in another context and because I might need to run the script with sudo
.