From patchwork Sun Jul 10 16:27:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stas Sergeev X-Patchwork-Id: 961542 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6AGdndS004731 for ; Sun, 10 Jul 2011 16:39:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755031Ab1GJQjr (ORCPT ); Sun, 10 Jul 2011 12:39:47 -0400 Received: from fallback2.mail.ru ([94.100.176.87]:48410 "EHLO fallback2.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754561Ab1GJQjr (ORCPT ); Sun, 10 Jul 2011 12:39:47 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 10 Jul 2011 16:39:49 +0000 (UTC) X-Greylist: delayed 449 seconds by postgrey-1.27 at vger.kernel.org; Sun, 10 Jul 2011 12:39:46 EDT Received: from smtp19.mail.ru (smtp19.mail.ru [94.100.176.156]) by fallback2.mail.ru (mPOP.Fallback_MX) with ESMTP id 33FAE6483980 for ; Sun, 10 Jul 2011 20:32:41 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Type:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=BdwlKJ9JOZpu5WrbMX3HC2T694SZKzE+whnxYyURlSM=; b=U7cH08FNl0idgsoK0UeuQs2XiowjVDQkzAgC0gQkCbWl2Szp20XDIAPL/Ewq5dqyiNQu+O/wcIpYQzvHUdbmyX5biPRVw+54AGhtaXqjUVEZnVLx5lUCucHgg+Iipybn; Received: from [91.77.38.218] (port=1607 helo=[91.77.38.218]) by smtp19.mail.ru with asmtp id 1QfwvY-0003Pg-00; Sun, 10 Jul 2011 20:32:16 +0400 Message-ID: <4E19D2F7.6060803@list.ru> Date: Sun, 10 Jul 2011 20:27:35 +0400 From: Stas Sergeev User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: linux-media@vger.kernel.org CC: "Nickolay V. Shmyrev" , Mauro Carvalho Chehab Subject: [patch][saa7134] do not change mute state for capturing audio X-Spam: Not detected X-Mras: Ok Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi. When pulseaudio enables the audio capturing, the driver unmutes the sound. But, if no app have properly tuned the tuner yet, you get the white noise. I think the capturing must not touch the mute state, because, without tuning the tuner first, you can't capture anything anyway. Without this patch I am getting the white noise on every xorg/pulseaudio startup, which made me to always think that pulseaudio is a joke and will soon be removed. :) Signed-off-by: Stas Sergeev diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 10460fd..d566468 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -77,7 +77,6 @@ typedef struct snd_card_saa7134 { unsigned long iobase; s16 irq; - u16 mute_was_on; spinlock_t lock; } snd_card_saa7134_t; @@ -715,13 +714,6 @@ static int snd_card_saa7134_hw_free(struct snd_pcm_substream * substream) static int snd_card_saa7134_capture_close(struct snd_pcm_substream * substream) { - snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev = saa7134->dev; - - if (saa7134->mute_was_on) { - dev->ctl_mute = 1; - saa7134_tvaudio_setmute(dev); - } return 0; } @@ -774,12 +766,6 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) runtime->private_free = snd_card_saa7134_runtime_free; runtime->hw = snd_card_saa7134_capture; - if (dev->ctl_mute != 0) { - saa7134->mute_was_on = 1; - dev->ctl_mute = 0; - saa7134_tvaudio_setmute(dev); - } - err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (err < 0)