Bugs item #2978457, was opened at 2010-03-29 10:01 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478070&aid=2978457...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: puredata Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: -nogui audio initialization problems under Debian
Initial Comment: The [delread~] in the attached patch fails to initialize to the correct samplerate when started with -nogui under Debian and Pd 0.41.4 or 0.42-5. It seems to initialize to a samplerate of 0 instead. This problem persists independently from the audio driver used (ALS vs OSS). The patch works fine under Windows XP, however.
The patch contains a workaround which has been suggested on the Pd-list, i.e. to loadbang a [switch~] object to 0 and then set it to 1 when neded. However, this did not help in the current situation.
The patch also delays the loadbanged [;pd dsp 1( message by a [del 1000. This is a workaround addressing another manifestation of the audio initialisation problems with -nogui under Debian. If the [del 1000] is removed, the patch fails to load under -nogui with a "dev/dsp (read/write): Device or resource busy" message.
IOhannes has suggested on the list to set the samplerate explicitely at startup, i.e. by pd -nogui -r 44100 However, I cannot confirm this workaround to work with the attached patch.
Please note that the attached patch works fine under Windows XP and with -nogui enabled; also if the [del 1000] and [switch~] objects are omitted.
best, flo.H
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2010-05-16 17:45
Message: --- d_delay.c (révision 13539) +++ d_delay.c (copie de travail) @@ -24,6 +24,7 @@ { t_object x_obj; t_symbol *x_sym; + t_float x_deltime; /* delay in msec */ t_delwritectl x_cspace; int x_sortno; /* DSP sort number at which this was last put on chain */ int x_rsortno; /* DSP sort # for first delread or write in chain */ @@ -54,19 +55,13 @@
static void *sigdelwrite_new(t_symbol *s, t_floatarg msec) { - int nsamps; t_sigdelwrite *x = (t_sigdelwrite *)pd_new(sigdelwrite_class); if (!*s->s_name) s = gensym("delwrite~"); pd_bind(&x->x_obj.ob_pd, s); x->x_sym = s; - nsamps = msec * sys_getsr() * (t_float)(0.001f); - if (nsamps < 1) nsamps = 1; - nsamps += ((- nsamps) & (SAMPBLK - 1)); - nsamps += DEFDELVS; - x->x_cspace.c_n = nsamps; - x->x_cspace.c_vec = - (t_sample *)getbytes((nsamps + XTRASAMPS) * sizeof(t_sample)); - x->x_cspace.c_phase = XTRASAMPS; + x->x_deltime = msec; + x->x_cspace.c_n = 0; + x->x_cspace.c_vec = 0; x->x_sortno = 0; x->x_vecsize = 0; x->x_f = 0; @@ -106,6 +101,18 @@
static void sigdelwrite_dsp(t_sigdelwrite *x, t_signal **sp) { + int nsamps = x->x_deltime * sp[0]->s_sr * (t_float)(0.001f); + post("sigdelwrite_dsp: %f ms, with sr=%f",x->x_deltime,sys_getsr()); + if (nsamps < 1) nsamps = 1; + nsamps += ((- nsamps) & (SAMPBLK - 1)); + nsamps += DEFDELVS; + if (x->x_cspace.c_n != nsamps) { + x->x_cspace.c_n = nsamps; + x->x_cspace.c_vec = + (t_sample *)getbytes((nsamps + XTRASAMPS) * sizeof(t_sample)); + x->x_cspace.c_phase = XTRASAMPS; + } + dsp_add(sigdelwrite_perform, 3, sp[0]->s_vec, &x->x_cspace, sp[0]->s_n); x->x_sortno = ugen_getsortno(); sigdelwrite_checkvecsize(x, sp[0]->s_n);
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2010-05-16 17:40
Message: this also goes with another bug : [delwrite~] doesn't honour the sampling rate set by [block~]
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2010-05-16 17:20
Message: this goes with another bug : [delwrite~] doesn't honour any change of sampling rate (e.g. 44100 to 22050).
those bugs are related because the reason [delwrite~] doesn't work with this, is that [delwrite~] is created while sys_getsr() still reports sampling rate to be "0", because sys_dacsr has not been assigned to.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2010-05-16 17:00
Message: if you load your patch using a «; pd open $1 .» message from a [delay]ed [loadbang], the patch runs correctly.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2010-05-16 16:53
Message: you can replace the [delay 1000] by just [delay], that is, [delay 0].
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478070&aid=2978457...