Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462681 > unrolled thread

ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

Started bywens Tsai <wens213@gmail.com>
First post2016-08-15 11:50 +0200
Last post2016-08-22 12:50 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled wens Tsai <wens213@gmail.com> - 2016-08-15 11:50 +0200
    Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths  all disabled Mark Brown <broonie@kernel.org> - 2016-08-15 13:50 +0200
      Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths  all disabled wens Tsai <wens213@gmail.com> - 2016-08-16 06:50 +0200
        Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths  all disabled Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-08-22 11:20 +0200
          Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths  all disabled Mark Brown <broonie@kernel.org> - 2016-08-22 12:50 +0200

#1462681 — ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

Fromwens Tsai <wens213@gmail.com>
Date2016-08-15 11:50 +0200
SubjectASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled
Message-ID<s6mGR-3T5-17@gated-at.bofh.it>
Hi everyone,

In the sun4i-codec driver, we control the DAC digital enable bits with a
supply widget, which in turn supplies the DAC source widgets. DAPM will
disable the supply if there are no usable playback paths. And it just so
happens that the default value for various playback switches is the off
setting.

Any user getting codec support for the first time has to enable a proper
playback path before getting sound out of the hardware. This is expected.

What is unexpected is any attempt to play anything under this state makes
the playback software (in my case mpg321) stall, and later report an I/O
error. My guess is that the DAC is still disabled by DAPM, so it doesn't
send any DRQs, and thus the DMA engine is not consuming any data from
userspace.

I think we should just enable the digital bits of the DAC/ADC all the
time. Or maybe transfer and then discard data if the DAC is off. Not
sure if this is doable though. I expect playback software to work, and
not block, regardless of the hardware status.

Any thoughts on this? sun4i-codec seems to be one of the rarer kinds of
hardware where the DAC is directly tied to the system bus, without an I2S
interface in between. And I don't see any DAI drivers using DAPM.


Regards
ChenYu

[toc] | [next] | [standalone]


#1462726 — Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

FromMark Brown <broonie@kernel.org>
Date2016-08-15 13:50 +0200
SubjectRe: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled
Message-ID<s6oz0-537-9@gated-at.bofh.it>
In reply to#1462681

[Multipart message — attachments visible in raw view] — view raw

On Mon, Aug 15, 2016 at 05:43:55PM +0800, wens Tsai wrote:

> What is unexpected is any attempt to play anything under this state makes
> the playback software (in my case mpg321) stall, and later report an I/O
> error. My guess is that the DAC is still disabled by DAPM, so it doesn't
> send any DRQs, and thus the DMA engine is not consuming any data from
> userspace.

This is normal for ASoC - like you say it'll be becasue the hardware
isn't powered up.

> I think we should just enable the digital bits of the DAC/ADC all the
> time. Or maybe transfer and then discard data if the DAC is off. Not
> sure if this is doable though. I expect playback software to work, and
> not block, regardless of the hardware status.

Powering things up all the time will have a major effect on battery life
for systems that care about that.  The expectation is that systems with
this sort of hardware won't normally be offering end users direct
control of the routing, it'll be something that's handled during system
integration.

[toc] | [prev] | [next] | [standalone]


#1463397 — Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

Fromwens Tsai <wens213@gmail.com>
Date2016-08-16 06:50 +0200
SubjectRe: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled
Message-ID<s6Eu5-6Tr-5@gated-at.bofh.it>
In reply to#1462726
On Mon, Aug 15, 2016 at 7:42 PM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Aug 15, 2016 at 05:43:55PM +0800, wens Tsai wrote:
>
>> What is unexpected is any attempt to play anything under this state makes
>> the playback software (in my case mpg321) stall, and later report an I/O
>> error. My guess is that the DAC is still disabled by DAPM, so it doesn't
>> send any DRQs, and thus the DMA engine is not consuming any data from
>> userspace.
>
> This is normal for ASoC - like you say it'll be becasue the hardware
> isn't powered up.
>
>> I think we should just enable the digital bits of the DAC/ADC all the
>> time. Or maybe transfer and then discard data if the DAC is off. Not
>> sure if this is doable though. I expect playback software to work, and
>> not block, regardless of the hardware status.
>
> Powering things up all the time will have a major effect on battery life
> for systems that care about that.  The expectation is that systems with
> this sort of hardware won't normally be offering end users direct
> control of the routing, it'll be something that's handled during system
> integration.

Ok. So I guess one solution would be to move the mute controls out of
DAPM, and maybe change some other mux like paths into actual muxes, so
there's at least one usable path at all times.

IIRC there was a patch doing something like this. I'll look into it.

Regards
ChenYu

[toc] | [prev] | [next] | [standalone]


#1467490 — Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-08-22 11:20 +0200
SubjectRe: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled
Message-ID<s8TyF-4oi-1@gated-at.bofh.it>
In reply to#1463397

[Multipart message — attachments visible in raw view] — view raw

On Tue, Aug 16, 2016 at 12:45:39PM +0800, wens Tsai wrote:
> On Mon, Aug 15, 2016 at 7:42 PM, Mark Brown <broonie@kernel.org> wrote:
> > On Mon, Aug 15, 2016 at 05:43:55PM +0800, wens Tsai wrote:
> >
> >> What is unexpected is any attempt to play anything under this state makes
> >> the playback software (in my case mpg321) stall, and later report an I/O
> >> error. My guess is that the DAC is still disabled by DAPM, so it doesn't
> >> send any DRQs, and thus the DMA engine is not consuming any data from
> >> userspace.
> >
> > This is normal for ASoC - like you say it'll be becasue the hardware
> > isn't powered up.
> >
> >> I think we should just enable the digital bits of the DAC/ADC all the
> >> time. Or maybe transfer and then discard data if the DAC is off. Not
> >> sure if this is doable though. I expect playback software to work, and
> >> not block, regardless of the hardware status.
> >
> > Powering things up all the time will have a major effect on battery life
> > for systems that care about that.  The expectation is that systems with
> > this sort of hardware won't normally be offering end users direct
> > control of the routing, it'll be something that's handled during system
> > integration.
> 
> Ok. So I guess one solution would be to move the mute controls out of
> DAPM, and maybe change some other mux like paths into actual muxes, so
> there's at least one usable path at all times.

I'm not sure that's even a requirement. IIRC, but Mark might correct
me, you just need to expose whatever the reset state is.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1467541 — Re: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled

FromMark Brown <broonie@kernel.org>
Date2016-08-22 12:50 +0200
SubjectRe: ASoC: sun4i-codec: playback stall and I/O error with DAPM paths all disabled
Message-ID<s8UXL-5aa-13@gated-at.bofh.it>
In reply to#1467490

[Multipart message — attachments visible in raw view] — view raw

On Mon, Aug 22, 2016 at 11:18:15AM +0200, Maxime Ripard wrote:
> On Tue, Aug 16, 2016 at 12:45:39PM +0800, wens Tsai wrote:

> > Ok. So I guess one solution would be to move the mute controls out of
> > DAPM, and maybe change some other mux like paths into actual muxes, so
> > there's at least one usable path at all times.

> I'm not sure that's even a requirement. IIRC, but Mark might correct
> me, you just need to expose whatever the reset state is.

Yes, this results in some inconvenience but avoids problems caused by
configuration changes for one board affecting another adversely - if we
just go with the hardware defaults it's something fixed externally.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web