NetBSD Problem Report #54474

From nick@tk1.localdomain  Sat Aug 17 07:44:55 2019
Return-Path: <nick@tk1.localdomain>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4E7227A17A
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Aug 2019 07:44:55 +0000 (UTC)
Message-Id: <20190817065046.3C45B474B11@tk1.localdomain>
Date: Sat, 17 Aug 2019 07:50:46 +0100 (BST)
From: nick@tk1.localdomain
Reply-To: nick@tk1.localdomain
To: gnats-bugs@NetBSD.org
Subject: Jetson TK1 audio playback has clicks since isaki-audio2 merge
X-Send-Pr-Version: 3.95

>Number:         54474
>Category:       kern
>Synopsis:       Jetson TK1 audio playback has clicks since isaki-audio2 merge
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    isaki
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 17 07:45:00 +0000 2019
>Closed-Date:    Wed Apr 29 02:04:31 +0000 2020
>Last-Modified:  Wed Apr 29 02:04:31 +0000 2020
>Originator:     Nick Hudson
>Release:        NetBSD 9.0_BETA
>Organization:
	Attic Inc
>Environment:
System: NetBSD tk1 9.0_BETA NetBSD 9.0_BETA (GENERIC) #0: Mon Aug 12 17:33:25 UTC 2019 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:


commit 3a128bb083b62b3e425313e562957d2e29ee9608
Author: isaki <isaki@NetBSD.org>
Date:   Wed May 8 13:47:33 2019 +0000

    Merge isaki-audio2 branch.

    Welcome to 8.99.39.

armv7# audiocfg test 0
[  53.4834681] audio_track_setinfo_check failed: slinear_le 16bit 14ch 44100Hz
0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI, 12 playback channels
  testing channel 0... done
  testing channel 1... done
  testing channel 2... done
  testing channel 3... done
  testing channel 4... done
  testing channel 5... done
  testing channel 6... done
  testing channel 7... done
  testing channel 8... done
  testing channel 9... done
  testing channel 10... done
  testing channel 11... done



[   1.0000000] NetBSD/evbarm (fdt) booting ...
[   1.0000000] [ Kernel symbol table missing! ]
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[   1.0000000]     2018, 2019 The NetBSD Foundation, Inc.  All rights reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights reserved.

[   1.0000000] NetBSD 9.99.2 (GENERIC) #23: Wed Aug 14 11:20:54 BST 2019
[   1.0000000]  nick@zoom:/home/nick/netbsd/binary/obj.evbearmv7hf-el/sys/arch/evbarm/compile/GENERIC
[   1.0000000] total memory = 2047 MB
[   1.0000000] avail memory = 2015 MB
[   1.0000000] armfdt0 (root)
[   1.0000000] simplebus0 at armfdt0: NVIDIA Tegra124 Jetson TK1
[   1.0000000] simplebus1 at simplebus0
[   1.0000000] simplebus2 at simplebus0
[   1.0000000] cpus0 at simplebus0
[   1.0000000] simplebus3 at simplebus0
[   1.0000000] cpu0 at cpus0: Cortex-A15 r3p3 (Cortex V7A core)
[   1.0000000] cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
[   1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[   1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[   1.0000000] cpu0: 2048KB/64B 16-way write-through L2 PIPT Unified cache
[   1.0000000] vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
[   1.0000000] tegra124cpu0 at cpu0: DVFS
[   1.0000000] cpu1 at cpus0
[   1.0000000] cpu2 at cpus0
[   1.0000000] cpu3 at cpus0
[   1.0000000] tegralic0 at simplebus0: LIC
[   1.0000000] gic0 at simplebus0: GIC
[   1.0000000] armgic0 at gic0: Generic Interrupt Controller, 192 sources (183 valid)
[   1.0000000] armgic0: 32 Priorities, 160 SPIs, 7 PPIs, 16 SGIs
[   1.0000000] fclock0 at simplebus2: 32768 Hz fixed clock (clock@0)
[   1.0000000] gtmr0 at simplebus0: Generic Timer
[   1.0000000] gtmr0: interrupting on GIC irq 27
[   1.0000000] armgtmr0 at gtmr0: ARM Generic Timer (12000 kHz)
[   1.0000090] tegragpio0 at simplebus0: GPIO
[   1.0000090] gpio0 at tegragpio0 (A): 8 pins
[   1.0000090] gpio1 at tegragpio0 (B): 8 pins
[   1.0000090] gpio2 at tegragpio0 (C): 8 pins
[   1.0000090] gpio3 at tegragpio0 (D): 8 pins
[   1.0000090] gpio4 at tegragpio0 (E): 8 pins
[   1.0000090] gpio5 at tegragpio0 (F): 8 pins
[   1.0000090] gpio6 at tegragpio0 (G): 8 pins
[   1.0000090] gpio7 at tegragpio0 (H): 8 pins
[   1.0000090] gpio8 at tegragpio0 (I): 8 pins
[   1.0000090] gpio9 at tegragpio0 (J): 8 pins
[   1.0000090] gpio10 at tegragpio0 (K): 8 pins
[   1.0000090] gpio11 at tegragpio0 (L): 8 pins
[   1.0000090] gpio12 at tegragpio0 (M): 8 pins
[   1.0000090] gpio13 at tegragpio0 (N): 8 pins
[   1.0000090] gpio14 at tegragpio0 (O): 8 pins
[   1.0000090] gpio15 at tegragpio0 (P): 8 pins
[   1.0000090] gpio16 at tegragpio0 (Q): 8 pins
[   1.0000090] gpio17 at tegragpio0 (R): 8 pins
[   1.0000090] gpio18 at tegragpio0 (S): 8 pins
[   1.0000090] gpio19 at tegragpio0 (T): 8 pins
[   1.0000090] gpio20 at tegragpio0 (U): 8 pins
[   1.0000090] gpio21 at tegragpio0 (V): 8 pins
[   1.0000090] gpio22 at tegragpio0 (W): 8 pins
[   1.0000090] gpio23 at tegragpio0 (X): 8 pins
[   1.0000090] gpio24 at tegragpio0 (Y): 8 pins
[   1.0000090] gpio25 at tegragpio0 (Z): 8 pins
[   1.0000090] gpio26 at tegragpio0 (AA): 8 pins
[   1.0000090] gpio27 at tegragpio0 (BB): 8 pins
[   1.0000090] gpio28 at tegragpio0 (CC): 8 pins
[   1.0000090] gpio29 at tegragpio0 (DD): 8 pins
[   1.0000090] gpio30 at tegragpio0 (EE): 8 pins
[   1.0000090] tegra124car0 at simplebus0: CAR
[   1.0000090] tegrai2c0 at simplebus0: I2C
[   1.0000090] tegrai2c0: interrupting on irq 85
[   1.0000090] iic0 at tegrai2c0: I2C bus
[   1.0000090] as3722pmic0 at iic0 addr 0x40: AMS AS3722
[   1.0000090] as3722pmic0: default watchdog period is 10 seconds
[   1.0000090] as3722reg0 at as3722pmic0: +VDD_CPU_AP
[   1.0000090] as3722reg1 at as3722pmic0: +1.05V_RUN
[   1.0000090] as3722reg2 at as3722pmic0: +VDDIO_SDMMC3
[   1.0000090] tegramc0 at simplebus0: MC
[   1.0000090] tegramc0: interrupting on irq 109
[   1.0000090] tegrai2c1 at simplebus0: I2C
[   1.0000090] tegrai2c1: interrupting on irq 152
[   1.0000090] iic1 at tegrai2c1: I2C bus
[   1.0000090] tegraapbdma0 at simplebus0: APBDMA
[   1.0000090] tegrai2c2 at simplebus0: I2C
[   1.0000090] tegrai2c2: interrupting on irq 70
[   1.0000090] iic2 at tegrai2c2: I2C bus
[   1.0000090] audio-codec at iic2 addr 0x1c not configured
[   1.0000090] titemp0 at iic2 addr 0x4c: TMP451
[   1.0000090] seeprom0 at iic2 addr 0x56: eeprom: size 256
[   1.0000090] com0 at simplebus0: Tegra UART, working fifo
[   1.0000090] com0: console
[   1.0000090] com0: interrupting on irq 122
[   1.0000090] tegrai2c3 at simplebus0: I2C
[   1.0000090] tegrai2c3: interrupting on irq 116
[   1.0000090] iic3 at tegrai2c3: I2C bus
[   1.0000090] tegrai2c4 at simplebus0: I2C
[   1.0000090] tegrai2c4: interrupting on irq 124
[   1.0000090] iic4 at tegrai2c4: I2C bus
[   1.0000090] tegrapmc0 at simplebus0: PMC
[   1.0000090] tegrafuse0 at simplebus0: FUSE
[   1.0000090] fregulator0 at simplebus1: +3.3V_LP0
[   1.0000090] fregulator1 at simplebus1: +5V_HDMI_CON
[   1.0000090] fregulator2 at simplebus1: +1.05V_RUN_AVDD_HDMI_PLL
[   1.0000090] fregulator3 at simplebus1: +3.3V_AVDD_HDMI_AP_GATED
[   1.0000090] fregulator4 at simplebus1: +5V_SYS
[   1.0000090] fregulator5 at simplebus1: +3.3V_RUN
[   1.0000090] fregulator6 at simplebus1: +3.3V_SYS
[   1.0000090] fregulator7 at simplebus1: +5V_SATA
[   1.0000090] fregulator8 at simplebus1: +12V_SATA
[   1.0000090] fregulator9 at simplebus1: +5V_USB_HS
[   1.0000090] fregulator10 at simplebus1: +VDD_MUX
[   1.0000090] fregulator11 at simplebus1: +USB0_VBUS_SW
[   1.0000090] tegra124xpad0 at simplebus0: XUSB PADCTL
[   1.0000090] /emc@7001b000 at simplebus0 not configured
[   1.0000090] /pinmux@70000868 at simplebus0 not configured
[   1.0000090] tegrausbphy0 at simplebus0: USB PHY
[   1.0000090] tegrausbphy1 at simplebus0: USB PHY
[   1.0000090] /clock@70110000 at simplebus0 not configured
[   1.0000090] tegrasoctherm0 at simplebus0: SOC_THERM
[   1.0000090] /ahub@70300000 at simplebus0 not configured
[   1.0000090] tegrapcie0 at simplebus0: PCIE
[   1.0000090] tegrapcie0: interrupting on irq 130
[   1.0000090] tegrapcie0: lane config: x2 x1
[   1.0000090] pci0 at tegrapcie0 bus 0
[   1.0000090] ppb0 at pci0 dev 0 function 0: vendor 10de product 0e12 (rev. 0xa1)
[   1.0000090] ppb0: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x2 @ 5.0GT/s
[   1.0000090] pci1 at ppb0 bus 1
[   1.0000090] ppb1 at pci0 dev 1 function 0: vendor 10de product 0e13 (rev. 0xa1)
[   1.0000090] ppb1: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x1 @ 5.0GT/s
[   1.0000090] ppb1: link is x1 @ 2.5GT/s
[   1.0000090] pci2 at ppb1 bus 2
[   1.0000090] re0 at pci2 dev 0 function 0: RealTek 8168/8111 PCIe Gigabit Ethernet (rev. 0x0c)
[   1.0000090] re0: interrupting at irq 130
[   1.0000090] re0: Ethernet address 00:04:4b:2f:53:5e
[   1.0000090] rgephy0 at re0 phy 7: RTL8251 1000BASE-T media interface, rev. 0
[   1.0000090] rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
[   1.0000090] tegradrm0 at simplebus0
[   1.0000090] kern info: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   1.0000090] kern info: [drm] No driver support for vblank timestamp query.
[   1.0000090] tegrafb0 at tegradrm0
[   1.0000090] no data for est. mode 640x480x67
[   1.0000090] wsdisplay0 at tegrafb0 kbdmux 1
[   1.0000090] no data for est. mode 640x480x67
[   1.0000090] no data for est. mode 640x480x67
[   1.0000090] no data for est. mode 640x480x67
[   1.0000090] no data for est. mode 640x480x67
[   1.0000090] tegradrm0: initialized tegra 0.1.0 20151108 on minor 0
[   1.0000090] /gpu@0,57000000 at simplebus0 not configured
[   1.0000090] tegratimer0 at simplebus0: Timers
[   1.0000090] tegratimer0: default watchdog period is 10 seconds
[   1.0000090] /flow-controller@60007000 at simplebus0 not configured
[   1.0000090] /actmon@6000c800 at simplebus0 not configured
[   1.0000090] /apbmisc@70000800 at simplebus0 not configured
[   1.0000090] /serial@70006000 at simplebus0 not configured
[   1.0000090] /serial@70006040 at simplebus0 not configured
[   1.0000090] /spi@7000d400 at simplebus0 not configured
[   1.0000090] /spi@7000da00 at simplebus0 not configured
[   1.0000090] tegrartc0 at simplebus0: RTC
[   1.0000090] tegrartc0: disabled
[   1.0000090] ahcisata0 at simplebus0: SATA
[   1.0000090] fregulator0: failed to acquire regulator: 6
[   1.0000090] ahcisata0: couldn't acquire hvdd-supply
[   1.0000090] ahcisata0: interrupting on irq 55
[   1.0000090] ahcisata0: AHCI revision 1.31, 2 ports, 32 slots, CAP 0xe622ff01<PSC,SSC,PMD,SPM,ISS=0x2=Gen2,SAL,SALP,SSNTF,SNCQ,S64A>
[   1.0000090] atabus0 at ahcisata0 channel 0
[   1.0000090] hdaudio0 at simplebus0: HDA
[   1.0000090] hdaudio0: interrupting on irq 113
[   1.0000090] hdafg0 at hdaudio0: NVIDIA Tegra124 HDMI
[   1.0000090] hdafg0: HDMI00 8ch: Digital Out [Jack]
[   1.0000090] hdafg0: 8ch/0ch 44100Hz PCM16*
[   1.0000090] audio0 at hdafg0: playback, capture, full duplex, independent
[   1.0000090] audio0: slinear_le:16 8ch 44100Hz, blk 40ms for playback
[   1.0000090] audio0: slinear_le:16 2ch 44100Hz, blk 40ms for recording
[   1.0000090] spkr0 at audio0: PC Speaker (synthesized)
[   1.0000090] wsbell at spkr0 not configured
[   1.0000090] xhci0 at simplebus0: XUSB
[   1.0000090] xhci0: interrupting on irq 71
[   1.0000090] xhci0: interrupting on irq 72
[   1.0000090] fregulator0: failed to acquire regulator: 6
[   1.0000090] xhci0: couldn't acquire supply 'avdd-usb-supply'
[   1.0000090] xhci0: couldn't acquire supply 'avdd-pll-utmip-supply'
[   1.0000090] fregulator0: failed to acquire regulator: 6
[   1.0000090] xhci0: couldn't acquire supply 'hvdd-usb-ss-pll-e-supply'
[   1.0000090] sdhc0 at simplebus0: SDMMC (90666 kHz)
[   1.0000090] sdhc0: interrupting on irq 51
[   1.0000090] sdhc0: SDHC 4.0, rev 3, 32-bit ADMA2, 90666 kHz, HS SDR50 1.8V 3.0V 3.3V, re-tuning mode 1, 4096 byte blocks
[   1.0000090] sdmmc0 at sdhc0 slot 0
[   1.0000090] sdhc1 at simplebus0: SDMMC (90666 kHz)
[   1.0000090] sdhc1: interrupting on irq 63
[   1.0000090] sdhc1: SDHC 4.0, rev 3, 32-bit ADMA2, 90666 kHz, HS 1.8V 3.0V 3.3V, re-tuning mode 1, 4096 byte blocks
[   1.0000090] sdmmc1 at sdhc1 slot 0
[   1.0000090] ehci0 at simplebus0: USB
[   1.0000090] ehci0: interrupting on irq 53
[   1.0000090] usb0 at ehci0: USB revision 2.0
[   1.0000090] ehci1 at simplebus0: USB
[   1.0000090] ehci1: interrupting on irq 129
[   1.0000090] usb1 at ehci1: USB revision 2.0
[   1.0000090] /pmu at simplebus0 not configured
[   1.0000090] gpiokeys0 at simplebus0: Power
[   1.0000090] /sound at simplebus0 not configured
[   1.0000090] cpu3: Cortex-A15 r3p3 (Cortex V7A core)
[   1.0000090] cpu3: DC enabled IC enabled WB enabled LABT branch prediction enabled
[   1.3434298] cpu3: 32KB/64B 2-way L1 PIPT Instruction cache
[   1.3434298] cpu3: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[   1.3534228] cpu3: 2048KB/64B 16-way write-through L2 PIPT Unified cache
[   1.3534228] vfp3 at cpu3: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
[   1.3634241] cpu2: Cortex-A15 r3p3 (Cortex V7A core)
[   1.3734235] cpu2: DC enabled IC enabled WB enabled LABT branch prediction enabled
[   1.3734235] cpu2: 32KB/64B 2-way L1 PIPT Instruction cache
[   1.3834255] cpu2: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[   1.3934253] cpu2: 2048KB/64B 16-way write-through L2 PIPT Unified cache
[   1.3934253] vfp2 at cpu2: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
[   1.4034304] cpu1: Cortex-A15 r3p3 (Cortex V7A core)
[   1.4134272] cpu1: DC enabled IC enabled WB enabled LABT branch prediction enabled
[   1.4134272] cpu1: 32KB/64B 2-way L1 PIPT Instruction cache
[   1.4234291] cpu1: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[   1.4234291] cpu1: 2048KB/64B 16-way write-through L2 PIPT Unified cache
[   1.4334293] vfp1 at cpu1: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
[   1.6434430] sdhc0: cmd timeout error
[   1.6434430] uhub0 at usb0: NetBSD (0000) EHCI root hub (0000), class 9/0, rev 2.00/1.00, addr 1
[   1.6534447] uhub1 at usb1: NetBSD (0000) EHCI root hub (0000), class 9/0, rev 2.00/1.00, addr 1
[   1.6634460] ahcisata0 port 0: device present, speed: 3.0Gb/s
[   1.6634460] sdhc1: cmd timeout error
[   1.7034460] ld1 at sdmmc1: <0x45:0x0100:SEM16G:0x00:0x0c1e4b3c:0x000>
[   1.7134527] ld1: 15028 MB, 7633 cyl, 64 head, 63 sec, 512 bytes/sect x 30777344 sectors
[   1.7234520] sdmmc0: SD card status: 4-bit, C10
[   1.7234520] ld0 at sdmmc0: <0x74:0x4a45:SDC  :0x02:0x11004043:0x0e9>
[   1.7334507] ld0: 7695 MB, 3908 cyl, 64 head, 63 sec, 512 bytes/sect x 15759360 sectors
[   1.7434520] dk0 at ld1: "APP", 8388608 blocks at 49152, type: ntfs
[   1.7434520] dk1 at ld1: "DTB", 8192 blocks at 8437760, type: ntfs
[   1.7556599] dk2 at ld1: "EFI", 131072 blocks at 8445952, type: ntfs
[   1.7556599] dk3 at ld1: "USP", 8192 blocks at 8577024, type: ntfs
[   1.7679664] dk4 at ld1: "TP1", 8192 blocks at 8585216, type: ntfs
[   1.7679664] dk5 at ld1: "TP2", 8192 blocks at 8593408, type: ntfs
[   1.7800990] dk6 at ld1: "TP3", 8192 blocks at 8601600, type: ntfs
[   1.7800990] dk7 at ld1: "UDA", 22163456 blocks at 8609792, type: ntfs
[   1.7925794] ld1: 8-bit width, 1024 KB cache, 26.000 MHz
[   1.7925794] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz
[   3.1706087] wd0 at atabus0 drive 0
[   3.1706087] wd0: <ST9250315AS>
[   3.1706087] wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
[   3.8706415] uhub2 at uhub1 port 1: Mitsumi Electric (0x5ac) Hub in Apple Extended USB Keyboard (0x1002), class 9/0, rev 1.10/1.22, addr 2
[   5.1506964] uhidev0 at uhub2 port 1 configuration 1 interface 0
[   5.1606990] uhidev0: Mitsumi Electric (0x5ac) Apple Extended USB Keyboard (0x204), rev 1.10/1.22, addr 3, iclass 3/1
[   5.1706985] ukbd0 at uhidev0: 8 Variable keys, 6 Array codes
[   5.5807153] wskbd0 at ukbd0 mux 1
[   5.5807153] uhidev1 at uhub2 port 1 configuration 1 interface 1
[   5.5907222] uhidev1: Mitsumi Electric (0x5ac) Apple Extended USB Keyboard (0x204), rev 1.10/1.22, addr 3, iclass 3/0
[   5.6007227] uhidev1: 3 report ids
[   5.6007227] uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
[   5.6107211] uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
[   5.6307200] cpu2: setting speed to 2316 MHz
[   5.6307200] WARNING: 7 errors while detecting hardware; check system log.
[   5.6307200] boot device: ld0
[   5.6407214] root on ld0a dumps on ld0b
[   5.6507192] root file system type: ffs
[   5.6507192] kern.module.path=/stand/evbarm/9.99.2/modules
[   5.6707194] xhci0: couldn't load firmware from nvidia/tegra124/xusb.bin: 2



commit fd31127a4f0dbdeb830b315909981a52d5035a8e
Author: skrll <skrll@NetBSD.org>
Date:   Wed May 8 13:18:47 2019 +0000

    Really go back to pre-whitespace change (1.52) arm32_kernel_vm_init



armv7# audiocfg test 0
0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI, 2 playback channels
  testing channel 0... done
  testing channel 1... done
armv7# 





[ Kernel symbol table missing! ]
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
    2018, 2019 The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 8.1_STABLE (TEGRA) #0: Sat Jul 27 17:11:56 UTC 2019
        mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/TEGRA
total memory = 2047 MB
avail memory = 2018 MB
sysctl_createv: sysctl_create(machine_arch) returned 17
armfdt0 (root)
fdt0 at armfdt0: NVIDIA Tegra124 Jetson TK1
fdt1 at fdt0
fdt2 at fdt0
cpus0 at fdt0
cpu0 at cpus0: Cortex-A15 r3p3 (Cortex V7A core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
cpu0: 2048KB/64B 16-way write-through L2 PIPT Unified cache
vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
tegra124cpu0 at cpu0: DVFS
cpu1 at cpus0
cpu2 at cpus0
cpu3 at cpus0
tegralic0 at fdt0: LIC
gic0 at fdt0: GIC
armgic0 at gic0: Generic Interrupt Controller, 192 sources (183 valid)
armgic0: 32 Priorities, 160 SPIs, 7 PPIs, 16 SGIs
gtmr0 at fdt0: Generic Timer
armgtmr0 at gtmr0: ARMv7 Generic 64-bit Timer (12000 kHz)
armgtmr0: interrupting on irq 27
tegragpio0 at fdt0: GPIO
gpio0 at tegragpio0 (A): 8 pins
gpio1 at tegragpio0 (B): 8 pins
gpio2 at tegragpio0 (C): 8 pins
gpio3 at tegragpio0 (D): 8 pins
gpio4 at tegragpio0 (E): 8 pins
gpio5 at tegragpio0 (F): 8 pins
gpio6 at tegragpio0 (G): 8 pins
gpio7 at tegragpio0 (H): 8 pins
gpio8 at tegragpio0 (I): 8 pins
gpio9 at tegragpio0 (J): 8 pins
gpio10 at tegragpio0 (K): 8 pins
gpio11 at tegragpio0 (L): 8 pins
gpio12 at tegragpio0 (M): 8 pins
gpio13 at tegragpio0 (N): 8 pins
gpio14 at tegragpio0 (O): 8 pins
gpio15 at tegragpio0 (P): 8 pins
gpio16 at tegragpio0 (Q): 8 pins
gpio17 at tegragpio0 (R): 8 pins
gpio18 at tegragpio0 (S): 8 pins
gpio19 at tegragpio0 (T): 8 pins
gpio20 at tegragpio0 (U): 8 pins
gpio21 at tegragpio0 (V): 8 pins
gpio22 at tegragpio0 (W): 8 pins
gpio23 at tegragpio0 (X): 8 pins
gpio24 at tegragpio0 (Y): 8 pins
gpio25 at tegragpio0 (Z): 8 pins
gpio26 at tegragpio0 (AA): 8 pins
gpio27 at tegragpio0 (BB): 8 pins
gpio28 at tegragpio0 (CC): 8 pins
gpio29 at tegragpio0 (DD): 8 pins
gpio30 at tegragpio0 (EE): 8 pins
tegra124car0 at fdt0: CAR
fregulator0 at fdt1: +3.3V_LP0
tegramc0 at fdt0: MC
tegramc0: interrupting on irq 109
fregulator1 at fdt1: +5V_HDMI_CON
fregulator2 at fdt1: +1.05V_RUN_AVDD_HDMI_PLL
fregulator3 at fdt1: +3.3V_AVDD_HDMI_AP_GATED
tegraapbdma0 at fdt0: APBDMA
fregulator4 at fdt1: +5V_SYS
fregulator5 at fdt1: +3.3V_RUN
fregulator6 at fdt1: +3.3V_SYS
fclock0 at fdt2: 32768 Hz fixed clock
fregulator7 at fdt1: +5V_SATA
fregulator8 at fdt1: +12V_SATA
fregulator9 at fdt1: +5V_USB_HS
fregulator10 at fdt1: +VDD_MUX
tegrapmc0 at fdt0: PMC
tegrafuse0 at fdt0: FUSE
fregulator11 at fdt1: +USB0_VBUS_SW
tegrai2c0 at fdt0: I2C
tegrai2c0: interrupting on irq 85
iic0 at tegrai2c0: I2C bus
as3722pmic0 at iic0 addr 0x40: AMS AS3722
as3722pmic0: default watchdog period is 10 seconds
as3722reg0 at as3722pmic0: +VDD_CPU_AP
as3722reg1 at as3722pmic0: +1.05V_RUN
as3722reg2 at as3722pmic0: +VDDIO_SDMMC3
tegraxusbpad0 at fdt0: XUSB PADCTL
tegrai2c1 at fdt0: I2C
tegrai2c1: interrupting on irq 152
iic1 at tegrai2c1: I2C bus
/emc@7001b000 at fdt0 not configured
tegrampio0 at fdt0: MPIO
tegrausbphy0 at fdt0: USB PHY
tegrausbphy1 at fdt0: USB PHY
/clock@70110000 at fdt0 not configured
tegrasoctherm0 at fdt0: SOC_THERM
/ahub@70300000 at fdt0 not configured
tegrai2c2 at fdt0: I2C
tegrai2c2: interrupting on irq 70
iic2 at tegrai2c2: I2C bus
audio-codec at iic2 addr 0x1c not configured
titemp0 at iic2 addr 0x4c: TMP451
seeprom0 at iic2 addr 0x56: eeprom: size 256
tegrapcie0 at fdt0: PCIE
tegrapcie0: interrupting on irq 130
pci0 at tegrapcie0 bus 0
ppb0 at pci0 dev 0 function 0: vendor 10de product 0e12 (rev. 0xa1)
ppb0: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x2 @ 5.0GT/s
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 0: vendor 10de product 0e13 (rev. 0xa1)
ppb1: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x1 @ 5.0GT/s
ppb1: link is x1 @ 2.5GT/s
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0: RealTek 8168/8111 PCIe Gigabit Ethernet (rev. 0x0c)
re0: interrupting at irq 130
re0: Ethernet address 00:04:4b:2f:53:5e
rgephy0 at re0 phy 7: RTL8251 1000BASE-T media interface, rev. 0
rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
tegradrm0 at fdt0
drm: Supports vblank timestamp caching Rev 2 (21.10.2013).
drm: No driver support for vblank timestamp query.
tegrafb0 at tegradrm0
wsdisplay0 at tegrafb0 kbdmux 1
tegradrm0: info: registered panic notifier
tegradrm0: initialized tegra 0.1.0 20151108 on minor 0
nouveau0 at fdt0: GPU
tegratimer0 at fdt0: Timers
tegratimer0: default watchdog period is 10 seconds
/flow-controller@60007000 at fdt0 not configured
/actmon@6000c800 at fdt0 not configured
/apbmisc@70000800 at fdt0 not configured
/serial@70006000 at fdt0 not configured
/serial@70006040 at fdt0 not configured
com0 at fdt0: Tegra UART, working fifo
com0: console
com0: interrupting on irq 122
tegrai2c3 at fdt0: I2C
tegrai2c3: interrupting on irq 116
iic3 at tegrai2c3: I2C bus
tegrai2c4 at fdt0: I2C
tegrai2c4: interrupting on irq 124
iic4 at tegrai2c4: I2C bus
/spi@7000d400 at fdt0 not configured
/spi@7000da00 at fdt0 not configured
tegrartc0 at fdt0: RTC
tegrartc0: disabled
ahcisata0 at fdt0: SATA
ahcisata0: couldn't acquire hvdd-supply
ahcisata0: interrupting on irq 55
ahcisata0: AHCI revision 1.31, 2 ports, 32 slots, CAP 0xe620ff01<PSC,SSC,PMD,ISS=0x2=Gen2,SAL,SALP,SSNTF,SNCQ,S64A>
atabus0 at ahcisata0 channel 0
hdaudio0 at fdt0: HDA
hdaudio0: interrupting on irq 113
hdafg0 at hdaudio0: NVIDIA Tegra124 HDMI
hdafg0: HDMI00 8ch: Digital Out [Jack]
hdafg0: 8ch/0ch 44100Hz PCM16*
audio0 at hdafg0: full duplex, playback, capture, mmap, independent
hdafg0: Virtual format configured - Format SLINEAR, precision 16, channels 2, frequency 44100
hdafg0: Latency: 139 milliseconds
spkr0 at audio0: PC Speaker (synthesized)
xhci0 at fdt0: XUSB
xhci0: interrupting on irq 71
xhci0: interrupting on irq 72
sdhc0 at fdt0: SDMMC (90666 kHz)
sdhc0: interrupting on irq 51
sdhc0: SDHC 4.0, rev 3, 32-bit ADMA2, 90666 kHz, HS SDR50 1.8V 3.0V 3.3V, re-tuning mode 1, 4096 byte blocks
sdmmc0 at sdhc0 slot 0
sdhc1 at fdt0: SDMMC (90666 kHz)
sdhc1: interrupting on irq 63
sdhc1: SDHC 4.0, rev 3, 32-bit ADMA2, 90666 kHz, HS SDR50 1.8V 3.0V 3.3V, re-tuning mode 1, 4096 byte blocks
sdmmc1 at sdhc1 slot 0
ehci0 at fdt0: USB
ehci0: interrupting on irq 53
usb0 at ehci0: USB revision 2.0
ehci1 at fdt0: USB
ehci1: interrupting on irq 129
usb1 at ehci1: USB revision 2.0
/pmu at fdt0 not configured
gpiokeys0 at fdt0: Power
/sound at fdt0 not configured
cpu1: Cortex-A15 r3p3 (Cortex V7A core)
cpu1: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu1: 32KB/64B 2-way L1 PIPT Instruction cache
cpu1: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
cpu1: 2048KB/64B 16-way write-through L2 PIPT Unified cache
vfp1 at cpu1: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
cpu3: Cortex-A15 r3p3 (Cortex V7A core)
cpu3: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu3: 32KB/64B 2-way L1 PIPT Instruction cache
cpu3: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
cpu3: 2048KB/64B 16-way write-through L2 PIPT Unified cache
vfp3 at cpu3: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
cpu2: Cortex-A15 r3p3 (Cortex V7A core)
cpu2: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu2: 32KB/64B 2-way L1 PIPT Instruction cache
cpu2: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
cpu2: 2048KB/64B 16-way write-through L2 PIPT Unified cache
vfp2 at cpu2: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
uhub0 at usb1: Tegra (0x10de) EHCI root hub (0000), class 9/0, rev 2.00/1.00, addr 1
uhub1 at usb0: Tegra (0x10de) EHCI root hub (0000), class 9/0, rev 2.00/1.00, addr 1
ld1 at sdmmc1: <0x45:0x0100:SEM16G:0x00:0x0c1e4b3c:0x000>
ld1: 15028 MB, 7633 cyl, 64 head, 63 sec, 512 bytes/sect x 30777344 sectors
ahcisata0 port 0: device present, speed: 3.0Gb/s
sdmmc0: SD card status: 4-bit, C10
ld0 at sdmmc0: <0x74:0x4a45:SDC  :0x02:0x11004043:0x0e9>
ld0: 7695 MB, 3908 cyl, 64 head, 63 sec, 512 bytes/sect x 15759360 sectors
dk0 at ld1: "APP", 8388608 blocks at 49152, type: <unknown>
dk1 at ld1: "DTB", 8192 blocks at 8437760, type: <unknown>
dk2 at ld1: "EFI", 131072 blocks at 8445952, type: <unknown>
dk3 at ld1: "USP", 8192 blocks at 8577024, type: <unknown>
dk4 at ld1: "TP1", 8192 blocks at 8585216, type: <unknown>
dk5 at ld1: "TP2", 8192 blocks at 8593408, type: <unknown>
dk6 at ld1: "TP3", 8192 blocks at 8601600, type: <unknown>
dk7 at ld1: "UDA", 22163456 blocks at 8609792, type: <unknown>
ld1: 8-bit width, 1024 KB cache, 52.000 MHz
ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz
wd0 at atabus0 drive 0
wd0: <ST9250315AS>
wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
uhub2 at uhub0 port 1: Mitsumi Electric (0x5ac) Hub in Apple Extended USB Keyboard (0x1002), class 9/0, rev 1.10/1.22, addr 2
uhidev0 at uhub2 port 1 configuration 1 interface 0
uhidev0: Mitsumi Electric (0x5ac) Apple Extended USB Keyboard (0x204), rev 1.10/1.22, addr 3, iclass 3/1
ukbd0 at uhidev0
wskbd0 at ukbd0 mux 1
uhidev1 at uhub2 port 1 configuration 1 interface 1
uhidev1: Mitsumi Electric (0x5ac) Apple Extended USB Keyboard (0x204), rev 1.10/1.22, addr 3, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
cpu3: setting speed to 2316 MHz
WARNING: 1 error while detecting hardware; check system log.
boot device: ld0
root on ld0a dumps on ld0b
root file system type: ffs

>How-To-Repeat:
	audiocfg test 0
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->isaki
Responsible-Changed-By: isaki@NetBSD.org
Responsible-Changed-When: Sun, 18 Aug 2019 12:22:12 +0000
Responsible-Changed-Why:
I take it.


From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Sun, 18 Aug 2019 21:24:21 +0900

 At Sat, 17 Aug 2019 07:45:00 +0000 (UTC),
 nick@tk1.localdomain wrote:
 > armv7# audiocfg test 0
 > [  53.4834681] audio_track_setinfo_check failed: slinear_le 16bit 14ch 44100Hz
 > 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI, 12 playback channels
 >   testing channel 0... done
 >   testing channel 1... done
 >   testing channel 2... done
 >   testing channel 3... done
 >   testing channel 4... done
 >   testing channel 5... done
 >   testing channel 6... done
 >   testing channel 7... done
 >   testing channel 8... done
 >   testing channel 9... done
 >   testing channel 10... done
 >   testing channel 11... done

 audiocfg<8.99.39 and kernel>=8.99.39 are not compatible.
 Please use
  audiocfg<8.99.39 for kernel<8.99.39, or
  audiocfg>=8.99.39 for kernel>=8.99.39.

 New audiocfg uses new ioctl AUDIO_{GET,SET}FORMAT introduced on
 isaki-audio2 branch to get/set hardware information properly.
 It can support devices which have more than 2 channels.

 Thanks,
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org, isaki@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since
 isaki-audio2 merge
Date: Sun, 18 Aug 2019 16:53:08 +0100

 On 18/08/2019 13:25, Tetsuya Isaki wrote:
 > The following reply was made to PR kern/54474; it has been noted by GNAT=
 S.
 >
 > From: Tetsuya Isaki <isaki@pastel-flower.jp>
 > To: gnats-bugs@netbsd.org
 > Cc: kern-bug-people@netbsd.org,
 > 	gnats-admin@netbsd.org,
 > 	netbsd-bugs@netbsd.org
 > Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isak=
 i-audio2 merge
 > Date: Sun, 18 Aug 2019 21:24:21 +0900
 >
 >   At Sat, 17 Aug 2019 07:45:00 +0000 (UTC),
 >   nick@tk1.localdomain wrote:
 >   > armv7# audiocfg test 0
 >   > [  53.4834681] audio_track_setinfo_check failed: slinear_le 16bit 14=
 ch 44100Hz
 >   > 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI, 12 playback channels
 >   >   testing channel 0... done
 >   >   testing channel 1... done
 >   >   testing channel 2... done
 >   >   testing channel 3... done
 >   >   testing channel 4... done
 >   >   testing channel 5... done
 >   >   testing channel 6... done
 >   >   testing channel 7... done
 >   >   testing channel 8... done
 >   >   testing channel 9... done
 >   >   testing channel 10... done
 >   >   testing channel 11... done
 >
 >   audiocfg<8.99.39 and kernel>=3D8.99.39 are not compatible.
 >   Please use
 >    audiocfg<8.99.39 for kernel<8.99.39, or
 >    audiocfg>=3D8.99.39 for kernel>=3D8.99.39.

 This is disappointing.

 That said, the click still exists on netbsd-9 - here's the output from a
 netbsd-9 system

 # audiocfg test 0
 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
         playback: 8ch, 44100Hz
         record:   2ch, 44100Hz
         (P-) slinear_le 16/16, 2ch, { 44100 }
         (P-) slinear_le 16/16, 4ch, { 44100 }
         (P-) slinear_le 16/16, 6ch, { 44100 }
         (P-) slinear_le 16/16, 8ch, { 44100 }
         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
    testing channel 0... done
    testing channel 1... done
    testing channel 2... done
    testing channel 3... done
    testing channel 4... done
    testing channel 5... done
    testing channel 6... done
    testing channel 7...write: Resource temporarily unavailable
 #

 Nick

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Mon, 19 Aug 2019 22:58:08 +0900

 At Sun, 18 Aug 2019 16:53:08 +0100,
 Nick Hudson wrote:
 > That said, the click still exists on netbsd-9 - here's the output from a
 > netbsd-9 system
 > 
 > # audiocfg test 0

 I confirmed that "audiocfg test" does something strange...
 I look into.
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Sat, 24 Aug 2019 13:47:16 +0900

 At Sun, 18 Aug 2019 16:53:08 +0100,
 Nick Hudson wrote:
 > That said, the click still exists on netbsd-9 - here's the output from a
 > netbsd-9 system
 > 
 > # audiocfg test 0
 > 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
 >         playback: 8ch, 44100Hz
 >         record:   2ch, 44100Hz
 >         (P-) slinear_le 16/16, 2ch, { 44100 }
 >         (P-) slinear_le 16/16, 4ch, { 44100 }
 >         (P-) slinear_le 16/16, 6ch, { 44100 }
 >         (P-) slinear_le 16/16, 8ch, { 44100 }
 >         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
 >    testing channel 0... done
 >    testing channel 1... done
 >    testing channel 2... done
 >    testing channel 3... done
 >    testing channel 4... done
 >    testing channel 5... done
 >    testing channel 6... done
 >    testing channel 7...write: Resource temporarily unavailable
 > #

 Please try this commit.
 If you can play audio other than "audiocfg test", I hope it fixes
 reported problem.

 | Committed By:	isaki
 | Date:		Sat Aug 24 04:04:10 UTC 2019
 | 
 | Modified Files:
 | 	src/usr.bin/audiocfg: audiodev.c audiodev.h main.c
 | 
 | Log Message:
 | Revert to use single descriptor for "audiocfg test" as before.
 | 
 | 
 | To generate a diff of this commit:
 | cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/audiodev.c
 | cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.h
 | cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/main.c


 And please test this sample code as well.  This code just plays four
 seconds silence to /dev/audio0.  If isaki-audio2 driver is wrong,
 it will only fail on >=8.99.39 kernel and will not fail on <8.99.39.
 If it fails on both, it may be hardware driver(hdafg)'s issue.

 % cat rept.c
 #include <err.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 int main()
 {
 	const char *devaudio = "/dev/audio0";
 	char buf[8000];	// 1sec in 8bit-mulaw,1ch,8000Hz
 	int fd;
 	int r;
 	int i;

 	memset(buf, 0xff, sizeof(buf));
 	for (i = 0; i < 4; i++) {
 		fd = open(devaudio, O_WRONLY);
 		if (fd == -1)
 			err(1, "open: %s", devaudio);
 		printf("open ");
 		fflush(stdout);

 		r = write(fd, buf, sizeof(buf));
 		if (r < sizeof(buf))
 			err(1, "write");

 		close(fd);
 		printf("close\n");
 	}
 	return 0;
 }
 % gcc -o rept rept.c
 % ./rept
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: Tetsuya Isaki <isaki@pastel-flower.jp>,
 Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since
 isaki-audio2 merge
Date: Sat, 31 Aug 2019 21:51:23 +0100

 This is a multi-part message in MIME format.
 --------------073DC74152DF68FBA935189B
 Content-Type: text/plain; charset=utf-8; format=flowed
 Content-Transfer-Encoding: quoted-printable

 On 24/08/2019 05:47, Tetsuya Isaki wrote:
 > At Sun, 18 Aug 2019 16:53:08 +0100,
 > Nick Hudson wrote:
 >> That said, the click still exists on netbsd-9 - here's the output from =
 a
 >> netbsd-9 system
 >>
 >> # audiocfg test 0
 >> 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
 >>          playback: 8ch, 44100Hz
 >>          record:   2ch, 44100Hz
 >>          (P-) slinear_le 16/16, 2ch, { 44100 }
 >>          (P-) slinear_le 16/16, 4ch, { 44100 }
 >>          (P-) slinear_le 16/16, 6ch, { 44100 }
 >>          (P-) slinear_le 16/16, 8ch, { 44100 }
 >>          (PR) slinear_le 16/16, 2ch, 44100-44100Hz
 >>     testing channel 0... done
 >>     testing channel 1... done
 >>     testing channel 2... done
 >>     testing channel 3... done
 >>     testing channel 4... done
 >>     testing channel 5... done
 >>     testing channel 6... done
 >>     testing channel 7...write: Resource temporarily unavailable
 >> #
 >
 > Please try this commit.
 > If you can play audio other than "audiocfg test", I hope it fixes
 > reported problem.
 >
 > | Committed By:	isaki
 > | Date:		Sat Aug 24 04:04:10 UTC 2019
 > |
 > | Modified Files:
 > | 	src/usr.bin/audiocfg: audiodev.c audiodev.h main.c
 > |
 > | Log Message:
 > | Revert to use single descriptor for "audiocfg test" as before.
 > |
 > |
 > | To generate a diff of this commit:
 > | cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/audiodev.c
 > | cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.h
 > | cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/main.c

 Here's the output with the above changes and the previous "NFCI" change
 applied to netbsd-9 (see attached diff)


 tk1# audiocfg test 0
 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
         playback: 8ch, 44100Hz
         record:   2ch, 44100Hz
         (P-) slinear_le 16/16, 2ch, { 44100 }
         (P-) slinear_le 16/16, 4ch, { 44100 }
         (P-) slinear_le 16/16, 6ch, { 44100 }
         (P-) slinear_le 16/16, 8ch, { 44100 }
         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
    testing channel 0... done
    testing channel 1... done
    testing channel 2... done
    testing channel 3... done
    testing channel 4... done
    testing channel 5... done
    testing channel 6... done
    testing channel 7... done
 tk1#


 The audio is still "clicky"/distorted in some way.


 > And please test this sample code as well.  This code just plays four
 > seconds silence to /dev/audio0.  If isaki-audio2 driver is wrong,
 > it will only fail on >=3D8.99.39 kernel and will not fail on <8.99.39.
 > If it fails on both, it may be hardware driver(hdafg)'s issue.
 >

 [rept.c deleted]

 I couldn't hear any audio with this, but then the tk1's fan is really nois=
 y.

 Something is still no quite right with audiocfg test audio output.

 Nick

 --------------073DC74152DF68FBA935189B
 Content-Type: text/x-patch;
  name="audiocfg.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
  filename="audiocfg.diff"

 Index: usr.bin/audiocfg/audiodev.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/usr.bin/audiocfg/audiodev.c,v
 retrieving revision 1.7
 diff -u -p -r1.7 audiodev.c
 =2D-- usr.bin/audiocfg/audiodev.c	8 May 2019 14:36:12 -0000	1.7
 +++ usr.bin/audiocfg/audiodev.c	31 Aug 2019 20:47:07 -0000
 @@ -43,6 +43,9 @@
  #include "drvctl.h"
  #include "dtmf.h"

 +static int audiodev_test_chmask(struct audiodev *, unsigned int,
 +	audio_info_t *);
 +
  static TAILQ_HEAD(audiodevhead, audiodev) audiodevlist =3D
      TAILQ_HEAD_INITIALIZER(audiodevlist);

 @@ -63,26 +66,26 @@ audiodev_getinfo(struct audiodev *adev)
  	if (stat(_PATH_AUDIOCTL, &st) !=3D -1 && st.st_rdev =3D=3D adev->dev)
  		adev->defaultdev =3D true;

 -	adev->fd =3D open(adev->ctlpath, O_RDONLY);
 -	if (adev->fd =3D=3D -1) {
 +	adev->ctlfd =3D open(adev->ctlpath, O_RDONLY);
 +	if (adev->ctlfd =3D=3D -1) {
  			return -1;
  	}
 -	if (ioctl(adev->fd, AUDIO_GETDEV, &adev->audio_device) =3D=3D -1) {
 -		close(adev->fd);
 +	if (ioctl(adev->ctlfd, AUDIO_GETDEV, &adev->audio_device) =3D=3D -1) {
 +		close(adev->ctlfd);
  		return -1;
  	}

  	for (i =3D 0; ;i++) {
  		memset(&query, 0, sizeof(query));
  		query.index =3D i;
 -		if (ioctl(adev->fd, AUDIO_QUERYFORMAT, &query) =3D=3D -1) {
 +		if (ioctl(adev->ctlfd, AUDIO_QUERYFORMAT, &query) =3D=3D -1) {
  			if (errno =3D=3D ENODEV) {
  				/* QUERYFORMAT not supported. */
  				break;
  			}
  			if (errno =3D=3D EINVAL)
  				break;
 -			close(adev->fd);
 +			close(adev->ctlfd);
  			return -1;
  		}

 @@ -91,8 +94,8 @@ audiodev_getinfo(struct audiodev *adev)
  		TAILQ_INSERT_TAIL(&adev->formats, f, next);
  	}

 -	if (ioctl(adev->fd, AUDIO_GETFORMAT, &adev->info) =3D=3D -1) {
 -		close(adev->fd);
 +	if (ioctl(adev->ctlfd, AUDIO_GETFORMAT, &adev->hwinfo) =3D=3D -1) {
 +		close(adev->ctlfd);
  		return -1;
  	}

 @@ -158,8 +161,8 @@ audiodev_refresh(void)

  	while (!TAILQ_EMPTY(&audiodevlist)) {
  		adev =3D TAILQ_FIRST(&audiodevlist);
 -		if (adev->fd !=3D -1)
 -			close(adev->fd);
 +		if (adev->ctlfd !=3D -1)
 +			close(adev->ctlfd);
  		TAILQ_REMOVE(&audiodevlist, adev, next);
  		free(adev);
  	}
 @@ -250,12 +253,12 @@ int
  audiodev_set_param(struct audiodev *adev, int mode,
  	const char *encname, unsigned int prec, unsigned int ch, unsigned int fr=
 eq)
  {
 -	struct audio_info ai;
 +	audio_info_t ai;
  	int setmode;
  	u_int enc;

  	setmode =3D 0;
 -	ai =3D adev->info;
 +	ai =3D adev->hwinfo;

  	for (enc =3D 0; enc < encoding_max; enc++) {
  		if (strcmp(encname, encoding_names[enc]) =3D=3D 0)
 @@ -290,7 +293,7 @@ audiodev_set_param(struct audiodev *adev
  	ai.mode =3D setmode;
  	printf("setting %s to %s:%u, %uch, %uHz\n",
  	    adev->xname, encname, prec, ch, freq);
 -	if (ioctl(adev->fd, AUDIO_SETFORMAT, &ai) =3D=3D -1) {
 +	if (ioctl(adev->ctlfd, AUDIO_SETFORMAT, &ai) =3D=3D -1) {
  		perror("ioctl AUDIO_SETFORMAT");
  		return -1;
  	}
 @@ -298,40 +301,64 @@ audiodev_set_param(struct audiodev *adev
  }

  int
 -audiodev_test(struct audiodev *adev, unsigned int chanmask)
 +audiodev_test(struct audiodev *adev)
  {
  	audio_info_t info;
 -	int16_t *buf;
 -	size_t buflen;
 -	off_t off;
 -	int fd;
 -	int rv =3D -1;
 +	unsigned int i;
 +	int rv;

 -	fd =3D open(adev->path, O_WRONLY);
 -	if (fd =3D=3D -1) {
 +	rv =3D -1;
 +
 +	adev->fd =3D open(adev->path, O_WRONLY);
 +	if (adev->fd =3D=3D -1) {
  		perror("open");
  		return -1;
  	}

  	AUDIO_INITINFO(&info);
  	info.play.sample_rate =3D AUDIODEV_SAMPLE_RATE;
 -	info.play.channels =3D adev->info.play.channels;
 +	info.play.channels =3D adev->hwinfo.play.channels;
  	info.play.precision =3D 16;
  	info.play.encoding =3D AUDIO_ENCODING_SLINEAR_LE;
  	info.mode =3D AUMODE_PLAY;
 -	if (ioctl(fd, AUDIO_SETINFO, &info) =3D=3D -1) {
 +	if (ioctl(adev->fd, AUDIO_SETINFO, &info) =3D=3D -1) {
  		perror("ioctl AUDIO_SETINFO");
 -		goto abort;
 +		goto done;
  	}
 -	if (ioctl(fd, AUDIO_GETINFO, &info) =3D=3D -1) {
 +	if (ioctl(adev->fd, AUDIO_GETINFO, &info) =3D=3D -1) {
  		perror("ioctl AUDIO_GETINFO");
 -		goto abort;
 +		goto done;
  	}

 -	dtmf_new(&buf, &buflen, info.play.sample_rate, 2,
 -	    adev->info.play.channels, chanmask, 350.0, 440.0);
 +	for (i =3D 0; i < adev->hwinfo.play.channels; i++) {
 +		printf("  testing channel %u...", i);
 +		fflush(stdout);
 +		if (audiodev_test_chmask(adev, 1 << i, &info) =3D=3D -1)
 +			goto done;
 +		printf(" done\n");
 +	}
 +
 +	rv =3D 0;
 +done:
 +	close(adev->fd);
 +	return rv;
 +}
 +
 +static int
 +audiodev_test_chmask(struct audiodev *adev, unsigned int chanmask,
 +	audio_info_t *info)
 +{
 +	int16_t *buf;
 +	size_t buflen;
 +	off_t off;
 +	int rv;
 +
 +	rv =3D -1;
 +
 +	dtmf_new(&buf, &buflen, info->play.sample_rate, 2,
 +	    adev->hwinfo.play.channels, chanmask, 350.0, 440.0);
  	if (buf =3D=3D NULL) {
 -		goto abort;
 +		return -1;
  	}

  	off =3D 0;
 @@ -339,10 +366,10 @@ audiodev_test(struct audiodev *adev, uns
  		size_t wlen;
  		ssize_t ret;

 -		wlen =3D info.play.buffer_size;
 +		wlen =3D info->play.buffer_size;
  		if (wlen > buflen)
  			wlen =3D buflen;
 -		ret =3D write(fd, (char *)buf + off, wlen);
 +		ret =3D write(adev->fd, (char *)buf + off, wlen);
  		if (ret =3D=3D -1) {
  			perror("write");
  			goto done;
 @@ -352,7 +379,7 @@ audiodev_test(struct audiodev *adev, uns
  		buflen -=3D wlen;
  	}

 -	if (ioctl(fd, AUDIO_DRAIN) =3D=3D -1) {
 +	if (ioctl(adev->fd, AUDIO_DRAIN) =3D=3D -1) {
  		perror("ioctl AUDIO_DRAIN");
  		goto done;
  	}
 @@ -360,8 +387,5 @@ audiodev_test(struct audiodev *adev, uns
  	rv =3D 0;
  done:
  	free(buf);
 -abort:
 -	close(fd);
 -
  	return rv;
  }
 Index: usr.bin/audiocfg/audiodev.h
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/usr.bin/audiocfg/audiodev.h,v
 retrieving revision 1.5
 diff -u -p -r1.5 audiodev.h
 =2D-- usr.bin/audiocfg/audiodev.h	8 May 2019 14:36:12 -0000	1.5
 +++ usr.bin/audiocfg/audiodev.h	31 Aug 2019 20:47:07 -0000
 @@ -46,14 +46,15 @@ struct audiodev {
  	uint16_t unit;
  	char path[PATH_MAX+1];
  	char ctlpath[PATH_MAX+1];
 -
  	int fd;
 +	int ctlfd;
 +
  	dev_t dev;
  	bool defaultdev;

  	audio_device_t audio_device;
  	TAILQ_HEAD(, audiofmt) formats;
 -	struct audio_info info;
 +	audio_info_t hwinfo;

  	TAILQ_ENTRY(audiodev) next;
  };
 @@ -65,7 +66,7 @@ int			audiodev_set_default(struct audiod
  int			audiodev_set_param(struct audiodev *, int,
  				const char *, unsigned int, unsigned int,
  				unsigned int);
 -int			audiodev_test(struct audiodev *, unsigned int);
 +int			audiodev_test(struct audiodev *);

  extern const char *	encoding_names[];
  extern u_int		encoding_max;
 Index: usr.bin/audiocfg/main.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/usr.bin/audiocfg/main.c,v
 retrieving revision 1.8
 diff -u -p -r1.8 main.c
 =2D-- usr.bin/audiocfg/main.c	8 May 2019 14:36:12 -0000	1.8
 +++ usr.bin/audiocfg/main.c	31 Aug 2019 20:47:07 -0000
 @@ -87,17 +87,21 @@ print_audiodev(struct audiodev *adev, in
  		printf(" %s", adev->audio_device.version);
  	printf("\n");
  	printf("       playback: ");
 -	if ((adev->info.mode & AUMODE_PLAY))
 +	if ((adev->hwinfo.mode & AUMODE_PLAY)) {
  		printf("%uch, %uHz\n",
 -		    adev->info.play.channels, adev->info.play.sample_rate);
 -	else
 +		    adev->hwinfo.play.channels,
 +		    adev->hwinfo.play.sample_rate);
 +	} else {
  		printf("unavailable\n");
 +	}
  	printf("       record:   ");
 -	if ((adev->info.mode & AUMODE_RECORD))
 +	if ((adev->hwinfo.mode & AUMODE_RECORD)) {
  		printf("%uch, %uHz\n",
 -		    adev->info.record.channels, adev->info.record.sample_rate);
 -	else
 +		    adev->hwinfo.record.channels,
 +		    adev->hwinfo.record.sample_rate);
 +	} else {
  		printf("unavailable\n");
 +	}

  	TAILQ_FOREACH(f, &adev->formats, next) {
  		printf("       ");
 @@ -244,13 +248,8 @@ main(int argc, char *argv[])
  			return EXIT_FAILURE;
  		}
  		print_audiodev(adev, i);
 -		for (i =3D 0; i < adev->info.play.channels; i++) {
 -			printf("  testing channel %d...", i);
 -			fflush(stdout);
 -			if (audiodev_test(adev, 1 << i) =3D=3D -1)
 -				return EXIT_FAILURE;
 -			printf(" done\n");
 -		}
 +		if (audiodev_test(adev) =3D=3D -1)
 +			return EXIT_FAILURE;
  	} else
  		usage(argv[0]);
  		/* NOTREACHED */

 --------------073DC74152DF68FBA935189B--

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Tue, 03 Sep 2019 21:08:20 +0900

 At Sat, 31 Aug 2019 21:51:23 +0100,
 Nick Hudson wrote:
 > tk1# audiocfg test 0
 > 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
 >         playback: 8ch, 44100Hz
 >         record:   2ch, 44100Hz
 >         (P-) slinear_le 16/16, 2ch, { 44100 }
 >         (P-) slinear_le 16/16, 4ch, { 44100 }
 >         (P-) slinear_le 16/16, 6ch, { 44100 }
 >         (P-) slinear_le 16/16, 8ch, { 44100 }
 >         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
 >    testing channel 0... done
 >    testing channel 1... done
 >    testing channel 2... done
 >    testing channel 3... done
 >    testing channel 4... done
 >    testing channel 5... done
 >    testing channel 6... done
 >    testing channel 7... done
 > tk1#

 Thank you for complementing my missing information.
 And the problem "write: Resouce temporarily unavailable" seems gone.
 (It's small but good thing to me.)

 > The audio is still "clicky"/distorted in some way.
 :
 > I couldn't hear any audio with this, but then the tk1's fan is really noisy.
 > 
 > Something is still no quite right with audiocfg test audio output.

 Hmm, what happens in 2channels mode instead of 8channels mode?
 You can change it by following command on netbsd-9:
   # audiocfg set 0 p slinear_le 16 2 41000
   # audiocfg test 0

 Next, would you try the following patch (to netbsd-9)?
 This reverts a part of changes I made in isaki-audio2 branch.  The
 patch should not improve your problem but I want to confirm it.

 Or, would you send me the recorded waveform of "audiocfg test 0"?

 Thanks,
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

 diff --git a/sys/dev/hdaudio/hdafg.c b/sys/dev/hdaudio/hdafg.c
 index 3609c0095..c693180e9 100644
 --- a/sys/dev/hdaudio/hdafg.c
 +++ b/sys/dev/hdaudio/hdafg.c
 @@ -3940,7 +3940,7 @@ hdafg_round_blocksize(void *opaque, int blksize, int mode,
  {
  	struct hdaudio_audiodev *ad = opaque;
  	struct hdaudio_stream *st;
 -	int bufsize;
 +	int bufsize, nblksize;

  	st = (mode == AUMODE_PLAY) ? ad->ad_playback : ad->ad_capture;
  	if (st == NULL) {
 @@ -3958,12 +3958,22 @@ hdafg_round_blocksize(void *opaque, int blksize, int mode,
  	 * https://www.intel.co.jp/content/www/jp/ja/standards/high-definition-audio-specification.html , p70.
  	 */

 +	if (blksize > 8192)
 +		blksize = 8192;
 +	else if (blksize < 0)
 +		blksize = 128;
 +
 +	for (nblksize = 128; nblksize < blksize; nblksize <<= 1)
 +		;
 +
  	/* Make sure there are enough BDL descriptors */
  	bufsize = st->st_data.dma_size;
 -	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
 +	if (bufsize > HDAUDIO_BDL_MAX * nblksize) {
  		blksize = bufsize / HDAUDIO_BDL_MAX;
 +		for (nblksize = 128; nblksize < blksize; nblksize <<= 1)
 +			;
  	}
 -	return blksize;
 +	return nblksize;
  }

  static int

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org, isaki@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since
 isaki-audio2 merge
Date: Wed, 4 Sep 2019 15:45:57 +0100

 On 03/09/2019 13:10, Tetsuya Isaki wrote:> The following reply was made
 to PR kern/54474; it has been noted by GNATS.
  >
  > From: Tetsuya Isaki <isaki@pastel-flower.jp>
  > To: Nick Hudson <nick.hudson@gmx.co.uk>
  > Cc: gnats-bugs@netbsd.org,
  > 	gnats-admin@netbsd.org,
  > 	netbsd-bugs@netbsd.org
  > Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since
 isaki-audio2 merge
  > Date: Tue, 03 Sep 2019 21:08:20 +0900
  >
  >   At Sat, 31 Aug 2019 21:51:23 +0100,
  >   Nick Hudson wrote:
  >   > tk1# audiocfg test 0
  >   > 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
  >   >         playback: 8ch, 44100Hz
  >   >         record:   2ch, 44100Hz
  >   >         (P-) slinear_le 16/16, 2ch, { 44100 }
  >   >         (P-) slinear_le 16/16, 4ch, { 44100 }
  >   >         (P-) slinear_le 16/16, 6ch, { 44100 }
  >   >         (P-) slinear_le 16/16, 8ch, { 44100 }
  >   >         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
  >   >    testing channel 0... done
  >   >    testing channel 1... done
  >   >    testing channel 2... done
  >   >    testing channel 3... done
  >   >    testing channel 4... done
  >   >    testing channel 5... done
  >   >    testing channel 6... done
  >   >    testing channel 7... done
  >   > tk1#
  >
  >   Thank you for complementing my missing information.
  >   And the problem "write: Resouce temporarily unavailable" seems gone.
  >   (It's small but good thing to me.)
 I agree it's good :)


  >
  >   > The audio is still "clicky"/distorted in some way.
  >   :
  >   > I couldn't hear any audio with this, but then the tk1's fan is
 really noisy.
  >   >
  >   > Something is still no quite right with audiocfg test audio output.
  >
  >   Hmm, what happens in 2channels mode instead of 8channels mode?
  >   You can change it by following command on netbsd-9:
  >     # audiocfg set 0 p slinear_le 16 2 41000

 tk1#  audiocfg set 0 p slinear_le 16 2 41000
 setting audio0 to slinear_le:16,[ 194.9778959] audio0: slinear_le:16 8ch
 44100Hz, blk 40ms for playback
 [ 194.9878987] audio0: slinear_le:16 2ch 44100Hz, blk 40ms for recording
   2ch, 41000Hz
 ioctl AUDIO_SETFORMAT: Invalid argument
 couldn't set parameter: Invalid argument
 tk1#



  >     # audiocfg test 0
  >
  >   Next, would you try the following patch (to netbsd-9)?
  >   This reverts a part of changes I made in isaki-audio2 branch.  The
  >   patch should not improve your problem but I want to confirm it.
 It sounds OK with the patch!

 I can send you recording of before and after if you want, but the patch
 seems to fix it.

 Thanks,
 Nick

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Fri, 06 Sep 2019 15:05:37 +0900

 At Wed, 4 Sep 2019 15:45:57 +0100,
 Nick Hudson wrote:
 >  >   Hmm, what happens in 2channels mode instead of 8channels mode?
 >  >   You can change it by following command on netbsd-9:
 >  >     # audiocfg set 0 p slinear_le 16 2 41000
 > 
 > tk1#  audiocfg set 0 p slinear_le 16 2 41000
 > setting audio0 to slinear_le:16,[ 194.9778959] audio0: slinear_le:16 8ch
 > 44100Hz, blk 40ms for playback
 > [ 194.9878987] audio0: slinear_le:16 2ch 44100Hz, blk 40ms for recording
 >   2ch, 41000Hz
 > ioctl AUDIO_SETFORMAT: Invalid argument
 > couldn't set parameter: Invalid argument

 Oops, s/41000/44100/ sorry :-)

 >  >   Next, would you try the following patch (to netbsd-9)?
 >  >   This reverts a part of changes I made in isaki-audio2 branch.  The
 >  >   patch should not improve your problem but I want to confirm it.
 > It sounds OK with the patch!

 Hmm...  The patch cannot attach 6 channel device (like VirtualBox)
 (and that is why I modified it).

 The patch has two effects.  One limits the blocksize up to 8192 bytes,
 and the other limits the blocksize a multiple of 128 bytes.  I need to
 know which constraints does TK1 have.
 So would you please try more two tests?

 Test1. The following commands make blocksize 7056 bytes.  It is smaller
 than 8192 but not multiple of 128.  If TK1 only supports up to 8192 bytes
 block size, the sound will be clear.
  (make your sys/dev/hdaudio/hdafg.c clean)
  # audiocfg set 0 p slinear_le 16 8 44100   (it's default)
  # sysctl -w hw.audio0.blk_ms=10
  # audiocfg test 0

 Test2. The following patch+commands make blocksize multiple of 128 bytes
 but larger than 8192.  If TK1 only supports blocksize that is multiple of
 128 bytes, the sound will be clear.

 --- a/sys/dev/hdaudio/hdafg.c
 +++ b/sys/dev/hdaudio/hdafg.c
 @@ -3958,10 +3958,18 @@ hdafg_round_blocksize(void *opaque, int blksize, int mode,
  	 * https://www.intel.co.jp/content/www/jp/ja/standards/high-definition-audio-specification.html , p70.
  	 */

 +	if (blksize < 128)
 +		blksize = 128;
 +
 +	blksize = rounddown(blksize, 128);
 +	printf("%s blksize=%d\n", __func__, blksize);
 +
  	/* Make sure there are enough BDL descriptors */
  	bufsize = st->st_data.dma_size;
 -	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
 +	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
  		blksize = bufsize / HDAUDIO_BDL_MAX;
 +		blksize = rounddown(blksize, 128);
 +		printf("%s blksize2=%d\n", __func__, blksize);
  	}
  	return blksize;
  }

  # audiocfg set 0 p slinear_le 16 8 44100  (it's default)
  # sysctl -w hw.audio0.blk_ms=40           (it's default)
  # audiocfg test 0

 > I can send you recording of before and after if you want, but the patch
 > seems to fix it.

 Don't worry about it, thanks.
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: "Tetsuya Isaki" <isaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54474 CVS commit: src/sys/dev/hdaudio
Date: Sun, 19 Apr 2020 04:13:10 +0000

 Module Name:	src
 Committed By:	isaki
 Date:		Sun Apr 19 04:13:10 UTC 2020

 Modified Files:
 	src/sys/dev/hdaudio: hdafg.c

 Log Message:
 Make round_blocksize satisfy all of
 - restrictions that existed before merging isaki-audio2 branch.
 - better support for 6 channels hardware.
 - audio layer's requirement.
 This may help PR kern/54474.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/dev/hdaudio/hdafg.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge
Date: Sun, 19 Apr 2020 13:23:47 +0900

 Please test sys/dev/hdaudio/hdafg.c,v 1.22.
 I think that it works on your board without any patches and
 entering extra commands.

 Thanks,
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org, isaki@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Cc: 
Subject: Re: PR/54474 CVS commit: src/sys/dev/hdaudio
Date: Mon, 20 Apr 2020 11:39:38 +0100

 On 19/04/2020 05:15, Tetsuya Isaki wrote:
 > The following reply was made to PR kern/54474; it has been noted by GNAT=
 S.
 >
 > From: "Tetsuya Isaki" <isaki@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:
 > Subject: PR/54474 CVS commit: src/sys/dev/hdaudio
 > Date: Sun, 19 Apr 2020 04:13:10 +0000
 >
 >   Module Name:	src
 >   Committed By:	isaki
 >   Date:		Sun Apr 19 04:13:10 UTC 2020
 >
 >   Modified Files:
 >   	src/sys/dev/hdaudio: hdafg.c
 >
 >   Log Message:
 >   Make round_blocksize satisfy all of
 >   - restrictions that existed before merging isaki-audio2 branch.
 >   - better support for 6 channels hardware.
 >   - audio layer's requirement.
 >   This may help PR kern/54474.


 Hi,

 Ive tested this and it now works. Please arrange pullups to netbsd-9.

 Thanks,
 Nick

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Nick Hudson <nick.hudson@gmx.co.uk>
Cc: gnats-bugs@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: PR/54474 CVS commit: src/sys/dev/hdaudio
Date: Mon, 20 Apr 2020 21:29:37 +0900

 At Mon, 20 Apr 2020 11:39:38 +0100,
 Nick Hudson wrote:
 > Ive tested this and it now works. Please arrange pullups to netbsd-9.

 Thank you.  I will do in this week.
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

State-Changed-From-To: open->needs-pullups
State-Changed-By: leot@NetBSD.org
State-Changed-When: Mon, 20 Apr 2020 12:46:00 +0000
State-Changed-Why:
Confirmed fixed, needs pullups to netbsd-9.


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Sat, 25 Apr 2020 04:39:15 +0000
State-Changed-Why:
[pullup-9 #852]


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54474 CVS commit: [netbsd-9] src/sys/dev/hdaudio
Date: Sat, 25 Apr 2020 10:40:45 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Apr 25 10:40:45 UTC 2020

 Modified Files:
 	src/sys/dev/hdaudio [netbsd-9]: hdafg.c

 Log Message:
 Pull up following revision(s) (requested by isaki in ticket #852):

 	sys/dev/hdaudio/hdafg.c: revision 1.22

 Make round_blocksize satisfy all of
 - restrictions that existed before merging isaki-audio2 branch.
 - better support for 6 channels hardware.
 - audio layer's requirement.

 This may help PR kern/54474.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/dev/hdaudio/hdafg.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Wed, 29 Apr 2020 02:04:31 +0000
State-Changed-Why:
Pullup done.
Thank you for reporting!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.