[pulseaudio-discuss] arecord does not work with pulse audio: I/O error
Keedi Kim
keedi.k at gmail.com
Thu Oct 16 22:08:21 PDT 2008
Thanks for reply.
System Information is:
OS: Ubuntu 8.10
Kernel: 2.6.27-7-generic #1 SMP
libasound2: 1.0.17a (1.0.17a-0ubuntu4)
libasound2-plugins: 1.0.17 (1.0.17-0ubuntu4)
pulseaudio: 0.9.10 (0.9.10-2ubuntu8)
installed pulseaudio packages:
> $ dpkg --get-selections | grep pulseaudio
> gstreamer0.10-pulseaudio install
> pulseaudio install
> pulseaudio-esound-compat install
> pulseaudio-module-gconf install
> pulseaudio-module-hal install
> pulseaudio-module-x11 install
> pulseaudio-module-zeroconf install
> pulseaudio-utils install
pulseaudio setting from PerfectSetup
> $ cat .pulse/default.pa
> load-module module-esound-protocol-tcp auth-ip-acl=127.0.0.1;
192.168.0.0/16
> load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;
192.168.0.0/16
> load-module module-zeroconf-publish
>
> load-module module-alsa-sink device=hw:0
> load-module module-alsa-source device=hw:0
alsa setting from PerfectSetup
> $ cat ~/.asoundrc
> pcm.pulse {
> type pulse
> }
>
> ctl.pulse {
> type pulse
> }
>
> pcm.!default {
> type pulse
> }
>
> ctl.!default {
> type pulse
> }
Error Msg of arecord program:
> $ arecord -d 10 -f cd -t wav foobar.wav
> Recording WAVE 'foobar.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,
Stereo
> arecord: pcm_read:1473: read error: Input/output error
> $
arecord(aplay.c) program dies at pcm_read() which is in aplay.c:
> pcm_read()
> -> readi_func()
> -> snd_pcm_readi()
and snd_pcm_readi() function returns -EIO(-5)
In aplay.c:
> /*
> * read function
> */
>
> static ssize_t pcm_read(u_char *data, size_t rcount)
> {
> ...
> while (count > 0) {
> r = readi_func(handle, data, count);
> fprintf(stderr, "pcm->setup: %d\n", handle->setup);
> if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
> snd_pcm_wait(handle, 1000);
> } else if (r == -EPIPE) {
> xrun();
> } else if (r == -ESTRPIPE) {
> suspend();
> } else if (r < 0) {
> error(_("read error: %s"), snd_strerror(r));
> exit(EXIT_FAILURE);
> }
> if (r > 0) {
> ...
In snd_pcm_readi() function (src/pcm/pcm.c of alsa-lib),
it seems CHECK_SANITY(! pcm->setup) condition makes IO error
In src/pcm/pcm.c:
> snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer,
snd_pcm_uframes_t size)
> {
> assert(pcm);
> assert(size == 0 || buffer);
> if (CHECK_SANITY(! pcm->setup)) {
> SNDMSG("PCM not set up");
> return -EIO;
> }
> if (pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED) {
> SNDMSG("invalid access type %s",
snd_pcm_access_name(pcm->access));
> return -EINVAL;
> }
> return _snd_pcm_readi(pcm, buffer, size);
> }
And there was only one place where sets pcm->setup is
_snd_pcm_hw_params() in src/pcm/pcm_params.c.
Thanks for any advice,
--
Best Regards,
Keedi Kim
2008/10/17 Luke Yelavich <themuso at ubuntu.com>
> On Fri, Oct 17, 2008 at 02:10:22PM EST, Keedi Kim wrote:
> > Hi.
> >
> > I followed PerfectSetup of pulseaudio wiki,
> > then aplay works well, but arecord doesn't.
> > ALSA's arecord terminates with
> > "pcm_read:1473: read error: Input/output error" message.
> >
> > Does anybody has idea?
>
> Could you please tell us what version of alsa-lib/libasound2,
> alsa-plugins/libasound2-plugins and pulseaudio you are running? Having a
> better idea what software versions you have will better help us work out the
> problem.
>
> Luke
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkj4BVEACgkQjVefwtBjIM4g1QCg3UjPGhHeYbjvMWXF0OR9rgXS
> rvQAoO30vGWi9gsrR83YJ11R71IPVl+t
> =ucms
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20081017/c262478a/attachment.htm>
More information about the pulseaudio-discuss
mailing list