|
From: Tim R. <ti...@pr...> - 2021-07-09 23:18:01
|
Matt wrote: > > I am trying to stream a video file to a MCU, but whenever it plays the > video on the device it's stuttering pretty moderately. If I use my PC > whilst streaming, it gets considerably worse. > > For example, if I am streaming and then I scroll through chat history > in say, Discord, the stuttering becomes much, much worse which is > incredibly strange, but may be a key factor in finding the root of the > problem. > > NOTE: We must stream 2352 bytes in 512 byte chunks (this is for the > ISO9660 disc video format I am streaming and is critical to the system > that is playing it so do not think that this is the problem or error). You're sending 512 bytes in each request, and you're sending them synchronously, so you wait for completion before posting the next. You can't do streaming that way. The problem is, you don't get notification that the request completed until the end of the frame, and by the time you turn around and submit another, you've missed the next frame. You HAVE to have a request ready and waiting at all times. That may mean you have to go to asynchronous processing. If your interrupt endpoint has a 512-byte max packet size, then you can send a much larger buffer, and the host controller will chop it up into 512-byte packets for you. Just that one change will help considerably, because you'll be able to catch 5 frames in a row without requiring a trip out to user mode. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |