Results 1 to 19 of 19

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Solving iPhone 3GS Wifi Lag / Latency - Improving stack or Killing Processes?

  1. #1
    Question Solving iPhone 3GS Wifi Lag / Latency - Improving stack or Killing Processes?
    Hi all,

    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.

  2. #2
    Livin the iPhone Life xboxbml's Avatar
    Join Date
    Apr 2011
    Location
    US-MI
    Posts
    1,286
    Thanks
    0
    Thanked 64 Times in 61 Posts

    I don't know about until reboot, but u can turn those things off manually...

  3. #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.

  4. #4
    Livin the iPhone Life xboxbml's Avatar
    Join Date
    Apr 2011
    Location
    US-MI
    Posts
    1,286
    Thanks
    0
    Thanked 64 Times in 61 Posts

    Imessage can be toggled off...yeah notifications is a pain...r u sure it's using wifi and not Bluetooth?...

  5. #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.

  6. #6
    Livin the iPhone Life xboxbml's Avatar
    Join Date
    Apr 2011
    Location
    US-MI
    Posts
    1,286
    Thanks
    0
    Thanked 64 Times in 61 Posts

    Yeah that sucks...hmmm...

    Do u have blobs for 4.x?...did it work on 4.x?..

  7. #7
    Never tried it on iOS 4.x unfortunately... don't particularly want to downgrade my whole phone on a whim either.

  8. #8
    My iPhone is a Part of Me Susty's Avatar
    Join Date
    Sep 2011
    Location
    Europe
    Posts
    785
    Thanks
    9
    Thanked 100 Times in 99 Posts

    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/

  9. #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.

  10. #10
    My iPhone is a Part of Me Susty's Avatar
    Join Date
    Sep 2011
    Location
    Europe
    Posts
    785
    Thanks
    9
    Thanked 100 Times in 99 Posts

    Yeah.... The iPhone has UDP limits I seem to recall... Is it imperative to use UDP?

  11. #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.

  12. #12
    My iPhone is a Part of Me Susty's Avatar
    Join Date
    Sep 2011
    Location
    Europe
    Posts
    785
    Thanks
    9
    Thanked 100 Times in 99 Posts

    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

  13. #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.

  14. #14
    My iPhone is a Part of Me Susty's Avatar
    Join Date
    Sep 2011
    Location
    Europe
    Posts
    785
    Thanks
    9
    Thanked 100 Times in 99 Posts

    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.

  15. #15
    Hi everyone,

    just noticed this thread here and thought, I'd chime in on the subject...

    Quote Originally Posted by Susty View Post
    Yeah.... The iPhone has UDP limits I seem to recall... Is it imperative to use UDP?
    Actually it is. The RTP-MIDI ( RFC 4695 / 6295 ) protocol that Apple is using for both iOS & OS X is based on
    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.


    Quote Originally Posted by Susty View Post
    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.
    Like I wrote above, Core MIDI uses the public RTP-MIDI specification (and a proprietary lightweight session protocol to
    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.

    Tobias

  16. #16
    My iPhone is a Part of Me Susty's Avatar
    Join Date
    Sep 2011
    Location
    Europe
    Posts
    785
    Thanks
    9
    Thanked 100 Times in 99 Posts

    Quote Originally Posted by to-pse View Post
    Hi everyone,

    just noticed this thread here and thought, I'd chime in on the subject...



    Actually it is. The RTP-MIDI ( RFC 4695 / 6295 ) protocol that Apple is using for both iOS & OS X is based on
    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.




    Like I wrote above, Core MIDI uses the public RTP-MIDI specification (and a proprietary lightweight session protocol to
    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.

    Tobias
    Cheers for the heads up there squire Ok, so as you seem to have some knowledge upon the software at hand, 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

    Quote Originally Posted by Qjimbo View Post
    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.
    Would you be able to shed any light on UDP through a datacable?

    Cheers

  17. #17
    Quote Originally Posted by Susty View Post
    Cheers for the heads up there squire Ok, so as you seem to have some knowledge upon the software at hand
    Well - I should, as I have actually developed this software ;-)

    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
    Actually RTP-MIDI packets are pretty small. My driver sends an RTP-packet for each single midi-command that I want
    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?
    Well - that would render the cable-less aspect useless, but one can always buy one of the iPhone/iPad MIDI-interfaces
    that connect to the dock-connector to go cable-based...

    Best regards,
    Tobias

  18. #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.

    Quote Originally Posted by to-pse View Post
    Well - that would render the cable-less aspect useless, but one can always buy one of the iPhone/iPad MIDI-interfaces
    that connect to the dock-connector to go cable-based...
    I'd prefer to avoid spending around $100 for the iRig MIDI and a MIDI-USB adaptor if possible...

  19. #19
    Default Current 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.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •