From: Raymond Yau <superquad.vortex2@gmail.com>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Re: "Resource temporarily unavailable" while reading although poll returns POLLIN event
Date: Sun, 25 Apr 2010 07:43:15 +0800 [thread overview]
Message-ID: <h2q4f3252891004241643j9ccd9315i9f8d6427752d471d@mail.gmail.com> (raw)
In-Reply-To: <4BD3025D.1060207@gmail.com>
2010/4/24 Stefan Schoenleitner <dev.c0debabe@gmail.com>
> Raymond Yau wrote:
> >>
> >>
> > Is it possible to post the output of your program when using your sound
> card
> > "hw" since your program failed with XRUN (broken pipe) on my two sound
> cards
> > ?
>
>
> Sure, no problem.
>
> However, I had to change 2 settings to get it working on my soundcard:
>
> * change period size from 160 to 320, as my soundcard does not support a
> period size of 160 frames
>
> * change buffer size from 2 periods (1280 bytes) to 1 period (640
> bytes), as my soundcard only supports a buffersize being equal to one
> period
>
>
> After that the program works fine and runs forever (see below).
>
> I'm looking forward to test it on my embedded target as well (with the
> original settings).
> If required I can post the output of that as well.
>
> cheers,
> stefan
>
>
> -------------------------------------------------------------------------------
> $ ./duplex hw
> could not sched_setscheduler: Operation not permitted
> PCM format is signed, linear, LE with 16 bits
> PCM rate 8000 - 48000 Hz
> PCM period size: 192 - 16384
> PCM buffer size: 640 - 640
> calculated buffer size: 640
> avail min: 320
> avail min after setup: 320
> start threshold: 320 frames
> stop threshold: 640 frames
> PCM format is signed, linear, LE with 16 bits
> PCM rate 4000 - 96000 Hz
> PCM period size: 32 - 32768
> PCM buffer size: 320 - 32640
> calculated buffer size: 640
> avail min: 320
> avail min after setup: 320
> start threshold: 320 frames
> stop threshold: 640 frames
> capture fds: 1, playback fds: 1
> capture poll fd: 4, playback poll fd: 5
> capture struct: fd: 4, events: POLLIN POLLERR , revents: 0
> playback struct: fd: 5, events: POLLOUT POLLERR , revents: 0
> capture avail min: 320
> playback avail min: 320
> snd_pcm_avail_update(capture): 0
> demangled poll: on capture device
> snd_pcm_avail_update(playback): 640
> demangled poll: POLLOUT on playback device
> wrote 320 frames
> snd_pcm_avail_update(capture): 0
> demangled poll: on capture device
> snd_pcm_avail_update(playback): 320
> demangled poll: POLLOUT on playback device
> wrote 320 frames
> snd_pcm_avail_update(capture): 320
> demangled poll: POLLIN on capture device
> read 320 frames
> hexdump(): 640 bytes
> 0000 fe ff fe ff fe ff fe ff ff ff fe ff fe ff ff ff
> 0010 fe ff ff ff ff ff ff ff fe ff fe ff fe ff ff ff
> 0020 ff ff fe ff fe ff ff ff ff ff ff ff ff ff ff ff
> 0030 ff ff fe ff fe ff ff ff ff ff fe ff ff ff fe ff
> 0040 fe ff fe ff fe ff ff ff ff ff fe ff fe ff ff ff
> 0050 ff ff ff ff fe ff fe ff fe ff ff ff ff ff fe ff
> 0060 fe ff ff ff ff ff fe ff fe ff ff ff ff ff fe ff
> 0070 ff ff fe ff fe ff ff ff fe ff fe ff ff ff fe ff
> 0080 fe ff ff ff ff ff ff ff fe ff fe ff fe ff ff ff
> 0090 ff ff fe ff ff ff ff ff fe ff fe ff ff ff fe ff
> 00a0 ff ff ff ff fe ff fe ff ff ff fe ff fe ff ff ff
> 00b0 ff ff fe ff fe ff ff ff ff ff ff ff ff ff ff ff
> 00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff fe ff
> 00d0 ff ff ff ff fe ff fe ff fe ff ff ff ff ff fe ff
> 00e0 fe ff fe ff ff ff ff ff fe ff fe ff ff ff fe ff
> 00f0 ff ff ff ff ff ff ff ff ff ff fe ff ff ff ff ff
> 0100 fe ff fe ff fe ff fe ff fe ff ff ff ff ff fe ff
> 0110 ff ff ff ff fe ff fe ff ff ff ff ff fe ff fe ff
> 0120 ff ff ff ff fe ff fe ff ff ff ff ff fe ff fe ff
> 0130 fe ff ff ff fe ff ff ff fe ff fe ff fe ff fe ff
> 0140 ff ff fe ff fe ff ff ff ff ff fe ff fe ff ff ff
> 0150 fe ff fe ff fe ff fe ff ff ff fe ff ff ff ff ff
> 0160 fe ff fe ff ff ff fe ff fe ff ff ff ff ff fe ff
> 0170 ff ff ff ff ff ff ff ff fe ff ff ff ff ff fe ff
> 0180 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0190 ff ff fe ff fe ff ff ff ff ff ff ff ff ff ff ff
> 01a0 ff ff ff ff fe ff fe ff fe ff ff ff ff ff fe ff
> 01b0 fe ff fe ff ff ff fe ff fe ff ff ff ff ff ff ff
> 01c0 ff ff ff ff ff ff ff ff ff ff ff ff fe ff fe ff
> 01d0 fe ff fe ff fe ff ff ff ff ff fe ff fe ff fe ff
> 01e0 fe ff ff ff ff ff ff ff fe ff fe ff ff ff ff ff
> 01f0 fe ff fe ff ff ff ff ff ff ff ff ff ff ff fe ff
> 0200 fe ff ff ff ff ff ff ff ff ff ff ff ff ff fe ff
> 0210 ff ff ff ff fe ff fe ff ff ff ff ff ff ff ff ff
> 0220 ff ff fe ff fe ff ff ff ff ff ff ff fe ff ff ff
> 0230 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff
> 0240 ff ff ff ff ff ff ff ff ff ff fe ff fe ff ff ff
> 0250 ff ff fe ff ff ff ff ff ff ff ff ff ff ff fe ff
> 0260 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0270 fe ff ff ff ff ff fe ff fe ff ff ff ff ff ff ff
>
> snd_pcm_avail_update(playback): 320
> demangled poll: on playback device
> snd_pcm_avail_update(capture): 0
> demangled poll: on capture device
> snd_pcm_avail_update(playback): 320
> demangled poll: POLLOUT on playback device
> wrote 320 frames
> snd_pcm_avail_update(capture): 320
> demangled poll: POLLIN on capture device
> read 320 frames
> hexdump(): 640 bytes
> 0000 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff
> 0010 fe ff fe ff ff ff ff ff fe ff ff ff ff ff ff ff
> 0020 ff ff ff ff fe ff ff ff ff ff fe ff ff ff ff ff
> 0030 fe ff fe ff ff ff fe ff fe ff ff ff ff ff fe ff
> 0040 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0060 ff ff fe ff fe ff ff ff ff ff ff ff ff ff ff ff
> 0070 ff ff fe ff fe ff fe ff ff ff ff ff ff ff fe ff
> 0080 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0090 ff ff ff ff ff ff ff ff fe ff fe ff ff ff fe ff
> 00a0 ff ff fe ff fe ff ff ff ff ff ff ff ff ff fe ff
> 00b0 fe ff fe ff fe ff fe ff fe ff fe ff ff ff ff ff
> 00c0 ff ff ff ff ff ff fe ff ff ff ff ff ff ff fe ff
> 00d0 fe ff ff ff fe ff fe ff ff ff ff ff fe ff fe ff
> 00e0 fe ff ff ff fe ff fe ff ff ff ff ff ff ff ff ff
> 00f0 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff
> 0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0110 ff ff ff ff fe ff ff ff ff ff ff ff ff ff fe ff
> 0120 ff ff ff ff fe ff ff ff ff ff fe ff fe ff ff ff
> 0130 ff ff ff ff ff ff ff ff ff ff fe ff fe ff ff ff
> 0140 fe ff ff ff ff ff fe ff ff ff ff ff fe ff fe ff
> 0150 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0160 ff ff ff ff ff ff fe ff fe ff fe ff ff ff ff ff
> 0170 ff ff ff ff ff ff ff ff ff ff ff ff fe ff fe ff
> 0180 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0190 ff ff ff ff ff ff ff ff ff ff fe ff fe ff ff ff
> 01a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 01b0 ff ff ff ff ff ff ff ff fe ff fe ff ff ff ff ff
> 01c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff fe ff
> 01d0 ff ff ff ff ff ff ff ff fe ff ff ff ff ff ff ff
> 01e0 ff ff fe ff fe ff ff ff ff ff ff ff ff ff ff ff
> 01f0 ff ff ff ff ff ff fe ff fe ff fe ff fe ff fe ff
> 0200 fe ff fe ff fe ff ff ff fe ff ff ff ff ff fe ff
> 0210 fe ff ff ff ff ff ff ff ff ff ff ff fe ff fe ff
> 0220 ff ff ff ff ff ff ff ff ff ff fe ff ff ff ff ff
> 0230 ff ff ff ff ff ff ff ff ff ff ff ff fe ff fe ff
> 0240 fe ff ff ff ff ff ff ff ff ff ff ff ff ff fe ff
> 0250 fe ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0260 fe ff ff ff ff ff ff ff fe ff ff ff ff ff ff ff
> 0270 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff
>
>
How about the qualtity of the playback ?
did you speak to the mic and hear the result ?
Refer to your pulseaudio log , PA use "front" device for playback/capture
but your test use "hw"
D: alsa-util.c: Trying front:0 with SND_PCM_NO_AUTO_FORMAT ...
I: module-alsa-source.c: Successfully opened device front:0.
I: module-alsa-source.c: Successfully enabled mmap() mode.
I: (alsa-lib)control.c: Invalid CTL front:0
I: alsa-util.c: Unable to attach to mixer front:0: No such file or directory
I: alsa-util.c: Successfully attached to mixer 'hw:0'
I: alsa-util.c: Cannot find mixer control "Capture" or mixer control is
no combination of switch/volume.
I: alsa-util.c: Using mixer control "Mic"
...
sink_name=alsa_output.pci_
1102_4_sound_card_0_alsa_playback_0 tsched=0'
D: alsa-util.c: Trying front:0 with SND_PCM_NO_AUTO_FORMAT ...
I: (alsa-lib)setup.c: Cannot lock ctl elem
D: alsa-util.c: Trying front:0 without SND_PCM_NO_AUTO_FORMAT ...
I: (alsa-lib)setup.c: Cannot lock ctl elem
D: alsa-util.c: Trying plug:front:0 with SND_PCM_NO_AUTO_FORMAT ...
I: (alsa-lib)setup.c: Cannot lock ctl elem
D: alsa-util.c: Trying plug:front:0 without SND_PCM_NO_AUTO_FORMAT ...
I: (alsa-lib)setup.c: Cannot lock ctl elem
I: alsa-util.c: PCM device plug:front:0 refused our hw parameters:
Device or resource busy
...
D: alsa-util.c: Trying hw:0 as last resort...
D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ...
I: module-alsa-sink.c: Successfully opened device hw:0.
I: module-alsa-sink.c: Successfully enabled mmap() mode.
I: alsa-util.c: Successfully attached to mixer 'hw:0'
I: alsa-util.c: Cannot find mixer control "Master" or mixer control is
no combination of switch/volume.
W: alsa-util.c: Cannot find fallback mixer control "PCM" or mixer
control is no combination of switch/volume.
I: alsa-util.c: Using mixer control "PCM".
Do you mean that you suspect the problem is related to alsa-pulse plugin or
PA server ?
next prev parent reply other threads:[~2010-04-24 23:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 11:28 "Resource temporarily unavailable" while reading although poll returns POLLIN event Stefan Schoenleitner
2010-04-21 16:15 ` Stefan Schoenleitner
2010-04-21 17:18 ` Jaroslav Kysela
2010-04-22 10:09 ` Stefan Schoenleitner
2010-04-23 4:10 ` Raymond Yau
2010-04-24 1:32 ` Raymond Yau
2010-04-24 14:38 ` Stefan Schoenleitner
2010-04-24 23:43 ` Raymond Yau [this message]
2010-04-26 7:52 ` Stefan Schoenleitner
2010-04-27 0:35 ` Raymond Yau
2010-04-26 1:46 ` Raymond Yau
2010-04-26 8:19 ` Stefan Schoenleitner
2010-04-26 11:10 ` Raymond Yau
2010-04-22 4:28 ` Raymond Yau
2010-04-22 10:49 ` Stefan Schoenleitner
2010-04-23 7:45 ` Raymond Yau
2010-04-23 11:16 ` Stefan Schoenleitner
2010-04-22 2:41 ` Raymond Yau
2010-04-22 10:15 ` Stefan Schoenleitner
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=h2q4f3252891004241643j9ccd9315i9f8d6427752d471d@mail.gmail.com \
--to=superquad.vortex2@gmail.com \
--cc=alsa-devel@alsa-project.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).