From: Jean-Denis G. <jd....@sy...> - 2008-06-23 19:07:55
Attachments:
iaxclient_prio.patch
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I recently moved to latest versions (2.1beta3 and trunk), and though it worked very well on first test system (much improved sound quality comparing to old versions), it didn't work on another system. Both systems are Linux, and I finally found that the problem was related to setting the priority in unixfuncs.c: requested priority (+4) cannot be set for a normal user (it's working for root of course). I already reported same problem long ago, but maybe I'm the only one affected by this... http://sourceforge.net/mailarchive/message.php?msg_id=4366C3DF.2010308%40sysnux.pf Patch attached. Thanks, - -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iEYEARECAAYFAkhf9IQACgkQuu7Rv+oOo/j09gCgrY74oHHnlC6lyDrADTsRnhc+ Iu0AoKdkQNUk5s6TyZRAzOMN1q6c4/e+ =TGio -----END PGP SIGNATURE----- |
From: Andrea S. <si...@op...> - 2008-06-27 11:23:18
|
Hi, Jean-Denis Jean-Denis Girard wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I recently moved to latest versions (2.1beta3 and trunk), and though it > worked very well on first test system (much improved sound quality > comparing to old versions), it didn't work on another system. Both what does "didn't work" mean? application seg-faulted or whatever? > systems are Linux, and I finally found that the problem was related to > setting the priority in unixfuncs.c: requested priority (+4) cannot be > set for a normal user (it's working for root of course). just for curiosity's sake, which kernel runs each of the involved systems? > I already reported same problem long ago, but maybe I'm the only one > affected by this... > http://sourceforge.net/mailarchive/message.php?msg_id=4366C3DF.2010308%40sysnux.pf reading through this thread I've just noted you said that also portaudio/pa_unix_oss/pa_unix.c has to be changed. is this editing still needed? Andrea |
From: Jean-Denis G. <jd....@sy...> - 2008-06-27 19:07:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Andrea, Andrea Suisani a écrit : > Hi, Jean-Denis > > Jean-Denis Girard wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Hi, >> >> I recently moved to latest versions (2.1beta3 and trunk), and though it >> worked very well on first test system (much improved sound quality >> comparing to old versions), it didn't work on another system. Both > > what does "didn't work" mean? application seg-faulted or whatever? No, it's failing in a more subtle way: when placing a call, it seems that IAX events are not received correctly. For example, here is the trace from my application (MozPhone, see http://moziax.mozdev.org/) when a call is successfully placed (with my patched iaxclient-2.1beta3): - ------------ iaxc_initialize OK, 2 lines WatchDogProc: cannot set watch dog priority 53 ! WatchDogProc: cannot set watch dog priority 52 ! WatchDogProc: cannot set watch dog priority 51 ! Looking for Plantronics cs60usb... Plantronics CS60-USB found at /dev/hiddev0 cs60init: thread 0 running. ...... Calling xxx:xx...@xx.../196... Ignoring text event t,-1,2,Originating an audio only call t,-1,2,Originating an audio only call New STATE_EV 38 for call 0 outgoing=4, ringing=0, complete=0, selected=32, busy=0, active=2 State event: s,0,selected, STATE_EV => 0 not accepted yet... State event: s,0,not_accepted,196 warning: The VAD has been replaced by a hack pending a complete rewrite Ignoring text event t,-1,1,Call 0 accepted t,-1,1,Call 0 accepted New STATE_EV 54 for call 0 outgoing=4, ringing=0, complete=16, selected=32, busy=0, active=2 State event: s,0,selected, State event: s,0,active,196 cs60: status 5 Ignoring text event t,-1,1,Call 0 answered No RTT Rjit Rlos% RlosC Rpkts Rdel Rdrop Rooo Ljit Llos% LlosC Lpkts Ldel Ldrop Looo 0: 66 0 0 0 1 40 0 0 32 0 0 102 105 0 0 warning: The VAD has been replaced by a hack pending a complete rewrite Ignoring text event t,-1,1,Hanging up call 0 t,-1,1,Hanging up call 0 New STATE_EV 0 for call 0 outgoing=0, ringing=0, complete=0, selected=0, busy=0, active=0 STATE_EV => 0 NOT_active - --------------------- As you can see IAX events are received as expected, call is successful. Now here is what I get with original iaxclient-2.1beta3: - --------------------- iaxc_initialize OK, 2 lines WatchDogProc: cannot set watch dog priority! WatchDogProc: killing hung audio thread! Looking for Plantronics cs60usb... Plantronics CS60-USB found at /dev/hiddev0 cs60init: thread 0 running. ...... Calling xxx:xx...@xx.../196... Ignoring text event t,-1,2,Originating an audio only call t,-1,2,Originating an audio only call New STATE_EV 38 for call 0 outgoing=4, ringing=0, complete=0, selected=32, busy=0, active=2 State event: s,0,selected, STATE_EV => 0 not accepted yet... State event: s,0,not_accepted,196 Ignoring text event t,-1,1,Hanging up call 0 t,-1,1,Hanging up call 0 New STATE_EV 0 for call 0 outgoing=0, ringing=0, complete=0, selected=0, busy=0, active=0 STATE_EV => 0 NOT_active cs60: status 1 State event: s,0,not_active, - --------- As you can see, IAX state event accepted is never received. > >> systems are Linux, and I finally found that the problem was related to >> setting the priority in unixfuncs.c: requested priority (+4) cannot be >> set for a normal user (it's working for root of course). > > just for curiosity's sake, which kernel runs each of the involved systems? Both systems where 2.6.25.x kernels, but one is 64bits-smp (base distro is Mandriva-2008.1-64), the other is 32 bits (Mandriva cooker-32). > >> I already reported same problem long ago, but maybe I'm the only one >> affected by this... >> http://sourceforge.net/mailarchive/message.php?msg_id=4366C3DF.2010308%40sysnux.pf >> > > reading through this thread I've just noted you said > that also portaudio/pa_unix_oss/pa_unix.c has to be changed. > is this editing still needed? No, it is no longer needed. I know priorities permissions can be modified on Linux according to limits.conf, but I think this is a real problem for Linux users, that my proposed patch can solve. I just downloaded / tested binary iaxcomm-1.2.0: it fails to run as normal user because it cannot set the watchdog priority, and runs fine as root. Thanks, - -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iEYEARECAAYFAkhlI9kACgkQuu7Rv+oOo/h9hwCgmulmol9vb0fYSoVtJgmgFiu3 N5sAn0alXSVMkPnX5MlFJlZHKJTn/t3q =PI5n -----END PGP SIGNATURE----- |
From: Andrea S. <si...@op...> - 2008-06-30 09:18:23
|
Hi Jean-Denis [cut] > No, it's failing in a more subtle way: when placing a call, it seems > that IAX events are not received correctly. For example, here is the > trace from my application (MozPhone, see http://moziax.mozdev.org/) when > a call is successfully placed (with my patched iaxclient-2.1beta3): > - ------------ > iaxc_initialize OK, 2 lines > WatchDogProc: cannot set watch dog priority 53 ! > WatchDogProc: cannot set watch dog priority 52 ! > WatchDogProc: cannot set watch dog priority 51 ! anyhow there's something that makes priority switching somekind problmeatic, am I right? you've to decrease priority 3 times before getting it set. > Looking for Plantronics cs60usb... [cut] > warning: The VAD has been replaced by a hack pending a complete rewrite [cut] > warning: The VAD has been replaced by a hack pending a complete rewrite why you need to load speex codec library twice? > As you can see IAX events are received as expected, call is successful. > Now here is what I get with original iaxclient-2.1beta3: > - --------------------- > iaxc_initialize OK, 2 lines [cut] > As you can see, IAX state event accepted is never received. I see :/ [cut] > Both systems where 2.6.25.x kernels, but one is 64bits-smp (base distro > is Mandriva-2008.1-64), the other is 32 bits (Mandriva cooker-32). Which one fails without the patch? Are those plain vanilla kernel (fetched from kernel org) or are they provided by rmps (yum)? I'm not very familiar with Mandriva's world, though it seems to me that coocker is the dev branch, isn't it? so maybe it could be something in the cooker toolchain that makes things a little bit "unstable". >>> I already reported same problem long ago, but maybe I'm the only one >>> affected by this... >>> http://sourceforge.net/mailarchive/message.php?msg_id=4366C3DF.2010308%40sysnux.pf >>> >> reading through this thread I've just noted you said >> that also portaudio/pa_unix_oss/pa_unix.c has to be changed. >> is this editing still needed? > > No, it is no longer needed. > > I know priorities permissions can be modified on Linux according to > limits.conf, but I think this is a real problem for Linux users, that my > proposed patch can solve. > > I just downloaded / tested binary iaxcomm-1.2.0: it fails to run as > normal user because it cannot set the watchdog priority, and runs fine > as root. Any chance to test this on a different machine with a different linux flavours? (cause I've never experienced such a bug both on Debian (etch/4.0)and Ubuntu (>=7.04)) Andrea |
From: Andrea S. <si...@op...> - 2008-07-01 07:38:58
|
Jean-Denis Girard wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > I've done some more testing, and I think I have a complete explanation. perfect! I love when strange phenomena get their explanation ;) > On the system where my patch is needed, the user I run as belongs to > group audio, and /etc/security/limits.conf shows: > @audio - rtprio 50 > When iaxclient is initialized iaxci_prioboostbegin sets priority to 49 > (sched_get_priority_min returns 0, sched_get_priority_max 99) without > error. Then StartWatchDog is called, which in turn calls WatchDogProc. > It tries to set priority to 53, which fails because of security limit. > If I change the rtprio limit to 60 for group audio, then setting > priority to 53 works fine. > On the other system, user does not belong to group audio, so it cannot > set real-time priority, StartWatchDog and WatchDogProc are never called, > then iaxclient works fine. it sounds like a good explanation > I think my patch does address a real problem, at least for Mandriva > users (and probably others), which won't be able to use iaxclient based > applications out of the box. I do agree! by the way I've just checked limits.conf setting on my ubuntu system (7.10 aka gutsy) and I've discovered that each line on that file is commented.... strange I wonder if the use other way to enforce the security policies that mandriva use to set through limits.conf Andrea |
From: Peter G. <jpg...@gm...> - 2008-07-01 17:33:07
Attachments:
iaxc-prioboost.patch
|
Jean-Denis, Thank you for your analysis of this problem. It was very helpful. Please apply the attached patch and let me know if it still resolves the problem you're observing. This patch fixes addresses a problem I saw in your previous patch where the priority of the watchdog thread might become lower than the priority of the canary thread. If that happened, the whole scheme would be bogus because the watchdog would never wake up to check the canary. This patch also addresses a memory leak of the prioboost structure and some style issues in unixfuncs.c. I apologize for not splitting the patch. Thanks, Pete |
From: Jean-Denis G. <jd....@sy...> - 2008-07-02 18:43:09
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Grayson wrote: | Jean-Denis, | | Thank you for your analysis of this problem. It was very helpful. | | Please apply the attached patch and let me know if it still resolves | the problem you're observing. Yes, problem is resolved by your patch. I've tested on both systems, it does work fine. | | This patch fixes addresses a problem I saw in your previous patch | where the priority of the watchdog thread might become lower than the | priority of the canary thread. If that happened, the whole scheme | would be bogus because the watchdog would never wake up to check the | canary. Ok. | | This patch also addresses a memory leak of the prioboost structure and | some style issues in unixfuncs.c. I apologize for not splitting the | patch. Thanks for your work. iaxclient-2.1 gives very good results, sound quality is much improved from the old version I was using. Regards, - -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iEYEARECAAYFAkhrzCIACgkQuu7Rv+oOo/ixRQCgm3rlO2pP85pdLxH88tPs920R fz0An3rZYAcveroQjehooQyEqzs35kH7 =2iZ/ -----END PGP SIGNATURE----- |
From: Peter G. <jpg...@gm...> - 2008-07-02 22:50:32
|
Hi Jean-Denis, Thank you for testing the patch. I have committed all of these changes to iaxclient/trunk (rev 1448). And thank you for reporting this problem. Pete On Wed, Jul 2, 2008 at 2:42 PM, Jean-Denis Girard <jd....@sy...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Peter Grayson wrote: > | Jean-Denis, > | > | Thank you for your analysis of this problem. It was very helpful. > | > | Please apply the attached patch and let me know if it still resolves > | the problem you're observing. > > Yes, problem is resolved by your patch. I've tested on both systems, it > does work fine. > > | > | This patch fixes addresses a problem I saw in your previous patch > | where the priority of the watchdog thread might become lower than the > | priority of the canary thread. If that happened, the whole scheme > | would be bogus because the watchdog would never wake up to check the > | canary. > > Ok. > > | > | This patch also addresses a memory leak of the prioboost structure and > | some style issues in unixfuncs.c. I apologize for not splitting the > | patch. > > Thanks for your work. iaxclient-2.1 gives very good results, sound > quality is much improved from the old version I was using. > > > Regards, > - -- > Jean-Denis Girard > > SysNux Systèmes Linux en Polynésie française > http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org > > iEYEARECAAYFAkhrzCIACgkQuu7Rv+oOo/ixRQCgm3rlO2pP85pdLxH88tPs920R > fz0An3rZYAcveroQjehooQyEqzs35kH7 > =2iZ/ > -----END PGP SIGNATURE----- > |
From: Jean-Denis G. <jd....@sy...> - 2008-06-30 20:43:01
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've done some more testing, and I think I have a complete explanation. On the system where my patch is needed, the user I run as belongs to group audio, and /etc/security/limits.conf shows: @audio - rtprio 50 When iaxclient is initialized iaxci_prioboostbegin sets priority to 49 (sched_get_priority_min returns 0, sched_get_priority_max 99) without error. Then StartWatchDog is called, which in turn calls WatchDogProc. It tries to set priority to 53, which fails because of security limit. If I change the rtprio limit to 60 for group audio, then setting priority to 53 works fine. On the other system, user does not belong to group audio, so it cannot set real-time priority, StartWatchDog and WatchDogProc are never called, then iaxclient works fine. I think my patch does address a real problem, at least for Mandriva users (and probably others), which won't be able to use iaxclient based applications out of the box. Andrea Suisani wrote: | Hi Jean-Denis | | [cut] | |> No, it's failing in a more subtle way: when placing a call, it seems |> that IAX events are not received correctly. For example, here is the |> trace from my application (MozPhone, see http://moziax.mozdev.org/) when |> a call is successfully placed (with my patched iaxclient-2.1beta3): |> - ------------ |> iaxc_initialize OK, 2 lines |> WatchDogProc: cannot set watch dog priority 53 ! |> WatchDogProc: cannot set watch dog priority 52 ! |> WatchDogProc: cannot set watch dog priority 51 ! | | anyhow there's something that makes priority switching | somekind problmeatic, am I right? you've to decrease | priority 3 times before getting it set. | | |> Looking for Plantronics cs60usb... | | [cut] | |> warning: The VAD has been replaced by a hack pending a complete rewrite | [cut] |> warning: The VAD has been replaced by a hack pending a complete rewrite | | why you need to load speex codec library twice? | |> As you can see IAX events are received as expected, call is successful. |> Now here is what I get with original iaxclient-2.1beta3: |> - --------------------- |> iaxc_initialize OK, 2 lines | | [cut] | |> As you can see, IAX state event accepted is never received. | | I see :/ | | [cut] | |> Both systems where 2.6.25.x kernels, but one is 64bits-smp (base distro |> is Mandriva-2008.1-64), the other is 32 bits (Mandriva cooker-32). | | Which one fails without the patch? | | Are those plain vanilla kernel (fetched from kernel org) or are they | provided by rmps | (yum)? | | I'm not very familiar with Mandriva's world, though it seems to me that | coocker is the dev branch, isn't it? so maybe it could be something | in the cooker toolchain that makes things a little bit "unstable". | | |>>> I already reported same problem long ago, but maybe I'm the only one |>>> affected by this... |>>> http://sourceforge.net/mailarchive/message.php?msg_id=4366C3DF.2010308%40sysnux.pf |>>> |>>> |>> reading through this thread I've just noted you said |>> that also portaudio/pa_unix_oss/pa_unix.c has to be changed. |>> is this editing still needed? |> |> No, it is no longer needed. |> |> I know priorities permissions can be modified on Linux according to |> limits.conf, but I think this is a real problem for Linux users, that my |> proposed patch can solve. |> |> I just downloaded / tested binary iaxcomm-1.2.0: it fails to run as |> normal user because it cannot set the watchdog priority, and runs fine |> as root. | | Any chance to test this on a different machine with a different | linux flavours? (cause I've never experienced such a bug both on | Debian (etch/4.0)and Ubuntu (>=7.04)) | | Andrea | Thanks, - -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iEYEARECAAYFAkhpRUMACgkQuu7Rv+oOo/jeEwCffKtr8xZaJFNtgtJ/vV/818C+ kRAAniWMEVArlypABsnVAd3oTSmlvWmo =kv6Q -----END PGP SIGNATURE----- |