Date: Wed, 28 Nov 2018 21:13:15 +1100 From: Brian Scott <bscott@bunyatech.com.au> To: Hans Petter Selasky <hps@selasky.org>, freebsd-arm@freebsd.org Subject: Re: Raspberry PI 2B/3 and USB audio Message-ID: <eeca436f-a5b3-2017-9a8d-41c8365dd46b@bunyatech.com.au> In-Reply-To: <b5d07fe0-8b1a-9b59-3241-1bfe7f72b096@selasky.org> References: <87ftw96uq0.wl-herbert@gojira.at> <6beca923-ba25-3814-6bb2-f4cc2d7360d3@selasky.org> <875zx2hyey.wl-herbert@gojira.at> <87lg5fhcgz.wl-herbert@gojira.at> <87k1kzhb8j.wl-herbert@gojira.at> <9dda25f1-9b52-2a50-1b55-00cccee8ee98@selasky.org> <856136a7-c58f-dda0-d50c-f9da55e5eb88@bunyatech.com.au> <b5d07fe0-8b1a-9b59-3241-1bfe7f72b096@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 28/11/18 7:45 pm, Hans Petter Selasky wrote: > On 11/28/18 1:46 AM, Brian Scott wrote: >> On 27/11/18 6:38 pm, Hans Petter Selasky wrote: >>> On 11/26/18 8:47 PM, Herbert J. Skuhra wrote: >>>> Well, this USB sound card works perfectly fine on my desktop PC >>>> running FreeBSD (amd64). >>> >>> Hi, >>> >>> There is a problem in the DWC OTG USB controller driver that it cannot >>> handle the big data payload 24-bit 48KHz sampling requires. >>> Unfortunately your device has only one sample size selection. >>> >>> If you buy a USB sound device marked as "HIGH SPEED USB" it should >>> work. Yours is "spd=FULL". >>> >>> --HPS >> Just an additional data point, >> >> This one also sounds like junk but is high speed: >> >> ugen0.6: <Generic USB Audio> at usbus0, cfg=0 md=HOST spd=HIGH >> (480Mbps) pwr=ON (100mA) >> >> bLength = 0x0012 >> bDescriptorType = 0x0001 >> bcdUSB = 0x0200 >> bDeviceClass = 0x0000 <Probed by interface class> >> bDeviceSubClass = 0x0000 >> bDeviceProtocol = 0x0000 >> bMaxPacketSize0 = 0x0040 >> idVendor = 0x0bda >> idProduct = 0x4040 >> bcdDevice = 0x0000 >> iManufacturer = 0x0003 <Generic> >> iProduct = 0x0001 <USB Audio> >> iSerialNumber = 0x0002 <201405280001> >> bNumConfigurations = 0x0001 >> >> But I notice that it handles both 48000 and 8000 according to the sound >> driver. >> >> cat /dev/sndstat >> FreeBSD Audio Driver (64bit 2009061500/aarch64) >> Installed devices: >> pcm0: <USB audio> at ? kld snd_uaudio (1p:1v/1r:1v) default >> snddev flags=0x2e2<AUTOVCHAN,BUSY,MPSAFE,REGISTERED,VPC> >> [pcm0:play:dsp0.p0]: spd 48000, fmt 0x00200010, flags >> 0x00002100, 0x00000004 >> interrupts 0, underruns 0, feed 0, ready 0 >> [b:3072/1536/2|bs:4096/2048/2] >> channel flags=0x2100<BUSY,HAS_VCHAN> >> {userland} -> feeder_mixer(0x00200010) -> {hardware} >> pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp0]: spd 8000, fmt >> 0x00100008, flags 0x10000000, 0x00000000 >> interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0] >> channel flags=0x10000000<VIRTUAL> >> {userland} -> feeder_root(0x00000000) -> {hardware} >> [pcm0:record:dsp0.r0]: spd 48000,fmt 0x00200010/0x00210000, >> flags 0x00002100, 0x00000007 >> interrupts 0, overruns 0, feed 0, hfree 4608, sfree 4096 >> [b:4608/2304/2|bs:4096/2048/2] >> channel flags=0x2100<BUSY,HAS_VCHAN> >> {hardware} -> feeder_root(0x00210000) -> >> feeder_format(0x00210000 -> 0x00200010) -> feeder_mixer(0x00200010) >> -> {userland} >> pcm0:record:dsp0.r0[pcm0:virtual:dsp0.vr0]: spd 8000, fmt >> 0x00100008, flags 0x10000000, 0x00000000 >> interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 >> [b:0/0/0|bs:0/0/0] >> channel flags=0x10000000<VIRTUAL> >> {hardware} -> feeder_root(0x00000000) -> {userland} >> No devices installed from userspace. >> >> Output sounds like rubbish with both 8000 speed stuff sent directly to >> /dev/dsp using cat and higher quality stuff sent via sox play. >> >> It could also just be a junk piece of hardware from my local electronics >> shop. > > Which version of FreeBSD is this? > > Can you show dmesg? > > --HPS > 12.0 RC2 with /boot and /boot/msdos on sdcard and everything else on USB connected hard drive (causing interference with the bus?). Otherwise everything directly off the RC2 image + packages and a bit of configuration. On repeating my tests (probably last done a few months ago with the current snapshot) the sound was much better than I remember (almost recognisable!). Maybe having the non-debug kernel is helping. Hope this isn't a red herring. ---<<BOOT>>--- Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-RC2 r340839 GENERIC arm64 FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) VT(efifb): resolution 1280x1024 KLD file umodem.ko is missing dependencies Starting CPU 1 (1) Starting CPU 2 (2) Starting CPU 3 (3) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs arc4random: no preloaded entropy cache random: entropy device external interface MAP 7ffe000 mode 2 pages 2 MAP 8007000 mode 2 pages 2 MAP 39f35000 mode 2 pages 1 MAP 39f3a000 mode 2 pages 1 MAP 3b347000 mode 2 pages 1 MAP 3f100000 mode 1 pages 1 kbd0 at kbdmux0 ofwbus0: <Open Firmware Device Tree> simplebus0: <Flattened device tree simple bus> on ofwbus0 ofw_clkbus0: <OFW clocks bus> on ofwbus0 clk_fixed0: <Fixed clock> on ofw_clkbus0 clk_fixed1: <Fixed clock> on ofw_clkbus0 regfix0: <Fixed Regulator> on ofwbus0 regfix1: <Fixed Regulator> on ofwbus0 psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0 local_intc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff on simplebus0 intc0: <BCM2835 Interrupt Controller> mem 0x7e00b200-0x7e00b3ff irq 20 on simplebus0 gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 22,23 on simplebus0 gpiobus0: <OFW GPIO bus> on gpio0 generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0 Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000 Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000 gpiopps0: <GPIO PPS> on ofwbus0 gpiopps0: PPS input on gpio0 pin 18 bcm_dma0: <BCM2835 DMA Controller> mem 0x7e007000-0x7e007eff irq 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 on simplebus0 bcmwd0: <BCM2708/2835 Watchdog> mem 0x7e100000-0x7e100027 on simplebus0 bcmrng0: <Broadcom BCM2835 RNG> mem 0x7e104000-0x7e10400f on simplebus0 mbox0: <BCM2835 VideoCore Mailbox> mem 0x7e00b880-0x7e00b8bf irq 21 on simplebus0 gpioc0: <GPIO controller> on gpio0 uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e201fff irq 24 on simplebus0 spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e204fff irq 26 on simplebus0 spibus0: <OFW SPI bus> on spi0 spibus0: <unknown card> at cs 0 mode 0 spibus0: <unknown card> at cs 1 mode 0 iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 37 on simplebus0 bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x7e980000-0x7e98ffff,0x7e006000-0x7e006fff irq 43,44 on simplebus0 usbus0 on bcm283x_dwcotg0 sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x7e300000-0x7e3000ff irq 46 on simplebus0 mmc0: <MMC/SD bus> on sdhci_bcm0 fb0: <BCM2835 VT framebuffer driver> on simplebus0 fbd0 on fb0 VT: Replacing driver "efifb" with new "fb". fb0: 1280x1024(1280x1024@0,0) 24bpp fb0: fbswap: 1, pitch 3840, base 0x3e83a000, screen_size 3932160 pmu0: <Performance Monitoring Unit> irq 50 on simplebus0 cpulist0: <Open Firmware CPU Group> on ofwbus0 cpu0: <Open Firmware CPU> on cpulist0 bcm2835_cpufreq0: <CPU Frequency Control> on cpu0 cpu1: <Open Firmware CPU> on cpulist0 cpu2: <Open Firmware CPU> on cpulist0 cpu3: <Open Firmware CPU> on cpulist0 gpioled0: <GPIO LEDs> on ofwbus0 gpioled0: <led0> failed to map pin gpioled0: <led1> failed to map pin cryptosoft0: <software crypto> Timecounters tick every 1.000 msec iicbus0: <OFW I2C bus> on iichb0 iic0: <I2C generic I/O> on iicbus0 ds32310: <Maxim DS3231 RTC> at addr 0xd0 on iicbus0 usbus0: 480Mbps High Speed USB v2.0 ugen0.1: <DWCOTG OTG Root HUB> at usbus0 uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0 mmcsd0: 2GB <SD SU02G 8.0 SN 0AE1BA9D MFG 10/2010 by 3 SD> at mmc0 25.0MHz/4bit/65535-block bcm2835_cpufreq0: ARM 600MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF ds32310: registered as a time-of-day clock, resolution 1.000000s uhub0: 1 port with 1 removable, self powered ugen0.2: <vendor 0x0424 product 0x9514> at usbus0 uhub1 on uhub0 uhub1: <vendor 0x0424 product 0x9514, class 9/0, rev 2.00/2.00, addr 2> on usbus0 uhub1: MTT enabled uhub1: 5 ports with 4 removable, self powered ugen0.3: <vendor 0x0424 product 0xec00> at usbus0 smsc0 on uhub1 smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0 smsc0: chip 0xec00, rev. 0002 miibus0: <MII bus> on smsc0 smscphy0: <SMC LAN8700 10/100 interface> PHY 1 on miibus0 smscphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto ue0: <USB Ethernet> on smsc0 ue0: Ethernet address: b8:27:eb:4b:18:8c ugen0.4: <Seagate Expansion> at usbus0 umass0 on uhub1 umass0: <Seagate Expansion, class 0/0, rev 2.10/1.00, addr 4> on usbus0 Release APs...random: unblocking device. arc4random: no preloaded entropy cache done CPU 0: ARM Cortex-A53 r0p4 affinity: 0 Instruction Set Attributes 0 = <CRC32> da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: <Seagate Expansion 9300> Fixed Direct Access SPC-4 SCSI device da0: Serial Number NA88TLH2 da0: 40.000MB/s transfers da0: 953869MB (1953525167 512 byte sectors) da0: quirks=0x2<NO_6_BYTE> Instruction Set Attributes 1 = <> Processor Features 0 = <AdvSIMD,Float,EL3 32,EL2 32,EL1 32,EL0 32> Processor Features 1 = <0> Memory Model Features 0 = <4k Granule,64k Granule,MixedEndian,S/NS Mem,16bit ASID,1TB PA> Memory Model Features 1 = <> Trying to mount root from ufs:/dev/ufs/pi3_hdd []... Memory Model Features 2 = <32b CCIDX,48b VA> Debug Features 0 = <2 CTX Breakpoints,4 Watchpoints,6 Breakpoints,PMUv3,Debug v8> Debug Features 1 = <0> Auxiliary Features 0 = <0> Auxiliary Features 1 = <0> CPU 1: ARM Cortex-A53 r0p4 affinity: 1 CPU 2: ARM Cortex-A53 r0p4 affinity: 2 CPU 3: ARM Cortex-A53 r0p4 affinity: 3 arc4random: no preloaded entropy cache arc4random: no preloaded entropy cache ugen0.5: <Logitech USB Receiver> at usbus0 ukbd0 on uhub1 ukbd0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 5> on usbus0 kbd1 at ukbd0 (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 53 b9 68 00 00 08 00 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command, 3 more tries remain ugen0.6: <Generic USB Audio> at usbus0 lo0: link state changed to UP smsc0: chip 0xec00, rev. 0002 ue0: link state changed to DOWN ue0: link state changed to UP ums0 on uhub1 ums0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 5> on usbus0 ums0: 16 buttons and [XYZT] coordinates ID=2 uhid0 on uhub1 uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 5> on usbus0 uhid1 on uhub1 uhid1: <Generic USB Audio, class 0/0, rev 2.00/0.00, addr 6> on usbus0 uaudio0 on uhub1 uaudio0: <Realtek USB2.0 Audio> on usbus0 uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record: 96000 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: <USB audio> on uaudio0 uaudio0: No HID volume keys found.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?eeca436f-a5b3-2017-9a8d-41c8365dd46b>