iPhone OS Reference Library Apple Developer Connection spyglass button

iPhone SDK Release Notes for iPhone OS 3.1

Important: Installing iPhone OS 3.1 requires iTunes 8.2 and an internet connection.

Contents:

Bug Reporting
Known Issues and Fixes
HTTP Live Streaming Additions in iPhone OS 3.1
Enhancements to Core Audio in iPhone OS 3.1
New Feature in iPhone OS 3.1: Instruments over Wi-Fi
New Feature in iPhone OS 3.1 with Snow Leopard: VM Tracker


Bug Reporting

Please report any bugs not mentioned in the "Known Issues" using the Apple Bug Reporter on the Developer Connection website at: http://developer.apple.com/bugreporter/.

Known Issues and Fixes

Xcode/Developer Tools

Camera API additions

The following interfaces have been added to the UIImagePickerController class to allow more customized interactions with the camera.

The following methods have been added to the UIVideoEditorControllerDelegate protocol for video camera interaction (iPhone 3GS only):

For information about these new interfaces, please see the class reference documentation. Please also refer to the iPhone OS 3.1 API diffs on the iPhone Developer Portal.

Core Data

GameKit

Interface Builder

UITableView

UIViewController

HTTP Live Streaming Additions in iPhone OS 3.1

Failover support for HTTP live streaming

If the device fails to reload a playlist file when playing a stream (due to a 404 or a network error), it will remove the playlist URL from the list provided in the variant playlist and attempt to switch to the most suitable variant among those that remain. (If the variant playlist contains multiple variants with the same bitrate attribute, they are preferred in the order that they appear in the playlist.)

For example, a variant playlist might look like this:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000
http://one.example.com/lo/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000
http://two.example.com/lo/prog_index.m3u8
 
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000
http://one.example.com/md/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000
http://two.example.com/md/prog_index.m3u8

If a device playing one.example.com/lo/ fails to reload prog_index.m3u8 it will remove http://one.example.com/lo/prog_index.m3u8 from the variant list and attempt to switch to http://two.example.com/lo/prog_index.m3u8 .

If it was playing one.example.com/md/ it would attempt to switch to http://two.example.com/md/prog_index.m3u8 (assuming the current bandwidth measure supports it).

The switch should be seamless if one and two are serving segment files created from the same encoded stream. If they are serving segments from different encoders there will be a glitch similar to one found when two variants do not have the same audio stream.

Playback will stop if all variant playlists have been removed.

Discontinuity tag

The EXT-X-DISCONTINUITY tag indicates that the media file following it has different characteristics than the one that preceded it. The set of characteristics that may change is:

For the iPhone, we do not recommend changing encoding parameters.

Audio-only with poster image

It's now possible to deploy an audio-only stream that carries a poster-image that the player will display in lieu of video. The audio-only stream would carry a JPEG or PNG image within an APIC frame in an ID3 tag, preferably at the start of each segment. The APIC frame must have Picture Type of $10 (Movie/Video screen capture).

Enhancements to Core Audio in iPhone OS 3.1

Core Audio now includes the following capabilities:

New Feature in iPhone OS 3.1: Instruments over Wi-Fi

As of iPhone OS SDK 3.1, it is now possible to connect to your developer devices from Instruments (on your Leopard or Snow Leopard OS X machine) using Wi-Fi rather than the USB tether. The Wi-Fi connection is 100% fully featured and supports all of the instrumentation you would normally get over the tether. It is intended for use by developers who need to attach other USB devices to their iPhone OS–based device while doing their performance analysis. The feature may also be used in situations where having the USB tether is simply impractical or inconvenient.

If you do not need to attach other USB devices, the USB connection is still preferred for general usage. The Wi-Fi connection is slower than the USB connection and requires more power from the device to accommodate the heavy Wi-Fi traffic that can come from Instruments. As a result, using the Wi-Fi connection will drain the device's battery more rapidly than other scenarios. In addition, you cannot install applications on your device from Xcode over Wi-Fi, nor can you debug them over Wi-Fi using Xcode. You must still use the USB tether to connect to the device using Xcode.

To use this Instruments feature, both your Macintosh computer and your iPhone OS device must have Wi-Fi enabled and must be connected to the same Wi-Fi access point. This access point must be enabled for Bonjour services. Once these conditions are met, you may establish a Wi-Fi connection using the steps described in the following sections.

Enabling Wireless Connectivity

To enable wireless connectivity to your device, do the following:

  1. Connect a USB cable from your Macintosh computer to your device. (Your computer must have the iPhone OS 3.1 Developer SDK installed.)

  2. Launch Instruments if it is not already running.

  3. Open a new trace document or template.

  4. While holding down the "Option/Alt" key, mouse click on the target chooser popup in the upper left of the Instruments Trace Document window.

  5. The iPhone device should display as "Enable <Your device name> - Wireless" which you should select. If you do not see this, it is likely that the device does not have a Wi-Fi connection active.

  6. Wait a few moments for a new device to be displayed in the target chooser, named "<Your device name> Wireless." This may take several seconds depending on the device and Wi-Fi connection, and the new device entry may be shown as disabled until the connection is fully established. If the device entry does not become enabled after several seconds it is likely that your Wi-Fi access point is not enabled for Bonjour traffic.

  7. At this point, you have two Instruments servers running on your device: one running over Wi-Fi and one running over the USB tether. Because both servers consume memory, you should disconnect the USB tether as soon as you have your application installed on the device. (Disconnecting the tether terminates the USB-based Instruments server.)

  8. You are now ready to start using Instruments over Wi-Fi.

Using Instruments Wirelessly

After establishing a wireless connection, you may use your device with Instruments as if it was connected over USB. (You may also continue using the USB connection with Instruments if you did not disconnect it.) If you quit Instruments or put your device to sleep, you will still be able to re-connect to Instruments wirelessly later as needed. Simply relaunch Instruments and make sure the network connectivity conditions described earlier are present.

When you are done using the wireless connection, you should either reboot your device or use Instruments to disable the "Wireless" connection in order to reclaim the memory used by the server and reduce the power consumption. Either course of action will turn off the "Wireless" feature and server until you re-enable it from Instruments.

Disabling Wireless Connectivity

To disable wireless connectivity from Instruments, do the following:

  1. Open a new trace document or template.

  2. While holding down the "Option/Alt" key, mouse click on the target chooser popup in the upper left of the Instruments Trace Document window.

  3. The iPhone "Wireless" device should appear as "Disable <Your device name> - Wireless". Select this entry to disable the wireless connection. After a few seconds the "Wireless" entry in the target chooser will dim, at which point the "Wireless" connection and server is terminated. If you do not see this entry, it is likely that the device does not have an active Wi-Fi connection.

Known Issues with Wireless Instruments

If wireless connectivity has been enabled and you quickly quit and then restart Instruments, the wireless device may not show up immediately. You may need to disable and then reenable wireless connectivity for the device in question.

New Feature in iPhone OS 3.1 with Snow Leopard: VM Tracker

Instruments in SnowLeopard introduces a new memory analysis instrument for both Mac and iPhone: VM Tracker. If you are using iPhone OS 3.1 with Snow Leopard, you will be able to use this new feature.

The VM Tracker instrument is designed to report on a target process' virtual memory space, showing all of the regions mapped into the address space along with information and statistics relevant to the mapping type. For example, a region that is a memory-mapped file via an mmap call will show as a "mapped file" region and display the path for the file it references. Instruments shows size statistics for each region as well: virtual, resident, and dirty.

Views

The VM Tracker instrument provides two top-level views:

  1. Summary view - This view shows the total amount of memory by region type. Individual regions are grouped by region type and show their contribution to the type's overall usage statistics. This view is primarily useful as an overview of how a process' memory is being used, and it is recommended that special attention is paid to the "dirty" sizes, as these represent memory that must be paged to disk under memory pressure on Mac OS X and are completely unreclaimable memory on iPhone OS.

  2. Regions Map view - This view displays the regions in the target process individually by address, showing type, address, protections, and sizes for the regions. This view helps reveal the layout of regions in the process' address space and provides similar information as the command-line tool vmmap—for more details about this tool, see the vmmap man page (man 1 vmmap). Each region's address field in the Regions Map view has a focus button; focusing on a region will provide a list of pages in that region along with whether or not they're resident, dirty, speculative, or swapped.

The track view for the VM Tracker instrument shows a stacked display of Dirty and Resident sizes, with an alternate display available for showing the number of regions in the process.

Instrumentation Impact

VM Tracker is completely external to the target process and gathers its information by periodically taking a snapshot of the process' virtual memory. This means that it doesn't interfere with the target's execution except during the snapshotting period; while a snapshot is being taken, the target must be completely suspended.

Usage

This instrument is now included in the "Object Allocations" template to help provide a high-level view of a process' total active memory usage; the ObjectAlloc instrument in this template tracks malloc type memory exclusively. However, due to the necessary suspension of the target's execution for the duration of the snapshot, the "Automatically Snapshot" feature of the VM Tracker instrument is off by default in this template. Users wishing to acquire information with this instrument will need to manually click "Snapshot Now" or enable the automatic snapshot feature.

Also...

VM Tracker is also available from the Instruments library and can be added to any document when targeting a single process on Mac OS X, the iPhone OS, or the iPhone Simulator platforms. When added from the library, the "Automatically Snapshot" feature is enabled by default with a starting interval of snapshotting every three seconds.

For more information, consult the man pages for vmmap(1), mmap(2), and the headers <mach/vm_map.h>, <mach/vm_statistics.h>.



Last updated: 2009-08-27

Did this document help you? Yes It's good, but... Not helpful...