alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Stas Sergeev <stsp@list.ru>
Cc: "Nickolay V. Shmyrev" <nshmyrev@yandex.ru>,
	Lennart Poettering <lpoetter@redhat.com>,
	ALSA devel <alsa-devel@alsa-project.org>,
	linux-media@vger.kernel.org
Subject: Re: [patch][saa7134] do not change mute state for capturing audio
Date: Sat, 24 Sep 2011 09:46:29 -0300	[thread overview]
Message-ID: <4E7DD125.4070506@infradead.org> (raw)
In-Reply-To: <4E7DCE13.5030009@list.ru>

Em 24-09-2011 09:33, Stas Sergeev escreveu:
> 24.09.2011 16:05, Mauro Carvalho Chehab wrote:
>>
>> Better to post it as a separate patch, and to simplify the code with:
>>
>> diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
>> index 57e646b..a61ed1e 100644
>> --- a/drivers/media/video/saa7134/saa7134-tvaudio.c
>> +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
>> @@ -332,6 +332,12 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan)
>>   {
>>       __s32 left,right,value;
>>
>> +    if (!dev->tvnorm->id&  scan->std)) {
> Missing open bracket?

Yes. patch were of course not tested ;)

I meant to say:

	if (!(dev->tvnorm->id &  scan->std)) {


> 
>>> @@ -546,6 +546,7 @@ static int tvaudio_thread(void *data)
>>>                   dev->tvnorm->name, carrier/1000, carrier%1000,
>>>                   max1, max2);
>>>               dev->last_carrier = carrier;
>>> +            dev->automute = !(dev->thread.scan1>  1);
>> Why?
> Unfortunately, that's the trick. :(
> 
>>
>> If the carrier is good, this should be enough:
>>
>>             dev->automute = 0;
> Unfortunately, sometimes it misdetects.

There's nothing the driver can do if the hardware missdetects a carrier.
Dirty tricks to try solving it are not good, as they'll do the wrong
thing on some situations.

> Testing dev->thread.scan1 means that at least
> the first scan, done on the driver init, won't
> unmute.
> So either that, or this whole patch is unhelpful.
> I realize that this is a dirty hack, yes.

This is a dirty hack, and it assumes that the first scan
should be discarded. This is true only on certain environments.
If someone is using the board on an environment without udev and 
pulseaudio, this trick will break the first tuning.

>> The rest looked sane on my eyes, but I didn't double-checked it by running on my cards. Had you test calling it with just a single standard, and with a multiple standards mask? 
> With just a single standard. That's the problem too.
> There are the fallbacks, like last_carrier etc, and do we
> need to unmute there or not? :(
> 
>> The right fix that pulseaudio should not touch at the audio mixers for the video boards.
> That's where we disagree.
> I wonder what other people think.
> I don't see the compelling reason for making the
> alsa interface to the v4l devs a special case. If there
> is just a mute control exported, there is no more a special
> case, and no more hacks and problems.
> 
>> Not all boards have an audio carrier detection like saa7134.
> Having the mute control exported would make this
> not a problem.

Well, if you think that this would solve, then just write a patch
exporting the mute control via ALSA. I have no problems with that.

Regards,
Mauro.

      reply	other threads:[~2011-09-24 12:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E19D2F7.6060803@list.ru>
     [not found] ` <4E1E05AC.2070002@infradead.org>
     [not found]   ` <4E1E0A1D.6000604@list.ru>
     [not found]     ` <4E1E1571.6010400@infradead.org>
     [not found]       ` <4E1E8108.3060305@list.ru>
     [not found]         ` <4E1F9A25.1020208@infradead.org>
2011-07-17  9:44           ` [patch][saa7134] do not change mute state for capturing audio Stas Sergeev
2011-07-17 11:51             ` Mauro Carvalho Chehab
2011-07-17 12:24               ` Stas Sergeev
2011-07-18 23:16               ` Lennart Poettering
2011-07-19  6:31                 ` Stas Sergeev
2011-07-19 12:25                   ` Lennart Poettering
2011-07-19 13:00                 ` Mauro Carvalho Chehab
2011-07-19 13:13                   ` [alsa-devel] " Lennart Poettering
2011-07-19 13:49                   ` Stas Sergeev
2011-07-19 14:10                     ` Mauro Carvalho Chehab
2011-07-19 14:56                       ` Stas Sergeev
2011-07-19 15:27                         ` Mauro Carvalho Chehab
2011-07-19 15:50                           ` Stas Sergeev
2011-07-19 18:06                             ` Mauro Carvalho Chehab
2011-07-19 18:38                               ` Stas Sergeev
2011-07-19 19:29                                 ` Mauro Carvalho Chehab
2011-07-19 21:57                                   ` Stas Sergeev
2011-07-20  0:55                                     ` Mauro Carvalho Chehab
2011-07-20  5:28                                       ` Stas Sergeev
2011-07-20 10:32                                         ` Mauro Carvalho Chehab
2011-07-20 10:41                                           ` Mauro Carvalho Chehab
2011-07-20 10:45                                           ` Stas Sergeev
2011-07-20 10:48                                             ` Mauro Carvalho Chehab
2011-07-20 10:55                                               ` Stas Sergeev
     [not found]                                               ` <4E292BED.60108@list.ru>
     [not found]                                                 ` <4E296D00.9040608@infradead.org>
     [not found]                                                   ` <4E296F6C.9080107@list.ru>
     [not found]                                                     ` <4E2971D4.1060109@infradead.org>
     [not found]                                                       ` <4E29738F.7040605@list.ru>
     [not found]                                                         ` <4E297505.7090307@infradead.org>
     [not found]                                                           ` <4E29E02A.1020402@list.ru>
     [not found]                                                           ` <4E29E02A .1020402@list.ru>
     [not found]                                                             ` <4E2A23C7.3040209@infradead.org>
     [not found]                                                               ` <4E2A7BF0.8080606@list.ru>
     [not found]                                                                 ` <4E2AC742.8020407@infradead.org>
     [not found]                                                                   ` <4E2ACAAD.4050602@list.ru>
     [not found]                                                                     ` <4E2AE40F.7030108@infradead.org>
     [not found]                                                                       ` <4E2C5A35.9030404@list.ru>
     [not found]                                                                         ` <4E2C6638.2040707@infrade ad.org>
2011-07-24 18:36                                                                         ` Mauro Carvalho Chehab
2011-07-24 19:00                                                                           ` Stas Sergeev
2011-07-25 11:15                                                                           ` Stas Sergeev
2011-09-18 15:18                                                                           ` Stas Sergeev
2011-09-24 10:57                                                                             ` Mauro Carvalho Chehab
2011-09-24 11:12                                                                               ` Stas Sergeev
2011-09-24 12:12                                                                                 ` Mauro Carvalho Chehab
2011-09-24 12:36                                                                                   ` Stas Sergeev
2011-09-24 12:48                                                                                     ` Mauro Carvalho Chehab
2011-09-24 13:20                                                                                       ` Stas Sergeev
2011-09-24 15:09                                                                                         ` Mauro Carvalho Chehab
2011-09-24 15:51                                                                                           ` Stas Sergeev
2011-12-03 20:40                                                                                       ` Stas Sergeev
2011-09-24 12:05                                                                             ` Mauro Carvalho Chehab
2011-09-24 12:33                                                                               ` Stas Sergeev
2011-09-24 12:46                                                                                 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E7DD125.4070506@infradead.org \
    --to=mchehab@infradead.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lpoetter@redhat.com \
    --cc=nshmyrev@yandex.ru \
    --cc=stsp@list.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).