From owner-freebsd-usb@freebsd.org Sun Oct 8 15:31:07 2017 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B44E38751 for ; Sun, 8 Oct 2017 15:31:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C78252D1E for ; Sun, 8 Oct 2017 15:31:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B1BF7260494; Sun, 8 Oct 2017 17:31:02 +0200 (CEST) Subject: Re: uaudio - distorted output To: Alexander Leidinger Cc: freebsd-usb@freebsd.org References: <20171008125631.Horde.ZsqSFDr1-uiT1YrkgH5i0tF@webmail.leidinger.net> <633f23dd-3b61-fe17-b894-6b1221a5dfd4@selasky.org> <20171008142514.Horde.hRkzth4Ur4wvjgUIlWuc70c@webmail.leidinger.net> From: Hans Petter Selasky Message-ID: <21e04dc4-045d-fb30-337a-7f7bd4fe8b50@selasky.org> Date: Sun, 8 Oct 2017 17:28:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171008142514.Horde.hRkzth4Ur4wvjgUIlWuc70c@webmail.leidinger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 15:31:07 -0000 On 10/08/17 14:25, Alexander Leidinger wrote: > > Quoting Hans Petter Selasky (from Sun, 8 Oct 2017 > 13:19:19 +0200): > >> On 10/08/17 12:56, Alexander Leidinger wrote: >>> >>> Hi, >>> >>> attached are the config descriptors and the device dump of two uaudio >>> devices. Both exhibit distorted audio output. It sounds a little bit >>> like clipping / not feeding enough samples fast enough... >>> >>> I played around with dev.pcm.2.bitperfect=1, dev.pcm.2.play.vchans=0, >>> dev.pcm.2.play.vchanrate and hw.snd.latency=1...10. >>> >>> At some point vchanrate doesn't work anymore, it always stays at 4.0 >>> audio, even when trying to go back to 2.0. I have to usbconfig reset >>> the device. >>> >>> Sometimes (rarely) when playing around I get clear audio output, but >>> when I try to reproduce it (going back to default value for the last >>> sysctl setting and then going back again to the same setting again), >>> the audio is distorted again. >>> >>> To me it sounds like some kind of buffer is not big enough or the >>> data is not delivered fast enough to the uaudio device. But this is a >>> dual-socket system with: >>>     CPU: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz (2133.36-MHz >>> K8-class CPU) >>>     FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs >>>     FreeBSD/SMP: 2 package(s) x 4 core(s) x 2 hardware threads >>> And while playing around with uaudio the system has a load of around >>> 1, so I would expect CPU/RAM is not an issue here. >> >> Hi, >> >> What version of FreeBSD is this? > > current as of r323636 > >> Try to enable hw.usb.uaudio.debug=16 during playback. > > No such sysctl, only hw.usb.debug.... > I did the hw.usb.debug=16, but no output in dmesg nor > /var/log/console.log nor /var/log/messages, where do I need to look? > > Bye, > Alexander. > Can you compile and install snd_uaudio module with DEBUG_FLAGS="-DUSB_DEBUG" and KMODDIR=/boot/kernel ? --HPS