From owner-freebsd-arm@freebsd.org Mon Nov 26 19:21:06 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F9D11419FC for ; Mon, 26 Nov 2018 19:21:06 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:191:217b::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 086EC84C52 for ; Mon, 26 Nov 2018 19:21:04 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Mon, 26 Nov 2018 20:21:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1543260062; bh=vP0KMe0rcjcS0g++oEX1DW0nyBd9DpKRMniYlGcplSM=; h=Date:Message-ID:From:To:Subject:MIME-Version:Content-Type:from:to: subject:date:content-type:mime-version:message-id; b=TkxMBJSQcuwsmkM7goOoTT31/eGrSqtTDAOoosjS1EStyG1lMwJOBX++qc6lSMmzF evXRkLxRQ/uV2zO1bg5NwCA/unYLXPG9agmjDYviWQJfTlYsZ2yozYo2F6wmIboeBw DXDUZwHpZ+jCOaYgA74P+28m2Zrvkc+gk+zX3ICBr1cX1728Z0OupesThtQkYlIChI CsY9FxmVB5XTPydTFjOctzlYEOgp/8DQD6SteYep9MBlVVzV9CyNoQTwDcxN7cnRP5 WONuZ952KxQU3I6nDxDETrl257x+Pqje3NCz5thJtVa3fQRvqqiwMC+mq8EPGWIh63 OT1431gbQ+LWQ== Message-ID: <87lg5fhcgz.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: freebsd-arm@freebsd.org Subject: Re: Raspberry PI 2B/3 and USB audio In-Reply-To: <875zx2hyey.wl-herbert@gojira.at> References: <87ftw96uq0.wl-herbert@gojira.at> <6beca923-ba25-3814-6bb2-f4cc2d7360d3@selasky.org> <875zx2hyey.wl-herbert@gojira.at> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/27.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 086EC84C52 X-Spamd-Result: default: False [-3.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gojira.at]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:191:217b::25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[gojira.at]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MX_GOOD(-0.01)[cached: mail.bsd4all.net]; DKIM_TRACE(0.00)[gojira.at:+]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-1.27)[ipnet: 2a01:4f8::/29(-3.53), asn: 24940(-2.81), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:21:06 -0000 On Mon, 12 Nov 2018 20:46:13 +0100, "Herbert J. Skuhra" wrote: > > On Sun, 11 Nov 2018 13:52:14 +0100, Hans Petter Selasky wrote: > > > > On 11/10/18 12:24 PM, Herbert J. Skuhra wrote: > > > Hi, > > > > > > if you use an USB sound card on your Raspberry PI 2B/3, can you please > > > answer the following questions: > > > > > > - which USB sound card? > > > - do you have bad audio on current or stable/12 after r339388? > > > > > > My "Creative Technology Ltd Sound Blaster Play 2" device sounds very > > > bad. Meanwhile more changes were commited but they don't fix audio > > > completly. > > > > > > > Hi, > > > > Some background: > > > > The USB controller in Raspberry PI is running HIGH-speed USB. Many USB > > audio device are FULL-speed USB. In order for a FULL-speed USB device > > to work in a HIGH-speed USB environment all data transfers need to go > > through a so-called transaction translator. This transaction > > translator operate on chunks of data, 171 bytes maximum. That means if > > a USB audio stream generates 1000 packets per second, then suddenly a > > bunch of smaller packets will be needed. This puts some stress on the > > DWC OTG driver and there might be some room for improvement in this > > area too, but the basic sympthom is that the DWC OTG driver in FreeBSD > > is not always able to keep up with the timing required for these > > so-called split transactions. One idea is to move all DWC OTG IRQ > > handling away from CPU-0. I'm not sure if cpuset supports this yet on > > armv7 // arm64. Might have to be done in the driver. > > > > Further some audio device use non-adaptive clocks, which means the > > recording channel must be active along with the playback channel else > > jitter will occur. > > > > The recommendation for RPI is a HIGH-speed USB audio device (should be > > clearly marked in the specification). Using a HIGH-speed USB audio > > device will reduce the number of interrupts significantly. > > Well, the sound card worked perfectly fine so far... both on FreeBSD > and Arch Linux ARM... no luck with NetBSD. Never mind! I am obviously > the only user affected by this "fix" (r339388). Unfortunally I've purchased another full-speed usb audio device: uaudio0 on uhub1 uaudio0: on usbus0 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: Record: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer. uaudio0: No MIDI sequencer. pcm0: on uaudio0 uaudio0: HID volume keys found. While it works fine under Linux (pulse), MacOS and Windows, it produces only bad noise under FreeBSD (Raspberry PI3B)! :-( How can I get it working? Can anyone recommend an USB audio device for FreeBSD? Should DACs from Pro-Ject work? Thanks. -- Herbert