Using a USB DAC (AudioQuest DragonFly) I get clicking and popping (vinyl-like). With FreeBSD 9.3 I was able to get clean output by setting the default sample rate to 44100. With 10.3 that is not the case. This is the device: uaudio0: <AudioQuest inc. AudioQuest DragonFly, class 0/0, rev 1.00/1.0c, addr 10> on usbus1 uaudio0: Play: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play: 96000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play: 88200 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: No recording. uaudio0: No MIDI sequencer. pcm3: <USB audio> on uaudio0 uaudio0: No HID volume keys found. # sysctl dev.pcm.3 dev.pcm.3.feedback_rate: 44049 dev.pcm.3.mixer.mute_1.desc: AudioQuest DragonFly dev.pcm.3.mixer.mute_1.max: 1 dev.pcm.3.mixer.mute_1.min: 0 dev.pcm.3.mixer.mute_1.val: 0 dev.pcm.3.mixer.vol_0_1.desc: AudioQuest DragonFly dev.pcm.3.mixer.vol_0_1.max: 53 dev.pcm.3.mixer.vol_0_1.min: 0 dev.pcm.3.mixer.vol_0_1.val: 29 dev.pcm.3.mixer.vol_0_0.desc: AudioQuest DragonFly dev.pcm.3.mixer.vol_0_0.max: 53 dev.pcm.3.mixer.vol_0_0.min: 0 dev.pcm.3.mixer.vol_0_0.val: 29 dev.pcm.3.bitperfect: 0 dev.pcm.3.buffersize: 0 dev.pcm.3.play.vchanformat: s16le:2.0 dev.pcm.3.play.vchanrate: 44100 dev.pcm.3.play.vchanmode: fixed dev.pcm.3.play.vchans: 1 dev.pcm.3.hwvol_mixer: vol dev.pcm.3.hwvol_step: 5 dev.pcm.3.%parent: uaudio0 dev.pcm.3.%pnpinfo: dev.pcm.3.%location: dev.pcm.3.%driver: pcm dev.pcm.3.%desc: USB audio I do seem to see these with debugging turned up: uaudio_chan_play_sync_callback: Comparing 44149 Hz :: 44100 Hz
Can you collect a few of these and show how they change over time?
With this kernel: FreeBSD bloaty 10.3-RELEASE-p4 FreeBSD 10.3-RELEASE-p4 #0: Sat May 28 12:23:44 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 And hw.snd.verbose=4 I see: pcm3: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=0, old=0 delta=0 amt=0 ready=4236 free=0 With hw.usb.uaudio.debug=15 I see: uaudio_chan_play_sync_callback: Comparing 44149 Hz :: 44100 Hz This doesn't appear to vary, and has appeared consistent with the 10.3 kernels. The same hardware worked without fault in 9.x. Sorry for the delay, but this machine is unsuitable for audio playback currently so I've not tried in a while.
Hi, Do you have a link where such a device can be bought? Used or new? There has been updates in the USB audio driver which might have broken your device, but fixed others. --HPS
I believe I purchased mine from Amazon, although the version I have (1.2, IIRC) has since been discontinued.
Perhaps this is the same issue that causes my Razer Megalodon (USB headset) to constantly crackle as well. It was nearly fixed by hselasky's suggestion: ----- Edit: sys/dev/usb/usb_freebsd.h And change: #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ Into: #define USB_FS_ISOC_UFRAME_MAX 5 /* exclusive unit */ Then re-build the kernel. ----- There is still a crackle for 2 seconds every time a new audio stream starts, but it goes away after that. I thought the 11.0 upgrade would fix this, but I still need a custom kernel. If this is not the same issue, I'll open a new one, thanks.
A commit references this bug: Author: hselasky Date: Tue Nov 8 08:09:49 UTC 2016 New revision: 308437 URL: https://svnweb.freebsd.org/changeset/base/308437 Log: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. PR: 208791 MFC after: 3 days Changes: head/sys/dev/sound/usb/uaudio.c
I believe your issue is fixed after another FreeBSD user reported a similar issue with the same USB audio device. Please test the patch mentioned above in this PR.
A commit references this bug: Author: hselasky Date: Wed Nov 9 07:09:27 UTC 2016 New revision: 308461 URL: https://svnweb.freebsd.org/changeset/base/308461 Log: Allow higher sample rates to have more jitter than lower ones. PR: 208791 MFC after: 3 days Changes: head/sys/dev/sound/usb/uaudio.c
A commit references this bug: Author: hselasky Date: Sat Nov 12 17:27:28 UTC 2016 New revision: 308571 URL: https://svnweb.freebsd.org/changeset/base/308571 Log: MFC r308437 and r308461: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. Allow higher sample rates to have more jitter than lower ones. PR: 208791 Changes: _U stable/11/ stable/11/sys/dev/sound/usb/uaudio.c
A commit references this bug: Author: hselasky Date: Sat Nov 12 17:30:55 UTC 2016 New revision: 308572 URL: https://svnweb.freebsd.org/changeset/base/308572 Log: MFC r308437 and r308461: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. Allow higher sample rates to have more jitter than lower ones. PR: 208791 Changes: _U stable/10/ stable/10/sys/dev/sound/usb/uaudio.c
A commit references this bug: Author: hselasky Date: Sat Nov 12 17:32:23 UTC 2016 New revision: 308573 URL: https://svnweb.freebsd.org/changeset/base/308573 Log: MFC r308437 and r308461: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. Allow higher sample rates to have more jitter than lower ones. PR: 208791 Changes: _U stable/9/sys/ stable/9/sys/dev/sound/usb/uaudio.c
A commit references this bug: Author: hselasky Date: Sat Nov 12 17:36:28 UTC 2016 New revision: 308574 URL: https://svnweb.freebsd.org/changeset/base/308574 Log: MFC r308437 and r308461: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. Allow higher sample rates to have more jitter than lower ones. PR: 208791 Changes: _U stable/8/sys/ _U stable/8/sys/dev/ _U stable/8/sys/dev/sound/ _U stable/8/sys/dev/sound/usb/ stable/8/sys/dev/sound/usb/uaudio.c
Looks good.
You means sounds good ;-) Thank you for testing!