From owner-freebsd-current@freebsd.org Tue Oct 2 19:57:18 2018 Return-Path: Delivered-To: freebsd-current@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 089FC10AA8F6 for ; Tue, 2 Oct 2018 19:57:18 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9D87A1B0 for ; Tue, 2 Oct 2018 19:57:17 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wr1-x42f.google.com with SMTP id x12-v6so3580688wru.8 for ; Tue, 02 Oct 2018 12:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ovy0x2xOfrRyczCLDeWxfr+UYNacdTrFF0j46W332GU=; b=fw5T98MWd0CKvtyYriZ7LkjEDlkwuMByeiac+OGlVl4K07F7qhujrGGGztMMKnu3xi GGHmre4JH4yWm1aKCb30xiIQFqZxa7ZVH+lx5I0l9C95GFh2l0lDyfwrSE6d3W8wCtEo k/jiYwTWANpwwG44UQ6gxmz8zDGsmufp47i910mfexSsO7FOW2+uvmoprva84Zdu+PS9 rgT1XqgAzgZjN96SsKIQtA4RggXiM1xeGuuE7a1E059zBIB0HJRDrhYBSe+JPkjsZGzS Qufdq7QD78yyKAgwcnr8I7tpYhliVy0bDPEOLUgIBMwrjW8+tUaylFtw7r4jKhnrnuJV Ajvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ovy0x2xOfrRyczCLDeWxfr+UYNacdTrFF0j46W332GU=; b=X8xM6SSbYkpuSxfUvXTNYrRPTmi/jSPYMpwqSZ6NVg8vtVebO/6FbX9TAOBzvc/47W IP0Zg76QH5+ZF/mxE4m4dO6atwD37OzXWoagMrb8wxRcM1SlNDl2LleA7x11nn+EYYRE 0Ur9F71cHl5XhkOZ1DoUZxWocjdbM1sAErxJEw9QZ8Lvn51gbOvyCT8yU51DqjhqxOnQ vz0jp6L1RVe2zUY0mFz1PGfbD0pZlf50t9D84zZVYmKwEskcPqA0ns4XNbt04YROSF7l x36RRVeLc/n/RijPBrR9HQloL8eQfk/sZtuX0fl/5sU56WfM+vQeQQZoN9MzNBO9Slki Vp+Q== X-Gm-Message-State: ABuFfogQf2/Id8l8wnfuz+nG0FLJMK5stEzHx0f4/sXtOUdq3j/kDFFr u9sTa5IyHefsZf1R5ynQwWJDqmLvTWVYu15IrHP6WlIo X-Google-Smtp-Source: ACcGV62w2LQfDWNjx0RRFPAISjQ3MBXrDxDCjY6odk97YU1v6XfbajwW4/1Cf1FmRo7xmx+k8SbSG5FNX4cE+EzwpVc= X-Received: by 2002:a5d:6b92:: with SMTP id n18-v6mr10721704wrx.295.1538510235274; Tue, 02 Oct 2018 12:57:15 -0700 (PDT) MIME-Version: 1.0 References: <85518f55-20a8-f534-7266-a9e847912afc@alvermark.net> <596a89fa-d7a3-1d39-d296-e07359cb487f@alvermark.net> In-Reply-To: <596a89fa-d7a3-1d39-d296-e07359cb487f@alvermark.net> From: Johannes Lundberg Date: Tue, 2 Oct 2018 20:56:38 +0100 Message-ID: Subject: Re: Sound issues with Dell Latitude 7490 (kabylake) To: Jakob Alvermark Cc: freebsd-current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2018 19:57:18 -0000 On Mon, Oct 1, 2018 at 10:12 PM Jakob Alvermark wrote: > On 10/1/18 10:56 PM, Johannes Lundberg wrote: > > On Mon, Oct 1, 2018 at 8:37 PM Jakob Alvermark > wrote: > > > >> On 10/1/18 5:57 PM, Johannes Lundberg wrote: > >>> Hi > >>> > >>> While sound work out of the box (with headphone switching) on the 1-2 > >> year > >>> older Latitude 7270, it does not on my new machine. > >>> > >>> The internal speaker works fine. If I plug in external speakers in the > >>> headphone jack, sound still goes to the internal speaker while a very > >> load > >>> buzz comes from the external speakers. > >>> > >>> Do we have a solution for this? > >>> > >>> # cat /dev/sndstat > >>> Installed devices: > >>> pcm0: (play/rec) default > >>> pcm1: (play) > >>> pcm2: (play) > >>> No devices installed from userspace. > >>> > >>> # sysctl hw.snd > >>> hw.snd.maxautovchans: 16 > >>> hw.snd.default_unit: 0 > >>> hw.snd.version: 2009061500/amd64 > >>> hw.snd.default_auto: 1 > >>> hw.snd.verbose: 0 > >>> hw.snd.vpc_mixer_bypass: 1 > >>> hw.snd.feeder_rate_quality: 1 > >>> hw.snd.feeder_rate_round: 25 > >>> hw.snd.feeder_rate_max: 2016000 > >>> hw.snd.feeder_rate_min: 1 > >>> hw.snd.feeder_rate_polyphase_max: 183040 > >>> hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97 > >>> hw.snd.feeder_eq_exact_rate: 0 > >>> hw.snd.feeder_eq_presets: > >>> > PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000 > >>> hw.snd.basename_clone: 1 > >>> hw.snd.compat_linux_mmap: 0 > >>> hw.snd.syncdelay: -1 > >>> hw.snd.usefrags: 0 > >>> hw.snd.vpc_reset: 0 > >>> hw.snd.vpc_0db: 45 > >>> hw.snd.vpc_autoreset: 1 > >>> hw.snd.timeout: 5 > >>> hw.snd.latency_profile: 1 > >>> hw.snd.latency: 5 > >>> hw.snd.report_soft_matrix: 1 > >>> hw.snd.report_soft_formats: 1 > >>> > >>> # sysctl dev.pcm > >>> dev.pcm.2.bitperfect: 0 > >>> dev.pcm.2.buffersize: 65536 > >>> dev.pcm.2.play.vchanformat: s16le:2.0 > >>> dev.pcm.2.play.vchanrate: 48000 > >>> dev.pcm.2.play.vchanmode: passthrough > >>> dev.pcm.2.play.vchans: 1 > >>> dev.pcm.2.play.32bit: 24 > >>> dev.pcm.2.%parent: hdaa1 > >>> dev.pcm.2.%pnpinfo: > >>> dev.pcm.2.%location: nid=3 > >>> dev.pcm.2.%driver: pcm > >>> dev.pcm.2.%desc: Intel Kabylake (HDMI/DP 8ch) > >>> dev.pcm.1.bitperfect: 0 > >>> dev.pcm.1.buffersize: 65536 > >>> dev.pcm.1.play.vchanformat: s16le:2.0 > >>> dev.pcm.1.play.vchanrate: 48000 > >>> dev.pcm.1.play.vchanmode: fixed > >>> dev.pcm.1.play.vchans: 1 > >>> dev.pcm.1.play.32bit: 24 > >>> dev.pcm.1.%parent: hdaa0 > >>> dev.pcm.1.%pnpinfo: > >>> dev.pcm.1.%location: nid=33 > >>> dev.pcm.1.%driver: pcm > >>> dev.pcm.1.%desc: Realtek ALC256 (Front Analog Headphones) > >>> dev.pcm.0.bitperfect: 0 > >>> dev.pcm.0.buffersize: 65536 > >>> dev.pcm.0.rec.vchanformat: s16le:2.0 > >>> dev.pcm.0.rec.vchanrate: 48000 > >>> dev.pcm.0.rec.vchanmode: fixed > >>> dev.pcm.0.rec.vchans: 1 > >>> dev.pcm.0.rec.autosrc: 2 > >>> dev.pcm.0.rec.32bit: 24 > >>> dev.pcm.0.play.vchanformat: s16le:2.0 > >>> dev.pcm.0.play.vchanrate: 48000 > >>> dev.pcm.0.play.vchanmode: fixed > >>> dev.pcm.0.play.vchans: 2 > >>> dev.pcm.0.play.32bit: 24 > >>> dev.pcm.0.%parent: hdaa0 > >>> dev.pcm.0.%pnpinfo: > >>> dev.pcm.0.%location: nid=20,18 > >>> dev.pcm.0.%driver: pcm > >>> dev.pcm.0.%desc: Realtek ALC256 (Internal Analog) > >>> dev.pcm.%parent: > >> > >> You could try > >> > >> sysctl dev.hdaa.0.nid33_config="as=1 seq=15 device=Headphones" > >> > >> sysctl dev.hdaa.0.reconfig=1 > >> > >> > >> It should result in you having only one pcm device for the two outputs > >> and it should switch from > >> > >> internal to external when you plug in the external speakers and vice > versa. > >> > >> To make it permanent put 'hint.hdaa.0.nid33.config="as=1 seq=15 > >> device=Headphones"' in your loader.conf > >> > >> > >> The loud buzz is a bit worrying, it could be related to the problem I > >> have been having, where I got strange sound > >> > >> when using headphones on my laptop. I have worked around it by patching > >> the sound driver, I have kept my local > >> > >> patch for years. > >> > >> > > With that hint it does turn off the internal speakers but I can hear > > nothing in my headphones. Turning the volume to 100% I can hear the > > playback in my internal speakers at very low volume (with headphones > > connected). > > The headphones has no buzzing sound, that is only my external speakers > and > > they only act like that when connect to this laptop (kind of like the > buzz > > noise you get when the connector touches something (ground?))... > > > Do the headphones work with this patch? > > Index: sys/dev/sound/pci/hda/hdaa.c > =================================================================== > --- sys/dev/sound/pci/hda/hdaa.c (revision 339076) > +++ sys/dev/sound/pci/hda/hdaa.c (working copy) > @@ -5034,11 +5034,13 @@ > pincap = w->wclass.pin.cap; > > /* Disable everything. */ > + /* > w->wclass.pin.ctrl &= ~( > HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | > HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | > HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | > HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); > + */ > > if (w->enable == 0) { > /* Pin is unused so left it disabled. */ > > > YES!!!! With this patch and this in loader.conf hint.hdaa.0.nid33.config="as=1 seq=15 device=Headphones" I got it switching automatically between internal and headphones and no more buzzing sound in my external speakers when they are connected to the headphone jack.