All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mirza Krak <mirza.krak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
	tiwai-IBi9RG/b67k@public.gmane.org,
	perex-/Fr2/VpizcU@public.gmane.org
Subject: Bad PCM stream after a suspend/resume cycle
Date: Thu, 11 Jan 2018 10:06:12 +0100	[thread overview]
Message-ID: <CALw8SCXUpeUv8433Rd9is6eNd9ztd6soEOoDMkVSLue6qT6wKg@mail.gmail.com> (raw)

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.

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

             reply	other threads:[~2018-01-11  9:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  9:06 Mirza Krak [this message]
2018-01-12 10:26 ` Bad PCM stream after a suspend/resume cycle Takashi Iwai
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=CALw8SCXUpeUv8433Rd9is6eNd9ztd6soEOoDMkVSLue6qT6wKg@mail.gmail.com \
    --to=mirza.krak-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=perex-/Fr2/VpizcU@public.gmane.org \
    --cc=tiwai-IBi9RG/b67k@public.gmane.org \
    /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.