Maybe the device is already being used by some others (like PulseAudio)? If you're running PulseAudio, start the program with pasuspender to make sure PA leaves the devices.