|
Is it worth it?
I am writing a lib that do shape operation (shape being like polygon, just with bezier curve for contour instead of lines)
I have a lot of custom Math code, including custom Point2D, Vecto2D and Matrix3x2 and today.. I just saw that System.Numerics is such a library with such types but hardware accelerated (SIMD) maths.
Since my lib is quite performance intensive I wonder if it is worth rewriting?
Any link on performance guide and comparison with Numerics.Vectors?
I found some post on the internet where people had bad experience an unexpectedly worst performance with it.....
modified 29-Apr-18 20:59pm.
|
|
|
|
|
Hi All,
I am working on a project using c# .net and its related to connecting to device and streaming the information over the network . We are using RTSP protocol for connecting to that device. We have developed code using media-player-vlc, while testing the code we have observed a strange behavior , where we are able to play local file and public streaming url. where as when we try with our customer url. its giving the below error. the same url when we try to play using VLC media player its working fine.
[0b7204c0] live555 demux error: Failed to connect with rtsp:
[0b7204c0] live555 demux error: TCP rollover failed, aborting
Could any one please update me on this.
|
|
|
|
|
That is most probably a problem with the network configuration on a router or the firewall on the server that blocks traffic from/to specific IPs and/or ports (assuming that the service at your customer URL is up).
Ensure first that the service is up testing it locally or from a client in the same (local) network segment. Once that is working check the configuration of the router that connects the server to the internet. If that provides logs, check those too. Ensure that the IP and port from the URL are allowed for UDP.
|
|
|
|
|
Hi Jochen ,
thanks for the quick response, I agree with you and tried by playing same url in VLC media player. If this is because of network issue, the same url should not work through VLC Media Player.
But its working. Not sure , whether is there anything which is blocking in libVLC.dll.
When I try to debug into code.. i found the following code is causing issue.
https://github.com/Tilka/vlc/blob/master/modules/demux/live555.cpp
else if( !p_sys->b_multicast && !p_sys->b_paused &&
p_sys->b_no_data && ( p_sys->i_no_data_ti > 34 ) )
{
bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) ||
var_GetBool( p_demux, "rtsp-http" );
if( !b_rtsp_tcp && p_sys->rtsp && p_sys->ms )
{
msg_Warn( p_demux, "no data received in 10s. Switching to TCP" );
if( RollOverTcp( p_demux ) )
{
msg_Err( p_demux, "TCP rollover failed, aborting" );
return 0;
}
return 1;
}
msg_Err( p_demux, "no data received in 10s, aborting" );
return 0;
}
Do we need to change anything to overcome this?
Best Regards
|
|
|
|
|
If it is working with the VLC media player it is not a general network issue.
But I think you are debugging at the wrong location. The above code (and the error message) tells you there was a failure to connect using UDP and a fallback to TCP has been initiated which is also failing.
I'm sorry that I can't help more. I even think that debugging will not help much with such connection timeout errors. All I can suggest is asking at the GitHub project site.
|
|
|
|
|
Thanks Jochen for your time and effort
|
|
|
|
|
Hi Jochen,
After lot of analysis found the root cause of the issue but don't know how to fix this issue.
In VLC Media player , its working , because , we explicitly set Live 555 Stream transport to RTP Over RTSP(TCP), due to this the streaming is working and able to view the video.
But same way not sure how to set this option to below code
IMedia media = m_factory.CreateMedia<imedia>(rtspAddress);
//media.AddOptions(new List<string>() {output });
//media.AddOptions(mediaOptions);
m_player.WindowHandle = p.Handle;
m_player.Open(media);
//media.Parse(true);
m_player.Play();
could you please suggest us on this.
thanks in advance.
|
|
|
|
|
So we are working on a project that involves creating a simple mobile application using Xaml and C#. We are done with the design but we are having difficulties programming the calculator.
Here in the UAE we have 5% Tax on some goods, so we want the users to be able to enter the items price to see how much it will be after adding the 5% tax and the amount added to it.
For example, a user wants to be a 250 AED item and used the App to see how much it would cost with taxes so once they input the item price and hit the calculate button they will see the price with taxes and how much was added to the original price.
FYI: I am a beginner at this and just taking a course with C# fundamentals I really could use someones help with this.
Regards
|
|
|
|
|
Assuming the user inputs via a TextBox:
decimal price;
if (!decimal.TryParse(userInputPriceTextBox.Text, out price))
{
... report problem to user ...
return;
}
decimal total = price * 1.05m; You can then display the total any way you wish...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Console.WriteLine("Enter the price of item");
double price = double.Parse(Console.ReadLine());
double totalPrice = ((price * 5) / 100 + price);
Console.WriteLine("Total price of the item " + totalPrice);
|
|
|
|
|
Unfortunately stack overflow just crash / exit the program when they happen in UWP App. It can't be caught and broke into with the debugger. At least it looks like it (using Visual Studio 2017 professional).
I enabled mixed mode debugging, enabled all exception, native exceptions, managed assistance, downloaded MS symbols, etc...
Whatever I do the program gently churn along and then ... close suddenly.
All I have left is this post mortem line in the debug output:
The thread 0x1ce4 has exited with code -2147023895 (0x800703e9).
I have been scratching my head all day for that. Unfortunately, I have a few weeks of changes that were not tested and I am a bit lost as to what could cause that... Plus it might have been there before anyway...
Any idea on how to track what could be the cause of that?
As a side note my app is compiled for x64. I also tried to compile for x86. Same results.
Unfortunately there is no MSIL targets possible for UWP, apparently... (Which, I imagine, would offer better debugging regarding StackOverflow)
[EDIT]
The plot thickens though.
I just tried a simple test UWP App where I changed the constructor as follow:
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
var u = Moo(42);
}
public static int Moo(int seed)
{
var r = new Random(seed);
var next = r.Next();
if (next == 0)
return seed;
return Moo(next);
}
And the debugger successfully broke on my code... Somehow I have some suspicion on the UI code... but I didn't set the model at all in one test, i.e. no model or data context => no binding and update, stumped....
modified 28-Apr-18 12:07pm.
|
|
|
|
|
Stackoverflow usually means you have some recursive code that is consuming all the space.
|
|
|
|
|
yeah... but which code? that is exactly my question?
I feel asleep reading the last month of commit...
And VS doesn't stop when the stack overflow happen, so I dunno where it is..
It's where I need a tip. How to break on the damn recursive code?
|
|
|
|
|
Super Lloyd wrote: but which code? that is exactly my question? Of course it is, but only someone who knows the code can figure it out.
|
|
|
|
|
Do you think you can add something that will actually help?!
modified 27-Apr-18 9:57am.
|
|
|
|
|
well you don't know where the stack overflow occurs.
|
|
|
|
|
|
If you have access to an AOP system, it is probably worth decorating your method calls with pre and post logging to see which methods are being called and not returned from.
This space for rent
|
|
|
|
|
Mm.. thanks, that's an idea worth investigating!
|
|
|
|
|
Just a thought, but check through your property setters. You are looking for instances where the setter uses the property name in place of the member. Something like this
private int myInt;
public int MyInt
{
set { MyInt=value; }
}
This space for rent
|
|
|
|
|
I thought about it...
It's just, it's a lot of code to review for a shot in the dark... damn VS let me down there!
|
|
|
|
|
H, Lloyd,Quote: but which code? that is exactly my question? Knowing you to be an advanced programmer capable of impressive work, like your serializer, I think you must have some ideas about where in the code the recursion, or whatever, occurs.
Could you a counter-incrementing snippet in those places, and, when some reasonable limit was reached, hit a break=point ?
Sorry for the vagueness of all this, but, without a detailed over-view of the code ... it's all I got
cheers, Bill
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Thanks Bill!
Yea that was my thought and wrote such a utility / debugging helper method!
But then I thought, damn, being a shot in the dark I have to put in so many places...
I was thinking about it today (from the comfort of my home..) and.. I hardly can think of any place with recursion in the code...
|
|
|
|
|
Give your threads a name when creating one. It makes debugging a whole lot easier
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
It's so 2000 and late!
Now with Task madness, that doesn't work so well!
|
|
|
|