From 08c6f50706f9c90b7d00a44b4fc3f050e373aa2a Mon Sep 17 00:00:00 2001 From: Yuri Date: Tue, 18 Jul 2017 20:46:10 -0700 Subject: [PATCH] Added the checks for a match of actual and requested sample-rates in the OSS driver. Fail in case of a sample rate mimatch. Error message recommends using --enable-oss-cookedmode in case of a mismatch. --- drivers/oss/oss_driver.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/oss/oss_driver.c b/drivers/oss/oss_driver.c index f53a2dd4..a9a27598 100644 --- a/drivers/oss/oss_driver.c +++ b/drivers/oss/oss_driver.c @@ -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)); @@ -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));