Add error message if sound device cannot be opened.

This commit is contained in:
Greg Kennedy 2015-12-28 14:39:16 -06:00
parent 3351c3b820
commit b02099f52b
1 changed files with 3 additions and 0 deletions

View File

@ -1442,7 +1442,10 @@ bool8 S9xOpenSoundDevice (void)
so.sound_fd = open(sound_device, O_WRONLY | O_NONBLOCK);
if (so.sound_fd == -1)
{
fprintf(stderr, "ERROR: Failed to open sound device %s for writing.\n\t(Try loading snd-pcm-oss module?)\n", sound_device);
return (FALSE);
}
J = log2(unixSettings.SoundFragmentSize) | (3 << 16);
if (ioctl(so.sound_fd, SNDCTL_DSP_SETFRAGMENT, &J) == -1)