Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2449833imm; Sat, 29 Sep 2018 20:04:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV63WrcN3UBczUrcX3o68XpCT8cri4RgMTg1lT8kWlPB/nfM1GgPEGZ1Cb2nY63McupI1SDr5 X-Received: by 2002:a63:ea43:: with SMTP id l3-v6mr4862226pgk.427.1538276679632; Sat, 29 Sep 2018 20:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538276679; cv=none; d=google.com; s=arc-20160816; b=ft1XTOw36+1qOvo1PtMDQa4wEgtSSmd5eSpHCqPZlH1H5qMvP3yO8t0oQQ6yzLzJBV wbjZ1C2NA4JrJeNJIfSNGKj/6EhA5+mOB0qRHR8MNQO9niPSPrTrBVo2loNM5TaJUU4O xPHzIq8XQl20vAfkyF8XisSXt0Ybem2fWulbQnGpI+yiLtmIbjJL5Gjwe0tq9rckrs78 zHz/RdyPgH6vfUqfaEqlnQ8/3dI6GHYJjXbLsn2+aGp+J2HE+z7Vn1hm3Q3Ef7hmEnBL 01hXNrbe02wwR+J/vMs/zggvq5yN6J6HPpJcUdRHhxrCKm0pi+MyCPRQB+ptsVWoEgvU rBLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature; bh=dd7bKtioRklldvqESdgqIRuwzi9xeWLLoSY6BhHdesY=; b=CZ7IIagN5fr5rUUszbI3dzYuVI2i0mWxk75YLxfU1/JGVXWDaGhGKWgKJ5MyfS4FeI 6ucOqcPNNtXlqGfI/yxIxsSI9WL3lJdah6gj+XZu90y7l4zsPM3t6xEJRS60kkj7zTym +zZ3zwf+qTvXVV5PoRBaonwHGpG3lrnRP/PPeNvdo6Pw6PKEezBaruLmyE12Xbu0BIt1 7TaIhdJdcb3eacC4DhReaNXbB91TSo3Km49kYDiS3U1EdFNy4UjpNIUIz8X4kBq4lyqM fy4IQnZKL1p39mspalxwi8t4LP5QbHo4Q1hxH62HtrrO6Ax/Y3hv2MFTl7EiRhkbVidr DymQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZkMtvnuQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63-v6si8680549pld.62.2018.09.29.20.04.25; Sat, 29 Sep 2018 20:04:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZkMtvnuQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbeI3JfP (ORCPT + 99 others); Sun, 30 Sep 2018 05:35:15 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:35764 "EHLO mail-qt1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727472AbeI3JfO (ORCPT ); Sun, 30 Sep 2018 05:35:14 -0400 Received: by mail-qt1-f180.google.com with SMTP id z14-v6so10729516qtn.2 for ; Sat, 29 Sep 2018 20:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dd7bKtioRklldvqESdgqIRuwzi9xeWLLoSY6BhHdesY=; b=ZkMtvnuQEsytoiuIKwKsNNYEY20MGpOUj52Pa1yf1Xrv8vWunHYwkjSzwiQubjATrf eYTj8iAvEBDr/bhcTb3DFe51hBoi+TetDmAexC02z9b5EHRhEcRfPRRE5e5XZR8cd6+j Rp7hD1A/6GLXiLPkPGqm4j7Y3sQicXaPKuJ3oATV2M+tcgjAPNfTDetEawfGrHjQVZUm XWMZeQMJsjyncIjksQwSzHiqN7vxDqpGHSv69oldKbo1OJ1iwa+8Vrd5Qca6xREuMD7G D8uEWq/3XiqpqoOzkwBeJEbU+2t0ByTV55fHO/+4j9IDspACqbHeLfl2W9D+e/8ZspEv wUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dd7bKtioRklldvqESdgqIRuwzi9xeWLLoSY6BhHdesY=; b=oWbvXJPAenzfZbNQ1wr1zExO1CikXQKiP18/PbafuNTBNq7NhK3KEEL04PMP0awLFG Yo6eytDzsfBQtgafvuWifdXO+gnTO8ZGUt4OOTulnFScWvVhACaoJSJF9mtJpjZw9pBp 5QcQCR6KHxCNYB83i4h7H5KV8MKi0TtH47GcQkSHmbiEkIM85GFcbmRkxeQWq9RFC/X2 MEJrNHcqDBR001zBSR/zFTApwD0+RBAaBSwu720zQOI7A10uqTxMCixY/+wY/f1LLZhs eXJPC6PJIbo9XnnNWjuCnZnJ61EA9M9NMYX3MHBCh/yC7oBrM77xuvc+evjHBeOyDOou qmqg== X-Gm-Message-State: ABuFfoizAylVUQqpHBNxX2z8bV6IjeAU/O7TKTQxUcljZWI84r4aEVyZ ee1sRs9RejTcpbX+eTZjwqsnU+nR X-Received: by 2002:aed:2ce6:: with SMTP id g93-v6mr4252398qtd.288.1538276647484; Sat, 29 Sep 2018 20:04:07 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4273:6520:8440:55b8:a001]) by smtp.googlemail.com with ESMTPSA id p1-v6sm4782028qkg.82.2018.09.29.20.04.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Sep 2018 20:04:07 -0700 (PDT) From: Connor McAdams Cc: conmanx360@gmail.com, Jaroslav Kysela , Takashi Iwai , Takashi Sakamoto , Alastair Bridgewater , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/11] ALSA: hda/ca0132 - Fix surround sound with output effects Date: Sat, 29 Sep 2018 23:03:17 -0400 Message-Id: <1538276607-30234-3-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538276607-30234-1-git-send-email-conmanx360@gmail.com> References: <1538276607-30234-1-git-send-email-conmanx360@gmail.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes an issue where if surround sound was the selected output and output effects were enabled, the sound wasn't sent to all channels correctly. Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index aebc592..5a3fb56 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -4125,6 +4125,7 @@ static int ca0132_select_out(struct hda_codec *codec) } static int ae5_headphone_gain_set(struct hda_codec *codec, long val); +static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val); static void ae5_mmio_select_out(struct hda_codec *codec) { @@ -4365,12 +4366,19 @@ static int ca0132_alt_select_out(struct hda_codec *codec) snd_hda_set_pin_ctl(codec, spec->out_pins[3], pin_ctl | PIN_OUT); - if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) - dspio_set_uint_param(codec, 0x80, 0x04, FLOAT_ONE); - else - dspio_set_uint_param(codec, 0x80, 0x04, FLOAT_EIGHT); + dspio_set_uint_param(codec, 0x80, 0x04, FLOAT_EIGHT); break; } + /* + * Surround always sets it's scp command to req 0x04 to FLOAT_EIGHT. + * With this set though, X_BASS cannot be enabled. So, if we have OutFX + * enabled, we need to make sure X_BASS is off, otherwise everything + * sounds all muffled. Running ca0132_effects_set with X_BASS as the + * effect should sort this out. + */ + if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) + ca0132_effects_set(codec, X_BASS, + spec->effects_switch[X_BASS - EFFECT_START_NID]); /* run through the output dsp commands for the selected output. */ for (i = 0; i < alt_out_presets[spec->cur_out_type].commands; i++) { @@ -4409,7 +4417,6 @@ static void ca0132_unsol_hp_delayed(struct work_struct *work) static void ca0132_set_dmic(struct hda_codec *codec, int enable); static int ca0132_mic_boost_set(struct hda_codec *codec, long val); -static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val); static void resume_mic1(struct hda_codec *codec, unsigned int oldval); static int stop_mic1(struct hda_codec *codec); static int ca0132_cvoice_switch_set(struct hda_codec *codec); @@ -4787,6 +4794,8 @@ static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val) /* if PE if off, turn off out effects. */ if (!spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) val = 0; + if (spec->cur_out_type == SURROUND_OUT && nid == X_BASS) + val = 0; } /* for in effect, qualify with CrystalVoice */ -- 2.7.4