You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which leads to this section of cava code being run
if (access(p.raw_target, F_OK) != -1) {
// testopening in case it's a fifo
fptest = open(p.raw_target, O_RDONLY | O_NONBLOCK, 0644);
if (fptest == -1) {
fprintf(stderr, "could not open file %s for writin g\n", p.raw_target);
exit(1);
}
} else...
In the old code there was a later unconditional line
This is removed and made conditional in the new code, which leads to no spectrum (and fp is being initialised to 0 for me, which is maybe standard input!)
I also noticed the commit left a printf
printf("creating fifo %s\n", p.raw_target);
Could the code be simplified to something like
case OUTPUT_RAW:
if (strcmp(p.raw_target, "/dev/stdout") != 0) {
// checking if file exists
if (access(p.raw_target, F_OK) == -1) {
fprintf(stderr, "creating fifo %s\n", p.raw_target);
if (mkfifo(p.raw_target, 0664) == -1) {
fprintf(stderr, "could not create fifo %s\n", p.raw_target);
exit(1);
}
}
fp = open(p.raw_target, O_RDWR | O_NONBLOCK, 0644);
} else {
fp = fileno(stdout);
fprintf(stderr, "Opening stdout\n");
}
if (fp == -1) {
fprintf(stderr, "could not open file %s for writing\n", p.raw_target);
exit(1);
}
fprintf(stderr, "open file %s for writing raw output\n", p.raw_target);
I checked this with mpd_oled creating the FIFO and then calling cava, and also letting cava create the FIFO and mpd_oled simply opening it, and it worked in both cases.
Adrian.
The text was updated successfully, but these errors were encountered:
should work now, I was a bit quick when merging the previous commit so the fifo was actually only opened when it did not already exist.
the code here is a bit confusing the fptest was needed in order to achieve something and I have forgotten what it was. I think it had to do with keeping it non_blocking.
Hi Karl
I had an issue reported for mpd_oled yesterday that was introduced with the last cava commit: be7c5b8
http://moodeaudio.org/forum/showthread.php?tid=155&pid=34372#pid34372
mpd_oled creates a FIFO for cava to write to, and then runs cava with a configuration like
Which leads to this section of cava code being run
In the old code there was a later unconditional line
This is removed and made conditional in the new code, which leads to no spectrum (and fp is being initialised to 0 for me, which is maybe standard input!)
I also noticed the commit left a printf
Could the code be simplified to something like
I checked this with mpd_oled creating the FIFO and then calling cava, and also letting cava create the FIFO and mpd_oled simply opening it, and it worked in both cases.
Adrian.
The text was updated successfully, but these errors were encountered: