[alsa-devel] [patch][saa7134] do not change mute state for capturing audio

Stas Sergeev stsp at list.ru
Sat Sep 24 14:33:23 CEST 2011


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?

>> @@ -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.
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.

> 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.


More information about the Alsa-devel mailing list