Skip to content

Commit

Permalink
Added the checks for a match of actual and requested sample-rates in …
Browse files Browse the repository at this point in the history
…the OSS driver.

Fail in case of a sample rate mimatch.
Error message recommends using --enable-oss-cookedmode in case of a mismatch.
  • Loading branch information
yurivict committed Jul 19, 2017
1 parent cb654ad commit 08c6f50
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/oss/oss_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,13 @@ static int oss_driver_start (oss_driver_t *driver)
"OSS: failed to set samplerate for %s: %s@%i, errno=%d",
indev, __FILE__, __LINE__, errno);
}
if (samplerate != driver->sample_rate) {
jack_error (
"OSS: failed to set the recording sample-rate for %s: %s@%i, requested-sample-rate=%d, obtained-sample-rate=%d",
indev, __FILE__, __LINE__, driver->sample_rate, samplerate);
jack_error ("OSS: please consider configuring with --enable-oss-cookedmode");
return -1;
}
jack_info ("oss_driver: %s : 0x%x/%i/%i (%i)", indev,
format, channels, samplerate, get_fragment (infd));

Expand Down Expand Up @@ -608,6 +615,13 @@ static int oss_driver_start (oss_driver_t *driver)
"OSS: failed to set samplerate for %s: %s@%i, errno=%d",
outdev, __FILE__, __LINE__, errno);
}
if (samplerate != driver->sample_rate) {
jack_error (
"OSS: failed to set the playback sample-rate for %s: %s@%i, requested-sample-rate=%d, obtained-sample-rate=%d",
indev, __FILE__, __LINE__, driver->sample_rate, samplerate);
jack_error ("OSS: please consider configuring with --enable-oss-cookedmode");
return -1;
}
jack_info ("oss_driver: %s : 0x%x/%i/%i (%i)", outdev,
format, channels, samplerate,
get_fragment (outfd));
Expand Down

0 comments on commit 08c6f50

Please sign in to comment.