freewheeling with jackd 1.9.3

View: New views
10 Messages — Rating Filter:   Alert me  

freewheeling with jackd 1.9.3

by Andreas Degert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

doesn't seem to work under linux when using in realtime mode.

Starting works, but stopping gives an error:

Cannot set scheduling priority for RT thread res = 22 err = No such file or directory
Cannot start thread

It seems the member fRealTime of JackThread is not used consistently.
In the constructor of JackThreadedDriver fThread is created
non-realtime, even if the driver shall be running in realtime
(fRealTime set in fDriver).

In JackThreadedDriver::Init, fThread.AcquireRealTime is called. It
stores the given priority and sets the thread to realtime scheduling,
but doesn't set fRealTime in fThread.

When freewheeling is entered, scheduling is changed to non-realtime.
On exit of freewheeling, fThread.Start() is called and tries to set
the thread to the stored priority and fRealTime (still false) which
does not work.

Maybe JackThreadedDriver::Init should set fRealTime in fThread (needs
function, JackThread::fRealTime is protected), and it should be an error
to call AcquireRealTime when fRealTime is not set (or maybe could be
just ignored).

ciao
Andreas
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by torbenh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 03, 2009 at 01:19:24AM +0100, Andreas Degert wrote:

> doesn't seem to work under linux when using in realtime mode.
>
> Starting works, but stopping gives an error:
>
> Cannot set scheduling priority for RT thread res = 22 err = No such file or directory
> Cannot start thread
>
> It seems the member fRealTime of JackThread is not used consistently.
> In the constructor of JackThreadedDriver fThread is created
> non-realtime, even if the driver shall be running in realtime
> (fRealTime set in fDriver).
>
> In JackThreadedDriver::Init, fThread.AcquireRealTime is called. It
> stores the given priority and sets the thread to realtime scheduling,
> but doesn't set fRealTime in fThread.
>
> When freewheeling is entered, scheduling is changed to non-realtime.
> On exit of freewheeling, fThread.Start() is called and tries to set
> the thread to the stored priority and fRealTime (still false) which
> does not work.
>
> Maybe JackThreadedDriver::Init should set fRealTime in fThread (needs
> function, JackThread::fRealTime is protected), and it should be an error
> to call AcquireRealTime when fRealTime is not set (or maybe could be
> just ignored).

i dont see this behaviour in svn. i was looking into another issue with
freewheeling.
but i think the issue you mention is fixed in svn.

>
> ciao
> Andreas
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel@...
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :

> doesn't seem to work under linux when using in realtime mode.
>
> Starting works, but stopping gives an error:
>
> Cannot set scheduling priority for RT thread res = 22 err = No such  
> file or directory
> Cannot start thread

AFAICS this happens when restarting the audio driver. Can you produce  
a more complete log with the verbose mode (-v when starting jackd) ?


>
> It seems the member fRealTime of JackThread is not used consistently.
> In the constructor of JackThreadedDriver fThread is created
> non-realtime, even if the driver shall be running in realtime
> (fRealTime set in fDriver).

Yes indeed.
>
> In JackThreadedDriver::Init, fThread.AcquireRealTime is called. It
> stores the given priority and sets the thread to realtime scheduling,
> but doesn't set fRealTime in fThread.

There is no fRealTime in Thread class. Putting the "wrapping"  thread  
in realtime happens because of a RT state of the wrapped driver.

>
> When freewheeling is entered, scheduling is changed to non-realtime.

??

Freewheeling driver never has RT behavior.

> On exit of freewheeling, fThread.Start() is called and tries to set
> the thread to the stored priority and fRealTime (still false) which
> does not work.

??
>
> Maybe JackThreadedDriver::Init should set fRealTime in fThread (needs
> function, JackThread::fRealTime is protected), and it should be an  
> error
> to call AcquireRealTime when fRealTime is not set (or maybe could be
> just ignored).
>
> ciao
> Andreas


Sorry, I don't understand where you see that in the code. Please send  
a more complete log first.

Stephane
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Andreas Degert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 5 Nov 2009 00:16:29 +0100
torbenh <torbenh@...> wrote:

> On Tue, Nov 03, 2009 at 01:19:24AM +0100, Andreas Degert wrote:
> > doesn't seem to work under linux when using in realtime mode.
> >
> > Starting works, but stopping gives an error:
> >
> > Cannot set scheduling priority for RT thread res = 22 err = No such
> > file or directory Cannot start thread
> >
> > It seems the member fRealTime of JackThread is not used
> > consistently. In the constructor of JackThreadedDriver fThread is
> > created non-realtime, even if the driver shall be running in
> > realtime (fRealTime set in fDriver).
> >
> > In JackThreadedDriver::Init, fThread.AcquireRealTime is called. It
> > stores the given priority and sets the thread to realtime
> > scheduling, but doesn't set fRealTime in fThread.
> >
> > When freewheeling is entered, scheduling is changed to non-realtime.
> > On exit of freewheeling, fThread.Start() is called and tries to set
> > the thread to the stored priority and fRealTime (still false) which
> > does not work.
> >
> > Maybe JackThreadedDriver::Init should set fRealTime in fThread
> > (needs function, JackThread::fRealTime is protected), and it should
> > be an error to call AcquireRealTime when fRealTime is not set (or
> > maybe could be just ignored).
>
> i dont see this behaviour in svn. i was looking into another issue
> with freewheeling.
> but i think the issue you mention is fixed in svn.

I'm using the current svn version (revision 3694), and in my setup the
error is reproducable (linux kernel is ubuntu 2.6.31-9-rt).

There is another problem with freewheeling when using jconv but that
seems to be a jconv bug (I have a preliminary patch for it).

> >
> > ciao
> > Andreas
> > _______________________________________________
> > Jack-Devel mailing list
> > Jack-Devel@...
> > http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>
> --
> torben Hohn
> http://galan.sourceforge.net -- The graphical Audio language
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel@...
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Andreas Degert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 5 Nov 2009 09:55:56 +0100
Stéphane Letz <letz@...> wrote:

>
> Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :
>
> > doesn't seem to work under linux when using in realtime mode.
> >
> > Starting works, but stopping gives an error:
> >
> > Cannot set scheduling priority for RT thread res = 22 err = No
> > such file or directory
> > Cannot start thread
>
> AFAICS this happens when restarting the audio driver. Can you
> produce a more complete log with the verbose mode (-v when starting
> jackd) ?

Yes, happens when the audio driver is restarted.

sorry, can't create a log atm, I can send one later if still needed

> >
> > It seems the member fRealTime of JackThread is not used
> > consistently. In the constructor of JackThreadedDriver fThread is
> > created non-realtime, even if the driver shall be running in
> > realtime (fRealTime set in fDriver).
>
> Yes indeed.
> >
> > In JackThreadedDriver::Init, fThread.AcquireRealTime is called. It
> > stores the given priority and sets the thread to realtime
> > scheduling, but doesn't set fRealTime in fThread.
>
> There is no fRealTime in Thread class. Putting the "wrapping"
> thread in realtime happens because of a RT state of the wrapped
> driver.

class JackThreadedDriver has a member fThread (with type JackThread).

linux/JackPlatformPlug_os.h:namespace Jack { typedef JackPosixThread JackThread; }

posix/JackPosixThread.h:class SERVER_EXPORT JackPosixThread : public detail::JackThreadInterface

class JackThreadInterface is defined in common/JackThread.h and has
a member fRealTime.

> >
> > When freewheeling is entered, scheduling is changed to non-realtime.
>
> ??
>
> Freewheeling driver never has RT behavior.

I think I just meant fThread.Stop() is called in JackThreadedDriver::Stop()
(it was rather late...)

>
> > On exit of freewheeling, fThread.Start() is called and tries to set
> > the thread to the stored priority and fRealTime (still false) which
> > does not work.
>
> ??

fThread.StartSync() in JackThreadedDriver::Start()

JackPosixThread::StartSync() then calls

StartImp(&fThread, fPriority, fRealTime, ThreadHandler, this)

There a non-RT-thread is created because fRealTime JackThreadInterfaceis false and then
pthread_attr_setschedparam() fails...

For me this patch works:
-----------------------------------------------
Index: jackmp/common/JackThread.h
===================================================================
--- jackmp/common/JackThread.h (revision 3694)
+++ jackmp/common/JackThread.h (working copy)
@@ -96,6 +96,7 @@
         int Stop();
         void Terminate();
 
+        void enableRealTime() { fRealTime = true; }
         int AcquireRealTime();
         int AcquireRealTime(int priority);
         int DropRealTime();
Index: jackmp/common/JackThreadedDriver.cpp
===================================================================
--- jackmp/common/JackThreadedDriver.cpp (revision 3694)
+++ jackmp/common/JackThreadedDriver.cpp (working copy)
@@ -215,6 +215,7 @@
             // Will do "something" on OSX only...
             GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000;
             fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint);
+            fThread.enableRealTime();
             if (fThread.AcquireRealTime(GetEngineControl()->fServerPriority) < 0) {
                 jack_error("AcquireRealTime error");
             } else {

-----------------------------------------------

> >
> > Maybe JackThreadedDriver::Init should set fRealTime in fThread
> > (needs function, JackThread::fRealTime is protected), and it should
> > be an error
> > to call AcquireRealTime when fRealTime is not set (or maybe could be
> > just ignored).

At first AcquireRealTime is used to set the priority even though fRealTime
(in JackThreadInterface) is set to false, but StartSync will start a
non-RT-thread later and setting priority fails.

> > ciao
> > Andreas
>
>
> Sorry, I don't understand where you see that in the code. Please
> send a more complete log first.
>
> Stephane
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 5 nov. 2009 à 18:15, Andreas Degert a écrit :

> On Thu, 5 Nov 2009 09:55:56 +0100
> Stéphane Letz <letz@...> wrote:
>
>>
>> Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :
>>
>>> doesn't seem to work under linux when using in realtime mode.
>>>
>>> Starting works, but stopping gives an error:
>>>
>>> Cannot set scheduling priority for RT thread res = 22 err = No
>>> such file or directory
>>> Cannot start thread
>>
>> AFAICS this happens when restarting the audio driver. Can you
>> produce a more complete log with the verbose mode (-v when starting
>> jackd) ?
>
> Yes, happens when the audio driver is restarted.
>
> sorry, can't create a log atm, I can send one later if still needed


Yes, please send a complete log.

Thanks

Stéphane


_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by torbenh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 05, 2009 at 08:32:08PM +0100, Stéphane Letz wrote:

>
> Le 5 nov. 2009 à 18:15, Andreas Degert a écrit :
>
> >On Thu, 5 Nov 2009 09:55:56 +0100
> >Stéphane Letz <letz@...> wrote:
> >
> >>
> >>Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :
> >>
> >>>doesn't seem to work under linux when using in realtime mode.
> >>>
> >>>Starting works, but stopping gives an error:
> >>>
> >>>Cannot set scheduling priority for RT thread res = 22 err = No
> >>>such file or directory
> >>>Cannot start thread
> >>
> >>AFAICS this happens when restarting the audio driver. Can you
> >>produce a more complete log with the verbose mode (-v when starting
> >>jackd) ?
> >
> >Yes, happens when the audio driver is restarted.
> >
> >sorry, can't create a log atm, I can send one later if still needed
>
>
> Yes, please send a complete log.

the fix for the non RT behaviour is not complete.
a client connecting during freewheel would not set its logging to
buffered.

this should better fix the issue:
http://repo.or.cz/w/jack2.git/commitdiff/b4939bba6fded4c65d1d28d792c56ecbe9d2392e

>
> Thanks
>
> Stéphane
>
>
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel@...
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

--
torben Hohn
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 6 nov. 2009 à 10:09, torbenh a écrit :

> On Thu, Nov 05, 2009 at 08:32:08PM +0100, Stéphane Letz wrote:
>>
>> Le 5 nov. 2009 à 18:15, Andreas Degert a écrit :
>>
>>> On Thu, 5 Nov 2009 09:55:56 +0100
>>> Stéphane Letz <letz@...> wrote:
>>>
>>>>
>>>> Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :
>>>>
>>>>> doesn't seem to work under linux when using in realtime mode.
>>>>>
>>>>> Starting works, but stopping gives an error:
>>>>>
>>>>> Cannot set scheduling priority for RT thread res = 22 err = No
>>>>> such file or directory
>>>>> Cannot start thread
>>>>
>>>> AFAICS this happens when restarting the audio driver. Can you
>>>> produce a more complete log with the verbose mode (-v when starting
>>>> jackd) ?
>>>
>>> Yes, happens when the audio driver is restarted.
>>>
>>> sorry, can't create a log atm, I can send one later if still needed
>>
>>
>> Yes, please send a complete log.
>
> the fix for the non RT behaviour is not complete.
> a client connecting during freewheel would not set its logging to
> buffered.
>
> this should better fix the issue:
> http://repo.or.cz/w/jack2.git/commitdiff/b4939bba6fded4c65d1d28d792c56ecbe9d2392e
>>
>> Thanks
>>
>> Stéphane


Well this is part of the problem, but not exactly the issue Andreas  
reported. I did actually start to fix this part ("non RT behaviour")  
on SVN and send a patch to Andreas to test for his initial problem.

Stéphane
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by torbenh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 06, 2009 at 10:24:03AM +0100, Stéphane Letz wrote:

>
> Le 6 nov. 2009 à 10:09, torbenh a écrit :
>
> >On Thu, Nov 05, 2009 at 08:32:08PM +0100, Stéphane Letz wrote:
> >>
> >>Le 5 nov. 2009 à 18:15, Andreas Degert a écrit :
> >>
> >>>On Thu, 5 Nov 2009 09:55:56 +0100
> >>>Stéphane Letz <letz@...> wrote:
> >>>
> >>>>
> >>>>Le 3 nov. 2009 à 01:19, Andreas Degert a écrit :
> >>>>
> >>>>>doesn't seem to work under linux when using in realtime mode.
> >>>>>
> >>>>>Starting works, but stopping gives an error:
> >>>>>
> >>>>>Cannot set scheduling priority for RT thread res = 22 err = No
> >>>>>such file or directory
> >>>>>Cannot start thread
> >>>>
> >>>>AFAICS this happens when restarting the audio driver. Can you
> >>>>produce a more complete log with the verbose mode (-v when starting
> >>>>jackd) ?
> >>>
> >>>Yes, happens when the audio driver is restarted.
> >>>
> >>>sorry, can't create a log atm, I can send one later if still needed
> >>
> >>
> >>Yes, please send a complete log.
> >
> >the fix for the non RT behaviour is not complete.
> >a client connecting during freewheel would not set its logging to
> >buffered.
> >
> >this should better fix the issue:
> >http://repo.or.cz/w/jack2.git/commitdiff/b4939bba6fded4c65d1d28d792c56ecbe9d2392e
> >>
> >>Thanks
> >>
> >>Stéphane
>
>
> Well this is part of the problem, but not exactly the issue Andreas
> reported. I did actually start to fix this part ("non RT behaviour")
> on SVN and send a patch to Andreas to test for his initial problem.

i am just saying, that your fix in SVN r3700 is not complete.


>
> Stéphane

--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: freewheeling with jackd 1.9.3

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Well this is part of the problem, but not exactly the issue Andreas
reported. I did actually start to fix this part ("non RT behaviour")
on SVN and send a patch to Andreas to test for his initial problem.

i am just saying, that your fix in SVN r3700 is not complete.


So what is missing?

Stéphane

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org