How clean is your power? Any way to try it on batteries, even just for a few minutes?
On Tue, May 11, 2021, 9:02 AM Luca Castagnini <l...@castagnini.org> wrote: > Hi everyone, > > I am asking for help with the following problem: > I am trying to reproduce a song on the Raspberry Pi 4B using OpenBSD > -current and an external USB audio dongle, but I hear only/mostly noise. > The song is barely recognizable in the background and sometimes (rarely > and randomly) it is reproduced correctly (no noise) for a fraction of a > second, then noise again. > > The USB DAC works fine on my amd64 laptop with openbsd-current. The > uaudio shows up in dmesg with the same parameters: > uaudio0: class v1, full-speed, sync, channels: 2 play, 1 rec, 8 ctls > (full dmesg below) > > Reading the mailing lists I did the following: > I tried to set in UEFI both ACPI=ACPI+devicetree and ACPI=devicetree > while I left SD=eMMC2 > I tried both USB3, USB2 and using an external (powered) USB hub. > I tried to change encoding with audioctl (I changed rate/blksz as well > but I am not an expert). > I tried to add the following, reboot and re-playing: > rcctl set sndiod flags -m play > I played the song as root (not sure whether it should help, it didn't). > > I ran sndiod with debug output as: > rcctl stop sndiod > sndiod -ddd -a on > > and I checked that audioctl->play.errors is zero while playing the song. > > Below I list the output of sndio, audioctl during song reproduction and > dmesg. > > I would be happy if anyone had suggestions that might help. > I am also interested in case there is a known-to-work-on-rpi USB audio > dongle that I can use. > > Many thanks and best wishes > Luca > > ======================================= > Output of audioctl during reproduction > ======================================= > name=uaudio0 > mode=play,record > pause=0 > active=1 > nblks=16 > blksz=480 > rate=48000 > encoding=s16le > play.channels=2 > play.bytes=4151040 > play.errors=0 > record.channels=1 > record.bytes=2075520 > record.errors=0 > > (play.bytes increases while playing the song, play.errors always zero) > > ======================================= > Output sndiod -ddd -a on > (playing for a few secs, then Ctrl-C) > ======================================= > snd0 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup > snd1 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup > snd2 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup > snd3 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup > helper(helper|ini): created > worker(worker|ini): created > listen(/tmp/sndio/sock0|ini): created > sock(sock|ini): created > helper: recv: cmd = 0, num = 0, idx = 0, mode = 3, fd = -1 > helper: send: cmd = 3, num = 0, idx = 0, mode = 0, fd = 3 > helper: recv: cmd = 2, num = 0, idx = 0, mode = 768, fd = -1 > helper: send: cmd = 3, num = 0, idx = 0, mode = 0, fd = 3 > sock,rmsg,widl: AUTH message > sock,rmsg,widl: HELLO message > sock,rmsg,widl: hello from <play>, mode = 1, ver 7 > app/play0.level=127 at 1 -> slot_level:play0: added > snd0 pst=cfg: device requested > snd0 pst=cfg: trying rsnd/0 > worker: send: cmd = 0, num = 0, idx = 0, mode = 3, fd = -1 > worker: recv: cmd = 3, num = 0, idx = 0, mode = 0, fd = 6 > worker: send: cmd = 2, num = 0, idx = 0, mode = 768, fd = -1 > worker: recv: cmd = 3, num = 0, idx = 0, mode = 0, fd = 7 > snd0 pst=cfg: using rsnd/0 > sio(dev|ini): created > sioctl(mix|ini): created > 0/output0.level=186 at 2 -> hw:0/0: added > 0/output1.level=186 at 3 -> hw:0/1: added > 0/output0.mute=0 at 4 -> hw:0/32: added > 0/output1.mute=0 at 5 -> hw:0/33: added > 0/input0.level=146 at 6 -> hw:0/64: added > 0/input0.mute=0 at 7 -> hw:0/96: added > snd0 pst=cfg: 48000Hz, s16le, play 0:1, rec 0:0, 16 blocks of 480 frames > play0 vol=127,pst=ini: using snd0 pst=ini.default, mode = 1 > sock(sock|ini): processed in 6370us > play0 vol=127,pst=ini,rmsg,widl: SETPAR message > play0 vol=127,pst=ini,rmsg,widl: GETPAR message > play0 vol=127,pst=ini,rmsg,widl: GETPAR message > play0 vol=127,pst=ini,rmsg,widl: START message > play0 vol=127,pst=ini: playing s16le -> s16le > play0 vol=127,pst=ini: allocated 7680/15360 fr buffers > play0 vol=127,pst=sta: 48000Hz, s16le, play 0:1, 16 blocks of 480 frames > play0 vol=127,pst=sta,rmsg,widl: STOP message > play0 vol=127,pst=sta: stopping > cmap: nch = 2, ostart = 0, onext = 0, istart = 0, inext = 0 > snd0 pst=ini: device started > snd0 pst=run: started > play0 vol=127,pst=rdy: attached at -7680 + 0/480 > play0 vol=127,pst=rdy: set weight: 32768/32768 > play0 vol=127,pst=stp,rmsg,widl: building SETVOL message, vol = 127 > play0 vol=127,pst=ini,rmsg,widl: stopped > play0 vol=127,pst=ini: drained > play0 vol=127,pst=ini,rmsg,widl: building STOP message > play0 vol=127,pst=ini,rmsg,widl: BYE message > play0 vol=127,pst=ini,rmsg,widl: closing > snd0 pst=run: device released > sock(sock|zom): destroyed > sock(sock|ini): created > sock,rmsg,widl: AUTH message > sock,rmsg,widl: HELLO message > sock,rmsg,widl: hello from <play>, mode = 1, ver 7 > snd0 pst=run: device requested > play0 vol=127,pst=ini: using snd0 pst=run.default, mode = 1 > play0 vol=127,pst=ini,rmsg,widl: SETPAR message > play0 vol=127,pst=ini,rmsg,widl: playback channels 0:1 -> 0:1 > play0 vol=127,pst=ini,rmsg,widl: 44100Hz sample rate, 441 frame blocks > play0 vol=127,pst=ini,rmsg,widl: 8820 frame buffer > play0 vol=127,pst=ini,rmsg,widl: GETPAR message > play0 vol=127,pst=ini,rmsg,widl: GETPAR message > play0 vol=127,pst=ini,rmsg,widl: START message > play0 vol=127,pst=ini: playing s16le -> s16le > play0 vol=127,pst=ini: allocated 8820/15876 fr buffers > play0 vol=127,pst=sta: 44100Hz, s16le, play 0:1, 20 blocks of 441 frames > play0 vol=127,pst=sta,rmsg,widl: building SETVOL message, vol = 127 > cmap: nch = 2, ostart = 0, onext = 0, istart = 0, inext = 0 > resamp: 441/480 > play0 vol=127,pst=rdy: attached at -7056 + 0/441 > play0 vol=127,pst=rdy: set weight: 32768/32768 > play0 vol=127,pst=run,rmsg,widl: STOP message > play0 vol=127,pst=run: stopping > play0 vol=127,pst=ini,rmsg,widl: stopped > play0 vol=127,pst=ini: drained > play0 vol=127,pst=ini,rmsg,widl: building STOP message > play0 vol=127,pst=ini,rmsg,widl: BYE message > play0 vol=127,pst=ini,rmsg,widl: closing > snd0 pst=run: device released > sock(sock|zom): destroyed > snd0 pst=run: device stopped > snd0 pst=run: stopped, load avg = 57781 / 2860591 > snd0 pst=cfg: software master level control enabled > 0/output.level=127 at 2 -> dev_master:0: added > snd0 pst=cfg: closed > sio(dev|zom): destroyed > sioctl(mix|zom): destroyed > snd0 pst=cfg: closing > 0/output.level=127 at 2 -> dev_master:0: removed > sio(dev|zom): processed in 5741us > ======================================= > End of sndiod -ddd -a on > ======================================= > > ======================================= > RPi4 dmesg > ======================================= > dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP > real mem = 8418521088 (8028MB) > avail mem = 8127442944 (7750MB) > random: good seed from bootblocks > mainbus0 at root: Raspberry Pi 4 Model B Rev 1.4 > psci0 at mainbus0: PSCI 1.1, SMCCC 1.2 > cpu0 at mainbus0 mpidr 0: ARM Cortex-A72 r0p3 > cpu0: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 > D-cache > cpu0: 1024KB 64b/line 16-way L2 cache > cpu0: CRC32,ASID16 > cpu1 at mainbus0 mpidr 1: ARM Cortex-A72 r0p3 > cpu1: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 > D-cache > cpu1: 1024KB 64b/line 16-way L2 cache > cpu1: CRC32,ASID16 > cpu2 at mainbus0 mpidr 2: ARM Cortex-A72 r0p3 > cpu2: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 > D-cache > cpu2: 1024KB 64b/line 16-way L2 cache > cpu2: CRC32,ASID16 > cpu3 at mainbus0 mpidr 3: ARM Cortex-A72 r0p3 > cpu3: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 > D-cache > cpu3: 1024KB 64b/line 16-way L2 cache > cpu3: CRC32,ASID16 > efi0 at mainbus0: UEFI 2.7 > efi0: https://github.com/pftf/RPi4 rev 0x10000 > smbios0 at efi0: SMBIOS 3.3.0 > smbios0: vendor https://github.com/pftf/RPi4 version "UEFI Firmware > v1.26" date 04/16/2021 > smbios0: Raspberry Pi Foundation Raspberry Pi 4 Model B > apm0 at mainbus0 > "system" at mainbus0 not configured > "axi" at mainbus0 not configured > simplebus0 at mainbus0: "soc" > bcmclock0 at simplebus0 > bcmmbox0 at simplebus0 > bcmgpio0 at simplebus0 > bcmaux0 at simplebus0 > ampintc0 at simplebus0 nirq 256, ncpu 4 ipi: 0, 1: > "interrupt-controller" > bcmtmon0 at simplebus0 > bcmdmac0 at simplebus0: DMA0 DMA2 DMA4 DMA5 DMA6 DMA7 DMA8 DMA9 > "timer" at simplebus0 not configured > pluart0 at simplebus0: console > com0 at simplebus0: ns16550, no working fifo > "local_intc" at simplebus0 not configured > bcmdog0 at simplebus0 > bcmirng0 at simplebus0 > "firmware" at simplebus0 not configured > "power" at simplebus0 not configured > "mailbox" at simplebus0 not configured > sdhc0 at simplebus0 > sdhc0: SDHC 3.0, 250 MHz base clock > sdmmc0 at sdhc0: 4-bit, sd high-speed, mmc high-speed > "gpiomem" at simplebus0 not configured > "fb" at simplebus0 not configured > "vcsm" at simplebus0 not configured > "clocks" at mainbus0 not configured > "phy" at mainbus0 not configured > "clk-27M" at mainbus0 not configured > "clk-108M" at mainbus0 not configured > simplebus1 at mainbus0: "emmc2bus" > sdhc1 at simplebus1 > sdhc1: SDHC 3.0, 100 MHz base clock > sdmmc1 at sdhc1: 8-bit, sd high-speed, mmc high-speed, ddr52, dma > "arm-pmu" at mainbus0 not configured > agtimer0 at mainbus0: 54000 kHz > simplebus2 at mainbus0: "scb" > bcmpcie0 at simplebus2 > pci0 at bcmpcie0 > ppb0 at pci0 dev 0 function 0 "Broadcom BCM2711" rev 0x10 > pci1 at ppb0 bus 1 > xhci0 at pci1 dev 0 function 0 "VIA VL805 xHCI" rev 0x01: intx, xHCI 1.0 > usb0 at xhci0: USB revision 3.0 > uhub0 at usb0 configuration 1 interface 0 "VIA xHCI root hub" rev > 3.00/1.00 addr 1 > bse0 at simplebus2: address dc:a6:32:ed:1d:42 > brgphy0 at bse0 phy 1: BCM54210E 10/100/1000baseT PHY, rev. 2 > "dma" at simplebus2 not configured > "hevc-decoder" at simplebus2 not configured > "rpivid-local-intc" at simplebus2 not configured > "h264-decoder" at simplebus2 not configured > "vp9-decoder" at simplebus2 not configured > "leds" at mainbus0 not configured > "sd_io_1v8_reg" at mainbus0 not configured > "sd_vcc_reg" at mainbus0 not configured > "fixedregulator_3v3" at mainbus0 not configured > "fixedregulator_5v0" at mainbus0 not configured > simplebus3 at mainbus0: "v3dbus" > "bootloader" at mainbus0 not configured > dt: 443 probes > scsibus0 at sdmmc1: 2 targets, initiator 0 > sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SC64G, 0080> removable > sd0: 60906MB, 512 bytes/sector, 124735488 sectors > uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs USB2.0 Hub" > rev 2.10/4.21 addr 2 > bwfm0 at sdmmc0 function 1 > manufacturer 0x02d0, product 0xa9a6 at sdmmc0 function 2 not configured > manufacturer 0x02d0, product 0xa9a6 at sdmmc0 function 3 not configured > uaudio0 at uhub1 port 3 configuration 1 interface 1 "C-Media Electronics > Inc. USB Audio Device" rev 1.10/1.00 addr 3 > uaudio0: class v1, full-speed, sync, channels: 2 play, 1 rec, 8 ctls > audio0 at uaudio0 > uhidev0 at uhub1 port 3 configuration 1 interface 3 "C-Media Electronics > Inc. USB Audio Device" rev 1.10/1.00 addr 3 > uhidev0: iclass 3/0 > uhid0 at uhidev0: input=4, output=4, feature=0 > umass0 at uhub0 port 2 configuration 1 interface 0 "TOSHIBA External USB > 3.0" rev 3.00/3.22 addr 4 > umass0: using SCSI over Bulk-Only > scsibus1 at umass0: 2 targets, initiator 0 > sd1 at scsibus1 targ 1 lun 0: <TOSHIBA, External USB 3.0, 5438> > serial.0480090010106005627F > sd1: 3815447MB, 512 bytes/sector, 7814037164 sectors > vscsi0 at root > scsibus2 at vscsi0: 256 targets > softraid0 at root > scsibus3 at softraid0: 256 targets > sd2 at scsibus3 targ 1 lun 0: <OPENBSD, SR RAID 1, 006> > sd2: 1282723MB, 512 bytes/sector, 2627018022 sectors > root on sd0a (33593fb538f83769.a) swap on sd0b dump on sd0b > gpio0 at bcmgpio0: 58 pins > bwfm0: address dc:a6:32:ed:1d:43 > WARNING: can't update clock chip time > >