I had a segment error while running "Sample Async Playback" provided by "pulseaudio"。 but my compilation passed.
Compile the way
gcc pa-beep.c -lpulse-simple -shared -fPIC -g
Here's Contains library files
#include <stdio.h>
#include <string.h>
#include <pulse/pulseaudio.h>
static int latency = 20000; // start latency in micro seconds
static int sampleoffs = 0;
static short sampledata[300000];
static pa_buffer_attr bufattr;
static int underflows = 0;
static pa_sample_spec ss;
I added the print step inside the main function, and the result shows that the program did not execute this step.
int main(int argc, char *argv[]) {
printf("kai shi\n");
pa_mainloop *pa_ml;
pa_mainloop_api *pa_mlapi;
pa_context *pa_ctx;
pa_stream *playstream;
I'm sorry I'm a beginner. I don't know how to solve this problem