summaryrefslogtreecommitdiff
path: root/src/class/audio/audio_device.h
diff options
context:
space:
mode:
authorValentin Milea <[email protected]>2021-12-06 18:49:58 +0200
committerValentin Milea <[email protected]>2021-12-06 18:49:58 +0200
commitef879e8a8a43dfa34160f50d7f432c3140dec7fa (patch)
treef266bcf610e71d9fdd2c97f30d3fc3e258ecb963 /src/class/audio/audio_device.h
parent3e9bb3bee1e835a0d99c3f503c63cf0481b45ce2 (diff)
Support disabling feedback format correction #1234
Diffstat (limited to 'src/class/audio/audio_device.h')
-rw-r--r--src/class/audio/audio_device.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/class/audio/audio_device.h b/src/class/audio/audio_device.h
index 5a469523c..731fd6c01 100644
--- a/src/class/audio/audio_device.h
+++ b/src/class/audio/audio_device.h
@@ -186,6 +186,11 @@
#define CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP 0 // Feedback - 0 or 1
#endif
+// Disable/enable conversion from 16.16 to 10.14 format on high-speed devices. See tud_audio_n_fb_set().
+#ifndef CFG_TUD_AUDIO_DISABLE_FEEDBACK_FORMAT_CORRECTION
+#define CFG_TUD_AUDIO_DISABLE_FEEDBACK_FORMAT_CORRECTION 0 // 0 or 1
+#endif
+
// Audio interrupt control EP size - disabled if 0
#ifndef CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
#define CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN 0 // Audio interrupt control - if required - 6 Bytes according to UAC 2 specification (p. 74)
@@ -458,6 +463,11 @@ TU_ATTR_WEAK bool tud_audio_fb_done_cb(uint8_t rhport);
// Value will be corrected for FS to 10.14 format automatically.
// (see Universal Serial Bus Specification Revision 2.0 5.12.4.2).
// Feedback value will be sent at FB endpoint interval till it's changed.
+//
+// Note that the USB Audio 2.0 driver on Windows 10 is not following the spec and expects 16.16
+// format for FS. You can define CFG_TUD_AUDIO_DISABLE_FEEDBACK_FORMAT_CORRECTION=1 as a workaround
+// to transmit the feedback value unchanged. Be aware that this might break feedback on other hosts,
+// though at least on Linux the ALSA driver will happily accept either format.
bool tud_audio_n_fb_set(uint8_t func_id, uint32_t feedback);
static inline bool tud_audio_fb_set(uint32_t feedback);
#endif