Skip to contentSkip to conversation

amp power down event (resend with the correct email)

DISCUSSION Michael Trimarchi 3 participants 9 messages Aug 9, 2010 – Aug 10, 2010

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

Fixed Re: amp power down event (resend with the correct email)

Hi all

Quoted 7 lines · Michael Trimarchi

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

Quoted 24 lines

...

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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw

Re: Fixed Re: amp power down event (resend with the correct email)

Quoted 12 lines · Michael Trimarchi

Hi all

Quoted 8 lines · Michael Trimarchi

Hi all,

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

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

Quoted 6 lines

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

Quoted 34 lines

Michael

Quoted 16 lines

...

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?

Quoted 9 lines

Michael

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
In reply to Michael Trimarchi
Quoted 1 line · Michael Trimarchi

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.

Quoted 3 lines

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.

#8 lore raw
In reply to Michael Trimarchi

Hi,

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

Quoted 7 lines · 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.

Quoted 6 lines

My idea was:

- set the mixe r
- open st ream

Quoted 8 lines

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.

Quoted 3 lines

Michael

Signature · 5 lines
Péter
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#4 lore raw
In reply to Mark Brown

Hi,

Quoted 10 lines · Mark Brown
Quoted 2 lines · Michael Trimarchi

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.

Quoted 8 lines
Quoted 4 lines

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

Quoted 6 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#5 lore raw
Quoted 3 lines · Michael Trimarchi

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.

#6 lore raw
Quoted 6 lines · Mark Brown
Quoted 2 lines · Michael Trimarchi

Mark Brown wrote:

Quoted 7 lines
Quoted 2 lines

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

Quoted 6 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw
Quoted 2 lines · Michael Trimarchi

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.