Be aware that alsa is "just" the lowest level of the linux sound stack. Nowadays, most distributions use a sound-server which is between alsa and the applications. The two main sound servers are "jack" (for "serious" sound users) and "pulseaudio" (for standard users). So maybe you can't directly use alsa while the sound-server is running (like any critical resource)?
Another possibility could be that the user running your application don't have the right to open/read/write any alsa device. Run it as "root", or better add the user to the alsa group (maybe sound or audio group, depends on the linux flavor)
|