[Portaudio] Missing port audio callbacks

Matti Sillanpää maash.1.bridge at gmail.com
Fri Aug 18 02:31:12 EDT 2017


Hi Phil.


pa_devs lists both cards. I attached the dump.

I modified the paex_record to blocking read:
***********************************************************************************
   err = Pa_OpenStream(
              &stream,
              &inputParameters,
              NULL,                  /* &outputParameters, */
              SAMPLE_RATE,
              FRAMES_PER_BUFFER,
              paClipOff,      /* we won't output out of range samples so
don't bother clipping the\
m */

NULL,//recordCallback,

              NULL );
    if( err != paNoError ) goto done;

    err = Pa_StartStream( stream );
    if( err != paNoError ) goto done;
    printf("\n=== Now recording!! Please speak into the microphone.
===\n"); fflush(stdout);

    Pa_ReadStream(stream, (void*)data.recordedSamples, FRAMES_PER_BUFFER);
    for (i=0; i < 20; i++) {
      printf("data: %x\n", data.recordedSamples[i]);
    }

**********************************************************************************
The Pa_StartStream doesn't return. I attached strace dump from this also.

-Matti

2017-08-17 18:06 GMT+03:00 Phil Burk <philburk at mobileer.com>:

> Hello Matti,
>
> Make sure yo check out our RPi page:
>     https://app.assembla.com/wiki/show/portaudio/Platforms_RaspberryPi
>
> What does pa_devs show? It lists devices?
>
> > no recording callbacks
>
> As a test, can you record without callbacks?  using Pa_ReadStream()
>     http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html#
> a0b62d4b74b5d3d88368e9e4c0b8b2dc7
>
> Phil Burk
>
>
>
> On Wed, Aug 16, 2017 at 8:42 AM, Matti Sillanpää
> <maash.1.bridge at gmail.com> wrote:
> > Hi.
> >
> >
> > Sorry this is wrong forum, however I didn’t want to make an error right
> away, as I suspect that the problem is my configuration.
> >
> > Environment is rPI 3 and Jessie. I’m using I2S microphone that outputs
> 16 bit 16khz mono. I can record from default device like (arecord -d 10 -f
> S16_LE -r 16000 test.wav). No problems there. Also rec test.wav works fine.
> >
> > I got the latest port audio sources from the website and compiled the
> successfully. The playback works fine, however the recording doesn’t work.
> I don’t get any errors, but no recording callbacks arrive. This is problem
> both with my own code and the paex_record.c (both stock and one modified to
> 16bit&16khz mono).
> >
> > Is this clear configuration issue or bug?
> >
> > -Matti
> > _______________________________________________
> > Portaudio mailing list
> > Portaudio at lists.columbia.edu
> > https://lists.columbia.edu/mailman/listinfo/portaudio
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20170818/e2f5973f/attachment-0001.html>
-------------- next part --------------
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
PortAudio version: 0x00130600
Version text: 'PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4'
Number of devices = 7
--------------------------------------- device #0
Name                        = bcm2835 ALSA: - (hw:0,0)
Host API                    = ALSA
Max inputs = 0, Max outputs = 2
Default low input latency   =  -1.0000
Default low output latency  =   0.0058
Default high input latency  =  -1.0000
Default high output latency =   0.0348
Default sample rate         = 44100.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00
--------------------------------------- device #1
Name                        = bcm2835 ALSA: IEC958/HDMI (hw:0,1)
Host API                    = ALSA
Max inputs = 0, Max outputs = 2
Default low input latency   =  -1.0000
Default low output latency  =   0.0058
Default high input latency  =  -1.0000
Default high output latency =   0.0348
Default sample rate         = 44100.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel output = 
	44100.00, 48000.00
--------------------------------------- device #2
Name                        = snd_rpi_simple_card: - (hw:1,0)
Host API                    = ALSA
Max inputs = 2, Max outputs = 2
Default low input latency   =   0.0058
Default low output latency  =   0.0058
Default high input latency  =   0.0348
Default high output latency =   0.0348
Default sample rate         = 44100.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel input = 
	 8000.00, 11025.00, 16000.00, 22050.00,
	32000.00, 44100.00, 48000.00, 88200.00,
	96000.00, 192000.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel output = 
	 8000.00, 11025.00, 16000.00, 22050.00,
	32000.00, 44100.00, 48000.00, 88200.00,
	96000.00, 192000.00
Supported standard sample rates
 for full-duplex 16 bit 2 channel input, 2 channel output = 
	 8000.00, 11025.00, 16000.00, 22050.00,
	32000.00, 44100.00, 48000.00, 88200.00,
	96000.00, 192000.00
--------------------------------------- device #3
Name                        = sysdefault
Host API                    = ALSA
Max inputs = 0, Max outputs = 128
Default low input latency   =  -1.0000
Default low output latency  =   0.0058
Default high input latency  =  -1.0000
Default high output latency =   0.0348
Default sample rate         = 44100.00
Supported standard sample rates
 for half-duplex 16 bit 128 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00, 88200.00
--------------------------------------- device #4
Name                        = monocard
Host API                    = ALSA
Max inputs = 128, Max outputs = 128
Default low input latency   =   0.0160
Default low output latency  =   0.0160
Default high input latency  =   0.0960
Default high output latency =   0.0960
Default sample rate         = 16000.00
Supported standard sample rates
 for half-duplex 16 bit 128 channel input = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00, 88200.00, 96000.00,
	192000.00
Supported standard sample rates
 for half-duplex 16 bit 128 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00, 88200.00, 96000.00,
	192000.00
Supported standard sample rates
 for full-duplex 16 bit 128 channel input, 128 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00, 88200.00, 96000.00,
	192000.00
--------------------------------------- device #5
Name                        = dmix
Host API                    = ALSA
Max inputs = 0, Max outputs = 2
Default low input latency   =  -1.0000
Default low output latency  =   0.0213
Default high input latency  =  -1.0000
Default high output latency =   0.0213
Default sample rate         = 48000.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel output = 
	48000.00
--------------------------------------- device #6
[ Default Input, Default Output ]
Name                        = default
Host API                    = ALSA
Max inputs = 128, Max outputs = 2
Default low input latency   =   0.0160
Default low output latency  =   0.0160
Default high input latency  =   0.0960
Default high output latency =   0.0960
Default sample rate         = 16000.00
Supported standard sample rates
 for half-duplex 16 bit 128 channel input = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00, 88200.00, 96000.00,
	192000.00
Supported standard sample rates
 for half-duplex 16 bit 2 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00
Supported standard sample rates
 for full-duplex 16 bit 128 channel input, 2 channel output = 
	 8000.00,  9600.00, 11025.00, 12000.00,
	16000.00, 22050.00, 24000.00, 32000.00,
	44100.00, 48000.00
----------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trace2.txt.tar.xz
Type: application/x-xz
Size: 17592 bytes
Desc: not available
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20170818/e2f5973f/attachment-0001.xz>


More information about the Portaudio mailing list