From owner-freebsd-questions@FreeBSD.ORG Tue Oct 30 09:26:54 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EADB22C for ; Tue, 30 Oct 2012 09:26:54 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id ABA7B8FC0A for ; Tue, 30 Oct 2012 09:26:53 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so64243lbd.13 for ; Tue, 30 Oct 2012 02:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=jLbalC8wKOBJrubsYZx5XrUsCjBse2b6qL6pPu0cHsY=; b=jfAAh7zi6XVPEeuZsIHW3LKJCor7/ptliMCSSvD31XkfN7CeiWp1zj7LZsVSivZ3N7 zGargggCU1YVPAiqK4ZF5PdlPbEHh9cuxQgXly11QT948f0DWy/z44xEcG4kFDyX+2om ypAPVfYF9VT8uPHbeF9rUVs+LkY13OjXYG5xRBpPB6OUjh2QDoUcVI9DRtnM0VQ1C4v2 dEYcWSUN09bcRrin5snL8/500S0fLATFg+Dazgj9520G4njxiqKC5czTqGLDIH/wNaFB iTAYC5NaDjmnBEMTGNZtbSW4WaWka/twYWe87FWyvX2DxY6bNghzTwXgczXVm0YOnrtc OUOw== Received: by 10.112.45.200 with SMTP id p8mr12875477lbm.27.1351589212205; Tue, 30 Oct 2012 02:26:52 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id jk8sm84547lab.7.2012.10.30.02.26.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 02:26:51 -0700 (PDT) Sender: Alexander Motin Message-ID: <508F9D57.7030004@FreeBSD.org> Date: Tue, 30 Oct 2012 11:26:47 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Big Yuuta Subject: Re: No sound from speaker, using Realtek ALC269 and snd_hda References: <508D8755.1080501@FreeBSD.org> <508D98C9.30603@FreeBSD.org> <508DA4D0.8040604@FreeBSD.org> <508EA9B0.2070501@FreeBSD.org> <508EB2F7.2000303@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 09:26:54 -0000 On 30.10.2012 09:17, Big Yuuta wrote: > Hi Alexander, > > I got the sound out of that speaker!! :) > > I actually started to read your code, and I'm still trying to understand > the stuff in it (I never wrote a device driver) > > Anyway, so I did a little hack'ish modification (just to test) in function > > hdaa_audio_ctl_amp_set_internal(struct hdaa_devinfo *devinfo, nid_t nid, > int index, int lmute, int rmute, > int left, int right, int dir) > { > uint16_t v = 0; > > // Do not mute, even if asked for. Test to be removed of course > lmute = 0; > rmute = 0; > > > I know, this is absolutely NOT the way to do it, but I wanted to see > if the speaker wasn't muted (or the mixer that controls it) > and it -actually- WAS muted! > > Now, I guess I'll have to read the whole code, try to understand its > internals, and I hope to be able to write a patch to add to hdaa_patches.c Speaker should be muted on headphones connection. That is one of two ways of handling playback redirection. But it should be unmuted on disconnection. You may try to set sysctl hw.snd.verbose=4 and connect/disconnect headphones. It should report which controls are affected and how. You may try this hack to use pin controls instead of muters for redirection: --- hdaa.c (revision 242315) +++ hdaa.c (working copy) @@ -260,7 +260,7 @@ /* (Un)Mute headphone pin. */ ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, -1, 1); - if (ctl != NULL && ctl->mute) { + if (ctl != NULL && ctl->mute && 0) { /* If pin has muter - use it. */ val = connected ? 0 : 1; if (val != ctl->forcemute) { @@ -290,7 +290,7 @@ hdaa_hpredir_handler(struct hdaa_widget *w) continue; ctl = hdaa_audio_ctl_amp_get(devinfo, as->pins[j], HDAA_CTL_IN, -1, 1); - if (ctl != NULL && ctl->mute) { + if (ctl != NULL && ctl->mute && 0) { /* If pin has muter - use it. */ val = connected ? 1 : 0; if (val == ctl->forcemute) -- Alexander Motin