Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-20 Thread Jérôme Godbout
If you are looking for some explanation of the QThread and how to use them properly, here a few other links: 1. https://www.kdab.com/multithreading-with-qt/ 2. http://blog.debao.me/2013/08/how-to-use-qthread-in-the-right-way-part-1/ 3.

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread Thiago Macieira
On Tuesday, 19 May 2020 19:03:39 PDT David M. Cotter wrote: > if you want the rest of the code here it is: http://sscce.org/ Short, Self Contained, Correct (Compilable), Example That means main() function with QCoreApplication. I don't need a .pro file or CMakeLists.txt if it's obvious how to

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread David M. Cotter
>> but since this i_auP is NOT a QObject, it's my own class, that i'm fine to >> allocate it in one thread (main) and then use it on another thread (audio >> pump thread) (provided and assuming i am careful to mutex any access from >> the main thread) > > i_auP is not a QObject, but

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread Thiago Macieira
On Monday, 18 May 2020 21:12:55 PDT David M. Cotter wrote: > i thought your objection was that objects derived from QObject, if they are > used on a back thread then they must be either allocated there or "moved" > there. Correct. > but since this i_auP is NOT a QObject, it's my own class, that

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread Konstantin Shegunov
On Wed, May 20, 2020 at 2:13 AM David M. Cotter wrote: > is it possible i'm just using QThread wrong? and it HAPPENS to work fine > on mac but fails on windows? > > is this blogger really revealing the ONE TRUE NATURE of QThread: > >

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread David M. Cotter
is it possible i'm just using QThread wrong? and it HAPPENS to work fine on mac but fails on windows? is this blogger really revealing the ONE TRUE NATURE of QThread: https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread David M. Cotter
anybody have any other ideas? > On May 18, 2020, at 9:12 PM, David M. Cotter wrote: > Note that you do initialise the i_auP pointer in your constructor's initialisation list >>> which is not a QObject, it's my own wrapper class >> Irrelevant what it derives from > then i'm not

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread David M. Cotter
>>> Note that you do initialise the i_auP pointer in your constructor's >>> initialisation list >> which is not a QObject, it's my own wrapper class > Irrelevant what it derives from then i'm not understanding what your objection is. i thought your objection was that objects derived from

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread Thiago Macieira
On Monday, 18 May 2020 19:33:03 PDT David M. Cotter wrote: > >> Specifically: both i_qGeneratorP and i_qOutputP are allocated there. I > >> think they're the only Qt objects use within the new thread? > > > > If you say so, but I can't confirm that you've done the right thing since > > I > >

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread David M. Cotter
>>> Like every QObject class, unless noted otherwise, you may not call methods >>> on the object from outside the object's thread of affinity (the one it >>> was created in or moved to with moveToThread). Your code is abusing the >>> API in both cases if you're using the API from another thread.

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread Henry Skoglund
On 2020-05-19 03:19, Thiago Macieira wrote PS: if you're using Hungarian notation, doesn't the "i" prefix indicate "integer"? Why are you using it for pointers? An "i" *after* the underscore would indicate an integer, yes, but the letter is before the underscore, so it indicates a scope,

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread Thiago Macieira
On Monday, 18 May 2020 17:42:10 PDT David M. Cotter wrote: > > Like every QObject class, unless noted otherwise, you may not call methods > > on the object from outside the object's thread of affinity (the one it > > was created in or moved to with moveToThread). Your code is abusing the > > API

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-18 Thread David M. Cotter
>> i have a cross platform (mac / win) app that plays audio. >> i'm using the push method for audio PCM >> instead of using a timer, i'm just running the pump on a background thread. >> >> This works fine on mac, but produces silence on windows. >> >> is this... a limitation? > > No, it's a bug

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-17 Thread Thiago Macieira
On domingo, 17 de maio de 2020 16:10:08 PDT David M. Cotter wrote: > i have a cross platform (mac / win) app that plays audio. > i'm using the push method for audio PCM > instead of using a timer, i'm just running the pump on a background thread. > > This works fine on mac, but produces silence

[Interest] is it ok to push audio on a background thread, not a timer?

2020-05-17 Thread David M. Cotter
i have a cross platform (mac / win) app that plays audio. i'm using the push method for audio PCM instead of using a timer, i'm just running the pump on a background thread. This works fine on mac, but produces silence on windows. is this... a limitation? more info here: