From owner-freebsd-usb@freebsd.org Sun Oct 8 21:09:03 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 B913AE40190 for ; Sun, 8 Oct 2017 21:09:03 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44BE86BF24 for ; Sun, 8 Oct 2017 21:09:02 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Sun, 08 Oct 2017 23:08:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1507496939; bh=C/ljGVu4VM/0u2owzcYpi0Kr6QxFbn0bEXIGWHz+nS4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=QPqMVbvQYhvx45i+lRwTNWMNuDLeipAaOwzsqzu/9kJCRbJkqbPzvfvNlniNxwSzo 4ms3OyMHpZdTAMsVP1t02aaiTKbBj/07T2o+1yUcUMRxbJM+v41HCCI3abib9QdcNQ oGAJeuDAMVnv+Eg6n1i8so5j/B7vhyg8BWYGjUO6teDGfCkwsmKV3vaRMU4YsXVpwv qT3hPaG7fK9kd1MqaP/CFYlMViclIb0E+PCLTHxGXQMVfT6Je1M1pvP4Ch5YVFpDTl gLqLrLuo0oxGQS1/wboj9a1SPN0/gIGbF0kPsXg646czrGcOdvDWSHCnOYjsUJ5g9S 9BpoUcsBCOZVg== Message-ID: <20171008230836.Horde.gG7VyE_62V3bMJX_VtbUrAP@webmail.leidinger.net> From: Alexander Leidinger To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org Subject: Re: uaudio - distorted output References: <20171008125631.Horde.ZsqSFDr1-uiT1YrkgH5i0tF@webmail.leidinger.net> <633f23dd-3b61-fe17-b894-6b1221a5dfd4@selasky.org> <20171008142514.Horde.hRkzth4Ur4wvjgUIlWuc70c@webmail.leidinger.net> <21e04dc4-045d-fb30-337a-7f7bd4fe8b50@selasky.org> In-Reply-To: <21e04dc4-045d-fb30-337a-7f7bd4fe8b50@selasky.org> User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_-QOYzJ_xjGbLZJQ913VU0GK"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 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 21:09:03 -0000 This message is in MIME format and has been PGP signed. --=_-QOYzJ_xjGbLZJQ913VU0GK Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Hans Petter Selasky (from Sun, 8 Oct 2017=20=20 17:28:25=20+0200): > On 10/08/17 14:25, Alexander Leidinger wrote: >> >> Quoting Hans Petter Selasky (from Sun, 8 Oct 2017=20= =20 >>=2013:19:19 +0200): >> >>> On 10/08/17 12:56, Alexander Leidinger wrote: >>>> >>>> Hi, >>>> >>>> attached are the config descriptors and the device dump of two=20=20 >>>>=20uaudio devices. Both exhibit distorted audio output. It sounds a=20= =20 >>>>=20little bit like clipping / not feeding enough samples fast=20=20 >>>>=20enough... >>>> >>>> I played around with dev.pcm.2.bitperfect=3D1,=20=20 >>>>=20dev.pcm.2.play.vchans=3D0, dev.pcm.2.play.vchanrate and=20=20 >>>>=20hw.snd.latency=3D1...10. >>>> >>>> At some point vchanrate doesn't work anymore, it always stays at=20=20 >>>>=204.0 audio, even when trying to go back to 2.0. I have to=20=20 >>>>=20usbconfig reset the device. >>>> >>>> Sometimes (rarely) when playing around I get clear audio output,=20=20 >>>>=20but when I try to reproduce it (going back to default value for=20= =20 >>>>=20the last sysctl setting and then going back again to the same=20=20 >>>>=20setting again), the audio is distorted again. >>>> >>>> To me it sounds like some kind of buffer is not big enough or the=20= =20 >>>>=20data is not delivered fast enough to the uaudio device. But this=20= =20 >>>>=20is a dual-socket system with: >>>> =C2=A0=C2=A0=C2=A0 CPU: Intel(R) Xeon(R) CPU=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 E5620=C2=A0 @ 2.40GHz=20=20 >>>>=20(2133.36-MHz K8-class CPU) >>>> =C2=A0=C2=A0=C2=A0 FreeBSD/SMP: Multiprocessor System Detected: 16 CPU= s >>>> =C2=A0=C2=A0=C2=A0 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=20=20 >>>>=20around 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=3D16 during playback. >> >> No such sysctl, only hw.usb.debug.... >> I did the hw.usb.debug=3D16, but no output in dmesg nor=20=20 >>=20/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=20=20 >=20DEBUG_FLAGS=3D"-DUSB_DEBUG" and KMODDIR=3D/boot/kernel ? Occasionally I get this while playing: ---snip--- uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: short transfer, 3680 of 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: short transfer, 3360 of 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: short transfer, 4224 of 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: short transfer, 4096 of 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes uaudio_chan_play_callback: transferring 4608 bytes ---snip--- The first number on the short transfer varies: ---snip--- # dmesg |grep "transferring 4608 bytes" | wc -l 2738 # dmesg |grep "short transfer" | wc -l 124 # dmesg |grep "short transfer" | sort | uniq -c 1 uaudio_chan_play_callback: short transfer, 2176 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 2528 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 2624 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 2848 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 2976 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3008 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3040 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3104 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3136 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3168 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3264 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3296 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3328 of 4608 bytes 4 uaudio_chan_play_callback: short transfer, 3360 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3424 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3456 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3520 of 4608 bytes 4 uaudio_chan_play_callback: short transfer, 3552 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3584 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3616 of 4608 bytes 4 uaudio_chan_play_callback: short transfer, 3648 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3680 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3712 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3744 of 4608 bytes 4 uaudio_chan_play_callback: short transfer, 3776 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3808 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 3872 of 4608 bytes 3 uaudio_chan_play_callback: short transfer, 3904 of 4608 bytes 3 uaudio_chan_play_callback: short transfer, 3936 of 4608 bytes 1 uaudio_chan_play_callback: short transfer, 3968 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4032 of 4608 bytes 28 uaudio_chan_play_callback: short transfer, 4096 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4128 of 4608 bytes 5 uaudio_chan_play_callback: short transfer, 4160 of 4608 bytes 8 uaudio_chan_play_callback: short transfer, 4192 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4224 of 4608 bytes 3 uaudio_chan_play_callback: short transfer, 4256 of 4608 bytes 5 uaudio_chan_play_callback: short transfer, 4288 of 4608 bytes 3 uaudio_chan_play_callback: short transfer, 4320 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4352 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4416 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4448 of 4608 bytes 3 uaudio_chan_play_callback: short transfer, 4480 of 4608 bytes 2 uaudio_chan_play_callback: short transfer, 4544 of 4608 bytes ---snip--- Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_-QOYzJ_xjGbLZJQ913VU0GK Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJZ2pPUAAoJEKrxQhqFIICEUbIQAIllIiyzhr1yo4yEnYTr0GxH qRajvDzHu8WzM1OuNyluo4lFtoGvXcBKa5qqpzkTX46QJ1WTNqdc092Wlfjze2iO vA7v5T1Re52G3sejP+Jz7R7E9kfqdP34iDrNUu1t84TBBh5nxWdAFZXWYqzOh/CP 2CbcOuCkCnHlaF6L7olhWZVGwN8E4CBI8wuFmA3COhfcEtOVklMG2H4uGqtZsH8m Ba2++TeBqgmepT28cbIGZmEA4exkZUdXFfYSL/bnOJvzjC+5i2s7jwgJ+jZ6IiC/ dsOm9zNZuzDIpu/F5pNDE2hmedGupuw93SWjqpPFj5p5tce+BVqEKCKS0mFIw9z1 m/Hxfg+hYf+dXHIiVUCPZhA7zAqjyrwgFPcxSEK4t73InEjJA6RnuJCen5y1xmiR 4CeX2jCk5t3JHlUHU44Z/PB+tbfWRcAKkRbMldeFeMqUXU2GJqok/KLAWESFblZl 86PlH1PwglIpvgEOywWlTCvaPdlo2IQDioqK/d4y2k4lGxizRyFtHTfdhGoL+yvH MMbvy+Sp6vDVyAidsjjH+Aif80wHEB9Y+PWKp/oxCnzXtUiPlSd5Dxk4DSGLvIaU jot78U6pmMdL7lxFuw/WIyW3mTXM6vMfrgKeWUca6zzTriJaY2teUw8hpYPrigxY GIVB+aUBSosqGXQf8kQa =uoNE -----END PGP SIGNATURE----- --=_-QOYzJ_xjGbLZJQ913VU0GK--