From owner-freebsd-arm@freebsd.org Wed Aug 29 18:13:02 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 720CD10919B6 for ; Wed, 29 Aug 2018 18:13:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E903278EE4 for ; Wed, 29 Aug 2018 18:13:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 38D4610ABB for ; Wed, 29 Aug 2018 18:13:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w7TID1QZ027571 for ; Wed, 29 Aug 2018 18:13:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w7TID1Vq027570 for freebsd-arm@FreeBSD.org; Wed, 29 Aug 2018 18:13:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 231004] powerd causes click noises on RPi pcm audio using 12-CURRENT Date: Wed, 29 Aug 2018 18:13:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bobf@mrp3.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2018 18:13:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231004 Bug ID: 231004 Summary: powerd causes click noises on RPi pcm audio using 12-CURRENT Product: Base System Version: CURRENT Hardware: arm OS: Any Status: New Severity: Affects Some People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: bobf@mrp3.com when running powerd on an RPi model 2B, audible 'click' noises can be heard= on the RPi pcm audio output (both channels simultaneously), loud enough to be disruptive. However, these noises do not appear to happen when the CPU is sufficiently utilized, such as when playing a media file. As such, it may have been happening for a long time but had gone unnoticed. The CPU frequency changes from powerd appear to be the root cause. Loading= the BCM PWM kernel driver has no effect (whether present or absent in the kerne= l). Steps to repro: a) run an application that opens the audio output (/dev/dsp0.0) but doesn't send any signals over it. [alternately you can leave it 'unopened' but noise may be more frequent this way if you have it open] b) configure powerd to properly cycle the CPU frequency in rc.conf, and make sure it has been started with 'service powerd start'. c) repeatedly enter 'sysctl hw.cpufreq' into a console, and observe frequen= cy cycling and 'click noises' on the audio output. d) stop powerd with 'service powerd stop'. e) repeat 'c' except no noise. f) rinse/repeat as needed to confirm my settings for powerd are: powerd_enable=3D"YES" powerd_flags=3D"-n hadp -a hadp -b hadp" uname output: FreeBSD pi2c 12.0-ALPHA2 FreeBSD 12.0-ALPHA2 #16 r338208: Wed Aug 22 15:06:= 45 PDT 2018=20=20=20=20 bobf@hack.SFT.local:/e-drive/obj.current/e-drive/src.current/arm.armv7/sys/= RPI2 arm running processes: PID TT STAT TIME COMMAND 0 - DLs 0:00.02 [kernel] 1 - SLs 0:00.08 /sbin/init -- 2 - DL 0:00.00 [crypto] 3 - DL 0:00.00 [crypto returns 0] 4 - DL 0:00.00 [crypto returns 1] 5 - DL 0:00.00 [crypto returns 2] 6 - DL 0:00.00 [crypto returns 3] 7 - DL 0:00.00 [cam] 8 - SL 0:13.08 [VCHIQ-0] 9 - SL 0:01.25 [VCHIQr-0] 10 - RNL 79:00.98 [idle] 11 - WL 0:17.34 [intr] 12 - DL 0:00.30 [geom] 13 - DL 0:04.82 [usb] 14 - IL 0:00.00 [VCHIQs-0] 15 - DL 0:00.00 [sctp_iterator] 16 - DL 0:00.70 [rand_harvestq] 17 - DL 0:00.00 [soaiod1] 18 - DL 0:00.00 [soaiod2] 19 - DL 0:00.00 [soaiod3] 20 - DL 0:00.00 [soaiod4] 21 - DL 0:00.16 [mmcsd0: mmc/sd card] 22 - IL 0:00.00 [VCHIQka-0] 23 - SL 0:03.78 [bcm2835_audio_worke] 24 - DL 0:00.75 [pagedaemon] 25 - DL 0:00.00 [vmdaemon] 26 - DL 0:00.45 [bufdaemon] 27 - DL 0:00.04 [vnlru] 28 - DL 0:00.25 [syncer] 442 - Is 0:00.02 dhclient: system.syslog (dhclient) 445 - Is 0:00.02 dhclient: ue0 [priv] (dhclient) 491 - Is 0:00.00 dhclient: ue0 (dhclient) 492 - Is 0:00.01 /sbin/devd 562 - Ss 0:00.07 /usr/sbin/syslogd -s 773 - Is 0:00.02 /usr/sbin/sshd 777 - Ss 0:00.07 /usr/sbin/cron -s 836 - Is 0:00.18 sshd: ME [priv] (sshd) 839 - I 0:00.07 sshd: ME@pts/0 (sshd) 971 - Ss 0:00.00 /usr/sbin/powerd -n hadp -a hadp -b hadp 835 u0 Is 0:00.19 login [pam] (login) 852 u0 S 0:00.71 -csh (csh) 974 u0 R+ 0:00.02 ps ax 827 v0 Is+ 0:00.03 /usr/libexec/getty Pc ttyv0 828 v1 Is+ 0:00.02 /usr/libexec/getty Pc ttyv1 829 v2 Is+ 0:00.03 /usr/libexec/getty Pc ttyv2 830 v3 Is+ 0:00.02 /usr/libexec/getty Pc ttyv3 831 v4 Is+ 0:00.03 /usr/libexec/getty Pc ttyv4 832 v5 Is+ 0:00.02 /usr/libexec/getty Pc ttyv5 833 v6 Is+ 0:00.04 /usr/libexec/getty Pc ttyv6 834 v7 Is+ 0:00.02 /usr/libexec/getty Pc ttyv7 840 0 Is 0:00.22 -csh (csh) 849 0 S+ 5:47.71 ./ethermidi -F /home/bobf/mysounds.sf2 0.0.0.0:5000 NOTE: the 'ethermidi' application is one that I'm working on; it opens the audio output and idles waiting for MIDI commands over ethernet, and invokes libfluidsynth to play the MIDI sounds via 'oss'. It's not the noise source since this doesn't happen on other platforms with the same application.=20 However, it does reveal that there IS a noise source. --=20 You are receiving this mail because: You are the assignee for the bug.=