All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mirza Krak <mirza.krak@gmail.com>
Cc: linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org,
	heiko@sntech.de
Subject: Re: Bad PCM stream after a suspend/resume cycle
Date: Fri, 12 Jan 2018 11:26:24 +0100	[thread overview]
Message-ID: <s5h7esnpe3z.wl-tiwai@suse.de> (raw)
In-Reply-To: <CALw8SCXUpeUv8433Rd9is6eNd9ztd6soEOoDMkVSLue6qT6wKg@mail.gmail.com>

On Thu, 11 Jan 2018 10:06:12 +0100,
Mirza Krak wrote:
> 
> Hi.
> 
> I have a quite simple problem really (simple test-case at least).
> 
> Following describes the test case:
> 
> $ aplay test.wav
> 
> # While the .wav is playing suspend the system
> $ systemctl suspend
> 
> # When system is resumed I get the following error on my aplay command
> aplay: pcm_write:2030: write error: File descriptor in bad state
> 
> I was expecting for the playback to resume.
> 
> I did some debugging using "aplay" and what I can see that happens
> before the EBADFD error is that the "writei_func()" returns a positive
> value once which results in a call to "snd_pcm_wait()" and on the next
> "writei_func()" call -EBADFD is returned.
> 
> I would expect a -ESTRPIPE error which should then result in that the
> PCM stream to be "resumed" (according to documentation at least). I
> have tried "forcing" a call to "suspend()" on the first write error in
> aplay after system is resumed and it actually works, kinda. The
> playback is resumed even-though the "snd_pcm_resume()" call returns an
> error.
> 
> I have not worked much with the sound subsystem before and I am having
> a hard time following all the call paths to see who/what is to blame
> for this behavior. Maybe it expected to work like this? And I do not
> know if this is only on my SoC or if this is a generic sound problem.

It's no generic issue but specific to platform / SoC driver
implementation.


Takashi

> Information about my system:
> 
> Using a RK3288 SoC (RK3288-FireFly board) with 4.14.13 Linux kernel
> (latest stable).
> 
> alsa-lib version 1.1.4.1
> 
> Playback using I2S
> 
> $ cat /proc/asound/cards
>  0 [I2S            ]: I2S - I2S
>                       I2S
> $ cat /proc/asound/card0/pcm0p/info
> card: 0
> device: 0
> subdevice: 0
> stream: PLAYBACK
> id: Audio es8328-hifi-analog-0
> name:
> subname: subdevice #0
> class: 0
> subclass: 0
> subdevices_count: 1
> subdevices_avail: 1
> 
> Let me know if there is additional information that I need to provide.
> 
> -- 
> Med Vänliga Hälsningar / Best Regards
> 
> Mirza Krak
> _______________________________________________
> 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

  reply	other threads:[~2018-01-12 10:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  9:06 Bad PCM stream after a suspend/resume cycle Mirza Krak
2018-01-12 10:26 ` Takashi Iwai [this message]
2018-01-12 13:36   ` Mirza Krak
2018-01-12 18:04     ` Takashi Iwai
2018-01-17 14:08       ` Mirza Krak
2018-01-17 15:05         ` Takashi Iwai
2018-01-18  8:49           ` Mirza Krak
2018-01-18  9:12             ` Takashi Iwai

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=s5h7esnpe3z.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=heiko@sntech.de \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mirza.krak@gmail.com \
    /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 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.