Re: [PD-dev] Tentative fix for the -nogui no-sound problem

2012-04-14 Thread Chrissie Caulfield
As I understand it, the zero sample rate happens simply because the
variables that are queried by plugins (specifically sys_dacsr) are
initialised after the plugins are loaded.

Loading the GUI forces the audio settings to be initialised earlier so
the problem doesn't happen under 'normal' conditions.

Chrissie



On 13/04/2012 19:14, Hans-Christoph Steiner wrote:
> That could be the solution, I haven't looked enough to know yet.  My question 
> is: what is causing the sample rate to first be sent as "0"?  I remember that 
> seemed to be one of the behaviors related to this.  Its probably something we 
> want to prevent from happening, unless someone can explain why Pd announcing 
> the sample rate as 0 is useful.
>
> .hc
>
> On Apr 13, 2012, at 9:44 AM, Chrissie Caulfield wrote:
>
>> Hiya,
>>
>> I've been looking into the problem that starting pd with -nogui can cause a 
>> lot of plugins to start with a zero sample-rate and therefore produce no 
>> sound.
>>
>> Here's my tentative patch for this. It's very small and though it could be 
>> regarded as over-simplistic, it does fix the problem that's been causing me 
>> a lot of grief for a while now.
>>
>> So, I tentatively offer this as my fix. If you think it's not enough and 
>> needs something more complex then please say what you think is wrong and 
>> I'll keep digging :)
>>
>> Chrissie
>> ___
>> Pd-dev mailing list
>> Pd-dev@iem.at
>> http://lists.puredata.info/listinfo/pd-dev
>
>
> 
>
> As we enjoy great advantages from inventions of others, we should be glad of 
> an opportunity to serve others by any invention of ours; and this we should 
> do freely and generously. - Benjamin Franklin
>
>
>

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] Tentative fix for the -nogui no-sound problem

2012-04-13 Thread Hans-Christoph Steiner

That could be the solution, I haven't looked enough to know yet.  My question 
is: what is causing the sample rate to first be sent as "0"?  I remember that 
seemed to be one of the behaviors related to this.  Its probably something we 
want to prevent from happening, unless someone can explain why Pd announcing 
the sample rate as 0 is useful.

.hc

On Apr 13, 2012, at 9:44 AM, Chrissie Caulfield wrote:

> Hiya,
> 
> I've been looking into the problem that starting pd with -nogui can cause a 
> lot of plugins to start with a zero sample-rate and therefore produce no 
> sound.
> 
> Here's my tentative patch for this. It's very small and though it could be 
> regarded as over-simplistic, it does fix the problem that's been causing me a 
> lot of grief for a while now.
> 
> So, I tentatively offer this as my fix. If you think it's not enough and 
> needs something more complex then please say what you think is wrong and I'll 
> keep digging :)
> 
> Chrissie
> ___
> Pd-dev mailing list
> Pd-dev@iem.at
> http://lists.puredata.info/listinfo/pd-dev





As we enjoy great advantages from inventions of others, we should be glad of an 
opportunity to serve others by any invention of ours; and this we should do 
freely and generously. - Benjamin Franklin



___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


[PD-dev] Tentative fix for the -nogui no-sound problem

2012-04-13 Thread Chrissie Caulfield

Hiya,

I've been looking into the problem that starting pd with -nogui can 
cause a lot of plugins to start with a zero sample-rate and therefore 
produce no sound.


Here's my tentative patch for this. It's very small and though it could 
be regarded as over-simplistic, it does fix the problem that's been 
causing me a lot of grief for a while now.


So, I tentatively offer this as my fix. If you think it's not enough and 
needs something more complex then please say what you think is wrong and 
I'll keep digging :)


Chrissie
diff --git a/src/s_audio.c b/src/s_audio.c
index 8434f52..7cff1c8 100644
--- a/src/s_audio.c
+++ b/src/s_audio.c
@@ -328,6 +328,7 @@ void sys_set_audio_settings(int naudioindev, int *audioindev, int nchindev,
 sys_log_error(ERR_NOTHING);
 audio_nextinchans = inchans;
 audio_nextoutchans = outchans;
+sys_setchsr(audio_nextinchans, audio_nextoutchans, rate);
 sys_save_audio_params(nrealindev, realindev, realinchans,
 nrealoutdev, realoutdev, realoutchans, rate, advance, callback,
 blocksize);
___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev