A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/libpd/libpd/issues/130 below:

out buffer always zero · Issue #130 · libpd/libpd · GitHub

While trying to figure out the problem with #113 (comment) I think I have located the bug:

In both libpd_process_raw() and the macro PROCESS(_x, _y) the variable sys_soundout is constantly 0.

I have tested by adding a variable count to the functions and a line if (*p != 0) count++; in the copy loop (e.g. line 152), returning this variable and then outputting the value to the command line. These functions still return 0.

Subscribing to control rate receivers is no problem.

Here are my changes to the code for the test:

int libpd_process_raw(const float *inBuffer, float *outBuffer) {
  size_t n_in = sys_inchannels * DEFDACBLKSIZE;
  size_t n_out = sys_outchannels * DEFDACBLKSIZE;
  t_sample *p;
  size_t i;
  size_t count = 0;
  sys_microsleep(0);
  for (p = sys_soundin, i = 0; i < n_in; i++) {
    *p++ = *inBuffer++;
  }
  memset(sys_soundout, 0, n_out * sizeof(t_sample));
  SCHED_TICK(sys_time + sys_time_per_dsp_tick);
  for (p = sys_soundout, i = 0; i < n_out; i++) {
    if (*p1 != 0) count++; \
    *outBuffer++ = *p++;
  }
  return count;
}

and

#define PROCESS(_x, _y) \
  int i, j, k; \
  int count = 0;\
  t_sample *p0, *p1; \
  sys_microsleep(0); \
  for (i = 0; i < ticks; i++) { \
    for (j = 0, p0 = sys_soundin; j < DEFDACBLKSIZE; j++, p0++) { \
     for (k = 0, p1 = p0; k < sys_inchannels; k++, p1 += DEFDACBLKSIZE) {�\
        *p1 = *inBuffer++ _x; \
      } \
    } \
    memset(sys_soundout, 0, sys_outchannels*DEFDACBLKSIZE*sizeof(t_sample)); \
    SCHED_TICK(sys_time + sys_time_per_dsp_tick); \
    for (j = 0, p0 = sys_soundout; j < DEFDACBLKSIZE; j++, p0++) { \
      for (k = 0, p1 = p0; k < sys_outchannels; k++, p1 += DEFDACBLKSIZE) { \
        if (*p1 != 0) count++; \
        *outBuffer++ = *p1 _y; \
      } \
    } \
  } \
  return count;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4