From owner-freebsd-usb@freebsd.org Sun Oct 8 10:57:48 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 1976CE3129D for ; Sun, 8 Oct 2017 10:57:48 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id C400367048 for ; Sun, 8 Oct 2017 10:57:47 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: by mailman.ysv.freebsd.org (Postfix) id A1F34E3129A; Sun, 8 Oct 2017 10:57:47 +0000 (UTC) Delivered-To: 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 890DEE31299 for ; Sun, 8 Oct 2017 10:57:47 +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 BA0A967031 for ; Sun, 8 Oct 2017 10:57:42 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Sun, 08 Oct 2017 12:56:31 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1507460253; bh=IdDHBS+XLrxVbJi/YonU3kWrjzBHJe25byfhdkM4qfY=; h=Date:From:To:Subject; b=vcmn8XePwB8+rcVIRWEvKD+Fr00ZjKCB34jnD4sTpXGQkwZUhRFACum6/BEHlrlAy bocZRN6sD2HLL9uBLAZRgvq4Xu8I/RKY+DMz7KRRug7PXSO/J4kAUgBArHzsQC3UT3 m+xJfkJ4IXwy5ksznTUabT9pOU143u5elUw0sEK3pHRIZo5j1wSrtH8f8cEXs4xt+/ faoEuqXuEhoVJ9sh3ZaapgFJeOImyhvnygsjLxP6WXciE+wzf9d1Fqx8ia1csfk33f tKjKppeH2jXd3bY0hrn84BZpIKCww12kYwbvIWFk6eEYQ2yQVYtnf2laWmsLgrp0Ex ntLotdBXRS04Q== Message-ID: <20171008125631.Horde.ZsqSFDr1-uiT1YrkgH5i0tF@webmail.leidinger.net> From: Alexander Leidinger To: usb@freebsd.org Subject: uaudio - distorted output User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_wMM-XnvVq_nTvngve_WwSVR"; 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 10:57:48 -0000 This message is in MIME format and has been PGP signed. --=_wMM-XnvVq_nTvngve_WwSVR Content-Type: multipart/mixed; boundary="=_OjinU4UEX82wq3jBj6JHXKI" This message is in MIME format. --=_OjinU4UEX82wq3jBj6JHXKI Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, attached are the config descriptors and the device dump of two uaudio=20=20 devices.=20Both exhibit distorted audio output. It sounds a little bit=20= =20 like=20clipping / not feeding enough samples fast enough... I played around with dev.pcm.2.bitperfect=3D1, dev.pcm.2.play.vchans=3D0,= =20=20 dev.pcm.2.play.vchanrate=20and hw.snd.latency=3D1...10. At some point vchanrate doesn't work anymore, it always stays at 4.0=20=20 audio,=20even when trying to go back to 2.0. I have to usbconfig reset=20= =20 the=20device. Sometimes (rarely) when playing around I get clear audio output, but=20=20 when=20I try to reproduce it (going back to default value for the last=20= =20 sysctl=20setting and then going back again to the same setting again),=20= =20 the=20audio is distorted again. To me it sounds like some kind of buffer is not big enough or the data=20= =20 is=20not delivered fast enough to the uaudio device. But this is a=20=20 dual-socket=20system with: CPU: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz (2133.36-MHz=20= =20 K8-class=20CPU) 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=20=20 1,=20so I would expect CPU/RAM is not an issue here. I would expect that just attaching an uaudio device like those and=20=20 using=20madplay/mpg123 would just work (not looking at digital output=20=20 and=205.1/7.1 output for video, just the basics like stereo output of=20=20 MP3).=20So either I do something fundamentally wrong and would need a=20=20 hint=20with the cluebat, or I would need some description how to debug=20= =20 this=20further from the USB side... Bye, Alexander. --=20 http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_OjinU4UEX82wq3jBj6JHXKI Content-Type: text/plain; name=uaudio_old_device_desc.txt Content-Disposition: attachment; size=566; filename=uaudio_old_device_desc.txt Content-Transfer-Encoding: quoted-printable ugen5.2: at usbus5, cfg=3D0 m= d=3DHOST spd=3DFULL (12Mbps) pwr=3DON (308mA) bLength =3D 0x0012=20 =20 bDescriptorType =3D 0x0001=20 =20 bcdUSB =3D 0x0110=20 =20 bDeviceClass =3D 0x0000 bDeviceSubClass =3D 0x0000=20 =20 bDeviceProtocol =3D 0x0000=20 =20 bMaxPacketSize0 =3D 0x0008=20 =20 idVendor =3D 0x041e=20 =20 idProduct =3D 0x3040=20 =20 bcdDevice =3D 0x0100=20 =20 iManufacturer =3D 0x0001 iProduct =3D 0x0002 iSerialNumber =3D 0x0000 bNumConfigurations =3D 0x0001=20 --=_OjinU4UEX82wq3jBj6JHXKI Content-Type: text/plain; name=uaudio_old_all_config.txt Content-Disposition: attachment; size=28705; filename=uaudio_old_all_config.txt Content-Transfer-Encoding: quoted-printable ugen5.2: at usbus5, cfg=3D0 m= d=3DHOST spd=3DFULL (12Mbps) pwr=3DON (308mA) Configuration index 0 bLength =3D 0x0009=20 =20 bDescriptorType =3D 0x0002=20 =20 wTotalLength =3D 0x03d3=20 =20 bNumInterfaces =3D 0x0003=20 =20 bConfigurationValue =3D 0x0001=20 =20 iConfiguration =3D 0x0000 bmAttributes =3D 0x0080=20 =20 bMaxPower =3D 0x009a=20 =20 Interface 0 bLength =3D 0x0009=20 =20 bDescriptorType =3D 0x0004=20 =20 bInterfaceNumber =3D 0x0000=20 =20 bAlternateSetting =3D 0x0000=20 =20 bNumEndpoints =3D 0x0001=20 =20 bInterfaceClass =3D 0x0001