linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@list.ru>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Lennart Poettering <lpoetter@redhat.com>,
	linux-media@vger.kernel.org,
	"Nickolay V. Shmyrev" <nshmyrev@yandex.ru>,
	Devin Heitmueller <dheitmueller@kernellabs.com>,
	ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: [patch][saa7134] do not change mute state for capturing audio
Date: Wed, 20 Jul 2011 09:28:57 +0400	[thread overview]
Message-ID: <4E266799.8030706@list.ru> (raw)
In-Reply-To: <4E262772.9060509@infradead.org>

20.07.2011 04:55, Mauro Carvalho Chehab wrote:
>> The proposed solution is to have the mute
>> control, that can be valid for all the cards/drivers.
>> Presumably, it should have the similar name
>> for all of them, even though for some it will be
>> a "virtual" control that will control several items,
>> and for others - it should map directly to their
>> single mute control.
>> If we have such a mute control, any app can use
>> it,
> Any app can do it right now via the V4L2 api.
I am just following your logic, you said that
---
Moving such logic to happen at userspace would be very complex, and will
break existing applications.
---
To solve that, I proposed adding such mixer control
to where it is missing right now.
But if this is no longer a problem and the app
can just use v4l2 for that instead, then what still
keeps us from removing the auto-unmute things?

>> and the auto-unmute logic can be removed
>> from the alsa driver. v4l2 is left as it is now.
> What is the sense of capturing data for a device that is not ready
> for stream?
This may be a PA's hack, or a user's mistake, or
whatever, but whatever it is, it shouldn't lead to
any sounds from speakers. Just starting the capture,
willingly or by mistake, should never lead to any
sound from speakers, IMO. So that's the bug too.
And the simpler one to fix.

>> So that's the proposal, what problems can you see
>> with it?
> Userspace application breakage is not allowed. A change like
> that will break the existing applications like mplayer.
No, because, as you said, it uses v4l2, not alsa,
to unmute.
And my proposal only affects alsa, so what's the
breakage?

> Maybe your device is not a saa7134. For saa7133/saa7135, the
> mute/unmute seems to be done via GPIO, and via amux.
Yes, and that's exacly why unmuting only I2S
does nothing: the muxes are still set up for mute.

>> IIRC the problem was that this does not mute the
>> sound input from the back panel of the board, which
>> would then still go to the pass-through wire in case
>> you are capturing. The only way do mute it, was to
>> configure muxes the way you can't capture at the
>> same time. But I may be wrong with the recollections.
> Well, the change seems to be simple, as we don't actually need to
> split the mute. We just need to control the I2S input/output at
> the alsa driver.
>
> The enclosed patch probably does the trick (completely untested).
I'll be able to test it on avertv 307 the next week-end.
But what is the expected effect of that patch?
It looks much like mine: mostly just removes auto-unmute,
doing that in a not-so-obvious way.
The card is muted by setting up the muxes.
Now you unmute it by enabling I2S, but the muxes
are still set to mute, so nothing happens, and you
will capture the silence.
I think this patch is _correct_, as it removes the
auto-unmute logic; exactly what I proposed. :)
Just a slightly different implementation, unless
I am missing something obvious...
By the way, do you need to do

saa7134_i2s_mute(dev, mute);

from mute_input_7134() ? Maybe leaving that I2S
control entirely for alsa, and not touching it elsewhere?
The function itself can probably then be moved to
saa7134-alsa.c.

Thanks!

  reply	other threads:[~2011-07-20  5:33 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 16:27 [patch][saa7134] do not change mute state for capturing audio Stas Sergeev
2011-07-13 20:53 ` Mauro Carvalho Chehab
2011-07-13 21:11   ` Stas Sergeev
2011-07-13 22:00     ` Mauro Carvalho Chehab
2011-07-14  5:39       ` Stas Sergeev
2011-07-15  1:38         ` Mauro Carvalho Chehab
2011-07-15  5:40           ` Stas Sergeev
2011-07-15  6:16           ` Stas Sergeev
2011-07-17  9:44           ` 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                   ` [alsa-devel] " 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 [this message]
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
2011-07-22  7:51                                               ` Stas Sergeev
2011-07-22 12:28                                                 ` Mauro Carvalho Chehab
2011-07-22 12:39                                                   ` Stas Sergeev
2011-07-22 12:49                                                     ` Mauro Carvalho Chehab
2011-07-22 12:56                                                       ` Stas Sergeev
2011-07-22 13:03                                                         ` Mauro Carvalho Chehab
2011-07-22 20:40                                                           ` Stas Sergeev
2011-07-23  1:28                                                             ` Mauro Carvalho Chehab
2011-07-23  7:44                                                               ` Stas Sergeev
2011-07-23 13:06                                                                 ` Mauro Carvalho Chehab
2011-07-23 13:20                                                                   ` Stas Sergeev
2011-07-23 15:09                                                                     ` Mauro Carvalho Chehab
2011-07-23 15:14                                                                       ` Stas Sergeev
2011-07-23 15:25                                                                       ` Stas Sergeev
2011-07-24 17:45                                                                       ` Stas Sergeev
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
2012-01-02 10:12                                                                                       ` [resend][patch][saa7134] fix automute " Stas Sergeev
2011-09-24 12:05                                                                             ` [patch][saa7134] do not change mute state " Mauro Carvalho Chehab
2011-09-24 12:33                                                                               ` Stas Sergeev
2011-09-24 12:46                                                                                 ` Mauro Carvalho Chehab

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=4E266799.8030706@list.ru \
    --to=stsp@list.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=dheitmueller@kernellabs.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lpoetter@redhat.com \
    --cc=mchehab@infradead.org \
    --cc=nshmyrev@yandex.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).