[Portaudio] Missing port audio callbacks

Stefan Hajnoczi stefanha at gmail.com
Tue Aug 22 04:12:11 EDT 2017


On Tue, Aug 22, 2017 at 7:30 AM, Matti Sillanpää
<maash.1.bridge at gmail.com> wrote:
> I didn't see anything on the trace, but I'm amateur regarding Alsa and audio
> in general. I attached the logs from arecord.

Thanks for the arecord strace log.  strace does not pretty-print the
ioctl arguments, so we don't know the exact parameters that arecord
configures the soundcard with.

The latest trace shows that arecord never hits the xrun that PortAudio
keeps hitting.  arecord reads audio data successfully using the
READI_FRAMES ioctl.

In the previous PortAudio strace you posted it looked like
PaAlsaStream_WaitForFrames() failed due to an xrun before PortAudio
even tries to read frames.  I guess the sound device configuration is
different under PortAudio and the ALSA driver for this card is unable
to capture with these settings.

If you want to pursue this further you could look at the ALSA API and
compare arecord with PortAudio (using gdb or LD_PRELOAD):
http://www.alsa-project.org/alsa-doc/alsa-lib/

I'm not familiar with the ALSA API so I can't help much further.

Stefan

ioctl(4, SNDRV_PCM_IOCTL_HW_REFINE, 0x7e838120) = 0
ioctl(4, SNDRV_PCM_IOCTL_HW_PARAMS, 0x7e838120) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x7e8379fc) = 0
ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x7e837d3c) = 0
ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x7e83809c) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_PREPARE, 0x73c71100) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
unlink("test.wav")                      = 0
open("test.wav", O_WRONLY|O_CREAT, 0644) = 3
write(3, "RIFF$\342\4\0WAVE", 12)       = 12
write(3, "fmt \20\0\0\0", 8)            = 8
write(3, "\1\0\1\0\200>\0\0\0}\0\0\2\0\20\0", 16) = 16
write(3, "data\0\342\4\0", 8)           = 8
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_START, 0x6ee240) = 0
poll([{fd=4, events=POLLIN|POLLERR|POLLNVAL}], 1, -1) = 1 ([{fd=4,
revents=POLLIN}])
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x7e838e50) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
write(3, "\36\17\264\0V\5h\5Z\v\20\t\270\1z\372X\7:\2\240\1\346\372\236\377n\375\342\370\302\4"...,
4000) = 4000
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x7e838e50) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
poll([{fd=4, events=POLLIN|POLLERR|POLLNVAL}], 1, -1) = 1 ([{fd=4,
revents=POLLIN}])
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x7e838e50) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
write(3, "^\0\10\0&\1*\377\20\0\334\0\326\0010\1\274\377\342\2d\2\30\2\302\1\310\0D\1z\0"...,
4000) = 4000
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x7e838e50) = 0
ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x6ee240) = 0
write(3, "4\376t\376\322\376\20\377\376\376(\377$\377r\377\26\0\26\0\20\0\212\0d\0L\0\22\0n\0"...,
4000) = 4000


More information about the Portaudio mailing list