Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
03-28-2012, 01:19 PM #1Solving iPhone 3GS Wifi Lag / Latency - Improving stack or Killing Processes?
Lately I have been trying to use an app called rtpMIDI to send midi messages (using UDP) to the iPhone over Wifi. This is with my iPhone 3GS (ios 5.0.1) running a CoreMIDI application such as "Argon" or Sampletank Free.
The problem is there is terrible latency, like 0.5sec delays before the note is played. I am using a dedicated router with only my computer and the phone connected to it. I have also tested the wifi by running rtpMIDI on my netbook (since two rtpMIDI clients can connect to each other) and the MIDI streaming is perfect.
So this brings me to the topic subject, since I've identified that there is a problem only on the iPhone, is there any way I can reduce the wifi latency?
One theory I had is it may be background processes like iCloud, Email checking, iMessage checking, and other notifications that are trying to access data over wifi and are clogging the signal. Is there anyway I can kill these background services until reboot?
Any help is really appreciated, thanks.
Last edited by Qjimbo; 03-28-2012 at 01:38 PM.
03-28-2012, 01:38 PM #2
I don't know about until reboot, but u can turn those things off manually...
03-28-2012, 02:41 PM #3
Well notifications are a pain to toggle on and off on iOS 5 since there's no global on/off switch any more, and I'm pretty sure the iMessage and email checking is going to run in the background regardless. I did however find a neat program called "KillBackground" that lets you kill all the apps that run in the background (the ones you see double tapping the home button), but even after killing all those there was no difference. Just wish I could boot my iPhone into an "iPod touch" kind of mode.
That being said it's all just a theory, there might be something more low level that's wrong with the wifi.
03-28-2012, 04:16 PM #4
Imessage can be toggled off...yeah notifications is a pain...r u sure it's using wifi and not Bluetooth?...
03-28-2012, 04:25 PM #5
Yeah it uses UDP on Port 5004 over WiFi, bluetooth is disabled on my phone. I was looking to see if it could be done through the DataCable instead but unfortunately there's no easy way to tunnel UDP ports through the Datacable, only TCP ports.
03-28-2012, 04:30 PM #6
Yeah that sucks...hmmm...
Do u have blobs for 4.x?...did it work on 4.x?..
03-28-2012, 04:32 PM #7
Never tried it on iOS 4.x unfortunately... don't particularly want to downgrade my whole phone on a whim either.
03-28-2012, 04:40 PM #8
You might want to consider getting "TCP Optimizer", I've used this to open up the network settings (abit like you used to do with windows xp with the half open connections), you might find that delay comes down afterwards. I've used & tested on my devices for a long time now do... Might help you
The repo is http://cydia.pushfix.info/
03-28-2012, 04:46 PM #9
Good suggestion, but I forgot to mention I already have TCP Optimizer installed. It did improve things a little bit, but not much. Probably because it's UDP.
03-28-2012, 04:57 PM #10
Yeah.... The iPhone has UDP limits I seem to recall... Is it imperative to use UDP?
03-28-2012, 05:00 PM #11
Hmm, I wonder why there's limits? As for your questions the CoreMIDI spec relies on udp afaik, there's loads of apps that all support CoreMIDI (list here) so whenever one of these apps is running they open up port 5004 udp, I don't know if there's some way to translate it into tcp.
03-28-2012, 05:14 PM #12
Or is it possible to send smaller packets but more of them?
Sorry, not too familiar with the software but I'll take a look at the link if I can Always like a good challenge where networks are concerned Can't promise much mind
03-28-2012, 05:19 PM #13
That would be really cool, and I think it is an interesting challenge, the URL for the software is here: rtpMIDI
Unfortunately it isn't open source but there might be some way around that like a proxy, I dunno.
Sampletank Free is the only free app I know of off hand that supports CoreMIDI, there may be others in that list I linked to before if you want to do some testing yourself.
03-28-2012, 05:26 PM #14
I'm sure I can find something similar that's open source or I can find a program that'll send data upon that port as it's quite a well used one in general I'll keep ya posted.
03-29-2012, 02:48 AM #15
just noticed this thread here and thought, I'd chime in on the subject...
RTP-packets which are again based on UDP.
Using TCP for realtime-communication makes not much sense. If you loose a packet and need to take long roundtrips
to request retransmission, the time-frame when this packet will finally arrive is just too late for the real-time constraints.
That is the reason why all the VoIP-stuff is using RTP (and thus UDP) for transmitting media-data.
establish a connection) to transmit MIDI-data.
So you cannot use just any application that sends/receives data on/from this port. rtpMIDI has been developed exactly for the
purpose of connecting via network-MIDI to OS X and iOS devices.
03-29-2012, 04:00 AM #16
03-29-2012, 04:38 AM #17
the question to ask you then would be what the chances are of making the packets that it sends slightly smaler, therefore meaning that they are more in the iphone's 41k range also
to send to the iOS device. The iOS/OS X implementation might package multiple MIDI-commands into a single RTP-MIDI
packet, but since each of those commands is either 1, 2 or 3 bytes long, that does not make much difference...
Would you be able to shed any light on UDP through a datacable?
that connect to the dock-connector to go cable-based...
03-29-2012, 10:28 AM #18
Thanks for your insights Tobias - no doubt you've figured out I'm the same guy who was emailing you about this before! So we've established that the packets are already within the iPhones limitation... but we still have a mystery on our hands here as to why it takes so long for the iPhone to process these UDP packets via WiFi.
07-20-2012, 02:11 PM #19Current Status Update
It's been a few months, with no progress on this so I thought I'd give it a bump, and just an end summary of the still outstanding questions in this topic.
If anyone can provide help in the following possible ways of solving this problem that would be great.
If possible, how can I:
* Kill all Background Processes on iPhone such as Notifications, iMessage, etc. till Reboot?
* Use UTP over the Data Cable instead of WiFi?
* Reduce WiFi latency in general / Optimize WiFi Performance
* Avoid this latency issue in general.
Thanks. I would still really appreciate any help people can offer on this.