+#include "protocol.h"
+
+/*
+ * There is no way to get a list of supported samplerates from ALSA. We could
+ * use the 'plughw' interface of ALSA, in which case any format and/or
+ * samplerate conversion would be performed by ALSA. However, we are interested
+ * in the hardware capabilities, and have the infrastructure in sigrok to do so.
+ * We therefore use the 'hw' interface. The downside is that the code gets a
+ * little bulkier, as we have to keep track of the hardware capabilities, and
+ * only use those that the hardware supports. Case in point, ALSA will not give
+ * us a list of capabilities; we have to test for each one individually. Hence,
+ * we keep lists of the capabilities we are interested in.
+ */
+static const unsigned int rates[] = {
+ 5512,
+ 8000,
+ 11025,
+ 12000,
+ 16000,
+ 22050,
+ 24000,
+ 32000,
+ 44100,
+ 48000,
+ 64000,
+ 88200,
+ 96000,
+ 176400,
+ 192000,
+ 384000,
+ 768000, /* Yes, there are sound cards that go this high. */
+};