All of lore.kernel.org
 help / color / mirror / Atom feed
* amp power down event (resend with the correct email)
@ 2010-08-09 18:05 Michael Trimarchi
  2010-08-10  7:08 ` Fixed " Michael Trimarchi
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael Trimarchi @ 2010-08-09 18:05 UTC (permalink / raw)
  To: alsa-devel

Hi all,

I'm t rying to unde rstand when the event a re called.

...
SND_SOC_DAPM_SPK("Front Speaker", amp_event),
...

My idea was:

- set the mixe r
- open st ream

amp_event: event =>
[  169.820558] ON

- close st ream

and receive the event => OFF. In the aplay example this happen
afte r some seconds but in my application I don't receive the OFF
event. What is w rong?

Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Fixed Re: amp power down event (resend with the correct email)
  2010-08-09 18:05 amp power down event (resend with the correct email) Michael Trimarchi
@ 2010-08-10  7:08 ` Michael Trimarchi
  2010-08-10  7:13   ` Michael Trimarchi
  2010-08-10 10:31 ` Mark Brown
  2010-08-10 10:42 ` Peter Ujfalusi
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2010-08-10  7:08 UTC (permalink / raw)
  To: alsa-devel

Hi all

Michael Trimarchi wrote:
> Hi all,
>
> I'm t rying to unde rstand when the event a re called.
>
> ...
> SND_SOC_DAPM_SPK("Front Speaker", amp_event),
>   
I have fixed looking in the kernel code. Change this to:

SND_SOC_DAPM_PRE("Front Speaker", amp_event),

Is it correct?

Michael
> ...
>
> My idea was:
>
> - set the mixe r
> - open st ream
>
> amp_event: event =>
> [  169.820558] ON
>
> - close st ream
>
> and receive the event => OFF. In the aplay example this happen
> afte r some seconds but in my application I don't receive the OFF
> event. What is w rong?
>
> Michael
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>   

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Fixed Re: amp power down event (resend with the correct email)
  2010-08-10  7:08 ` Fixed " Michael Trimarchi
@ 2010-08-10  7:13   ` Michael Trimarchi
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Trimarchi @ 2010-08-10  7:13 UTC (permalink / raw)
  To: alsa-devel


Michael Trimarchi wrote:
> Hi all
>
> Michael Trimarchi wrote:
>   
>> Hi all,
>>
>> I'm t rying to unde rstand when the event a re called.
>>
>> ...
>> SND_SOC_DAPM_SPK("Front Speaker", amp_event),
>>   
>>     
> I have fixed looking in the kernel code. Change this to:
>
> SND_SOC_DAPM_PRE("Front Speaker", amp_event),
>
> Is it correct?
>   
So now:

[  400.894580] widget Right Voice ADC
[  400.894592]  Right Voice Capture stream HiFi Playback event 2
[  400.903667] widget Left Voice ADC
[  400.903673]  Left Voice Capture stream HiFi Playback event 2
[  400.912593] widget Right HiFi ADC
[  400.912599]  Right HiFi Capture stream HiFi Playback event 2
[  400.921514] widget Left HiFi ADC
[  400.921520]  Left HiFi Capture stream HiFi Playback event 2
[  400.930282] widget Aux DAC
[  400.930288]  Aux Playback stream HiFi Playback event 2
[  400.938081] widget Voice DAC
[  400.938087]  Voice Playback stream HiFi Playback event 2
[  400.946232] widget Right DAC
[  400.946237]  Right HiFi Playback stream HiFi Playback event 2
[  400.954813] widget Left DAC
[  400.954819]  Left HiFi Playback stream HiFi Playback event 2
[  400.963617] amp_event: event =>
[  400.966604] OFF

when the stream is closed.

Michael
> Michael
>   
>> ...
>>
>> My idea was:
>>
>> - set the mixe r
>> - open st ream
>>
>> amp_event: event =>
>> [  169.820558] ON
>>
>> - close st ream
>>
>> and receive the event => OFF. In the aplay example this happen
>> afte r some seconds but in my application I don't receive the OFF
>> event. What is w rong?
>>
>> Michael
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>>   
>>     
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>   

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-09 18:05 amp power down event (resend with the correct email) Michael Trimarchi
  2010-08-10  7:08 ` Fixed " Michael Trimarchi
@ 2010-08-10 10:31 ` Mark Brown
  2010-08-10 10:56   ` Michael Trimarchi
  2010-08-10 10:42 ` Peter Ujfalusi
  2 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2010-08-10 10:31 UTC (permalink / raw)
  To: Michael Trimarchi; +Cc: alsa-devel

On Mon, Aug 09, 2010 at 08:05:53PM +0200, Michael Trimarchi wrote:

> I'm t rying to unde rstand when the event a re called.

As I believe I have reminded you on a number of occasions you should
always CC the maintainers on Linux kernel queries.

> and receive the event => OFF. In the aplay example this happen
> afte r some seconds but in my application I don't receive the OFF
> event. What is w rong?

Your application will have left audio going to the speaker.  This will
either be a running playback or an analogue path.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-09 18:05 amp power down event (resend with the correct email) Michael Trimarchi
  2010-08-10  7:08 ` Fixed " Michael Trimarchi
  2010-08-10 10:31 ` Mark Brown
@ 2010-08-10 10:42 ` Peter Ujfalusi
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2010-08-10 10:42 UTC (permalink / raw)
  To: alsa-devel; +Cc: ext Michael Trimarchi

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1373 bytes --]

Hi,

it is a good practice to CC the maintainers to get the attention (in this case 
Liam and Mark)..

On Monday 09 August 2010 21:05:53 ext Michael Trimarchi wrote:
> Hi all,
> 
> I'm t rying to unde rstand when the event a re called.
> 
> ...
> SND_SOC_DAPM_SPK("Front Speaker", amp_event),
> ...

This is turned on or off by the DAPM power sequences.
Take a look at the sound/soc/soc-dapm.c, and at the beginning of the file, you 
can see the on and off sequences.
Generally:
The DAPM_SPK widget will be powered on last, and powered down first, or early to 
avoid the pop coming from other widget powering.

> 
> My idea was:
> 
> - set the mixe r
> - open st ream
> 
> amp_event: event =>
> [  169.820558] ON
> 
> - close st ream
> 
> and receive the event => OFF. In the aplay example this happen
> afte r some seconds but in my application I don't receive the OFF
> event. What is w rong?

What do you mean? User space will not receive such an event, this is ASoC 
internal (specifically DAPM doing it's thing).
The some seconds you see is most likely 5 seconds, which is the soc delay for 
going lower power state after the stream has been stopped, or the loopback is 
closed.

> 
> Michael
> 

-- 
P¨¦ter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-10 10:31 ` Mark Brown
@ 2010-08-10 10:56   ` Michael Trimarchi
  2010-08-10 11:53     ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2010-08-10 10:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, peter.ujfalusi

Hi,

Mark Brown wrote:
> On Mon, Aug 09, 2010 at 08:05:53PM +0200, Michael Trimarchi wrote:
>
>   
>> I'm t rying to unde rstand when the event a re called.
>>     
>
> As I believe I have reminded you on a number of occasions you should
> always CC the maintainers on Linux kernel queries.
>
>   
>> and receive the event => OFF. In the aplay example this happen
>> afte r some seconds but in my application I don't receive the OFF
>> event. What is w rong?
>>     
>
> Your application will have left audio going to the speaker.  This will
> either be a running playback or an analogue path.
>   
I have fixed change to SND_SOC_DAPM_PRE("Front Speaker", amp_event),

so when the stream is closed the amp is deactivated using the event 2

[  400.946232] widget Right DAC
[  400.946237]  Right HiFi Playback stream HiFi Playback event 2
[  400.954813] widget Left DAC
[  400.954819]  Left HiFi Playback stream HiFi Playback event 2
[  400.963617] amp_event: event =>
[  400.966604] OFF

This is ok if the user implements the standby closing the out channel.

Michael Trimarchi


> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>   

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-10 10:56   ` Michael Trimarchi
@ 2010-08-10 11:53     ` Mark Brown
  2010-08-10 12:09       ` Michael Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2010-08-10 11:53 UTC (permalink / raw)
  To: Michael Trimarchi; +Cc: alsa-devel, peter.ujfalusi

On Tue, Aug 10, 2010 at 12:56:51PM +0200, Michael Trimarchi wrote:
> Mark Brown wrote:

> I have fixed change to SND_SOC_DAPM_PRE("Front Speaker", amp_event),

This is not a good fix, you've totally misunderstood what that widget
does and it won't be sequenced in the expected fashion.  You should use
a speaker widget for a speaker.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-10 11:53     ` Mark Brown
@ 2010-08-10 12:09       ` Michael Trimarchi
  2010-08-10 12:20         ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2010-08-10 12:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, peter.ujfalusi

Mark Brown wrote:
> On Tue, Aug 10, 2010 at 12:56:51PM +0200, Michael Trimarchi wrote:
>   
>> Mark Brown wrote:
>>     
>
>   
>> I have fixed change to SND_SOC_DAPM_PRE("Front Speaker", amp_event),
>>     
>
> This is not a good fix, you've totally misunderstood what that widget
> does and it won't be sequenced in the expected fashion.  You should use
> a speaker widget for a speaker.
>   
Ok, I will fix

When the amp_event is supposed to be called in the speaker widget? After the
stream is closed?

Michael
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>   

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: amp power down event (resend with the correct email)
  2010-08-10 12:09       ` Michael Trimarchi
@ 2010-08-10 12:20         ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-08-10 12:20 UTC (permalink / raw)
  To: Michael Trimarchi; +Cc: alsa-devel, peter.ujfalusi

On Tue, Aug 10, 2010 at 02:09:27PM +0200, Michael Trimarchi wrote:

> When the amp_event is supposed to be called in the speaker widget? After the
> stream is closed?

It will be called when the speaker is powered down.  For DAC to speaker
paths this will be five seconds after playback stops in the default
configuration.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-10 12:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 18:05 amp power down event (resend with the correct email) Michael Trimarchi
2010-08-10  7:08 ` Fixed " Michael Trimarchi
2010-08-10  7:13   ` Michael Trimarchi
2010-08-10 10:31 ` Mark Brown
2010-08-10 10:56   ` Michael Trimarchi
2010-08-10 11:53     ` Mark Brown
2010-08-10 12:09       ` Michael Trimarchi
2010-08-10 12:20         ` Mark Brown
2010-08-10 10:42 ` Peter Ujfalusi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.