[pulseaudio-discuss] pa_simple_new function - Failed to load cookie file from cookie: Not a directory

Sean Greenslade sean at seangreenslade.com
Fri Aug 18 06:09:50 UTC 2023


On Wed, Aug 16, 2023 at 05:08:25PM +0200, Björn Försterling wrote:
> Hello everyone,
> 
> I am using the pulse audio simple API in a C program and I am getting the
> following error message when using the "pa_simple_new" function:
> 
> 28	    simple = pa_simple_new(NULL, "Audio Playback", PA_STREAM_PLAYBACK,
> NULL, "playback", &ss, NULL, NULL, &pa_error);
> (gdb) 
> [New Thread 0x7ffff34416c0 (LWP 3517)]
> Failed to load cookie file from cookie: Not a directory
> 
> The audio file that I am playing in the later part of the program is still being
> played correctly.
> But how do I suppress (or solve) this error message?
> 
> I tried setting the environment variable PULSE_COOKIE like this:
> export PULSE_COOKIE="~/.config/pulse/cookie"
> But it did not help. (this "cookie" file exists)
> 
> The return value of the pa_simple_new function is not NULL:
> (gdb) p simple
> $1 = (pa_simple *) 0x5555555592d0
> 
> And the pa_error integer that I am trying to get an error code with stays at 0.
> 
> Can someone please help me to debug this issue?

The fact that you're getting this exact error message:

> Failed to load cookie file from cookie: Not a directory

implies that your environment variable is not getting picked up by your
application. If you're launching your program from a shell, perhaps try
directly setting the env var in the calling line, like so:

$ PULSE_COOKIE=~/.config/pulse/cookie ./my-pulse-using-executable

--Sean



More information about the pulseaudio-discuss mailing list