CROSS REFERENCE TO RELATED APPLICATIONS This application is a continuation of U.S. patent application Ser. No. 10/923,549, filed Aug. 20, 2004, entitled “HOT UNPLUGGABLE MEDIA STORAGE DEVICE,” which is hereby incorporated herein by reference, which is a continuation of U.S. patent application Ser. No. 10/277,388, filed Oct. 21, 2002, entitled “HOT UNPLUGGABLE MEDIA STORAGE DEVICE,” now U.S. Pat. No. 6,799,226, which is hereby incorporated herein by reference, and which claims the priority benefit of U.S. Provisional Application No. 60/398,192, filed Jul. 23, 2002, and entitled “HOT UNPLUGGABLE MEDIA STORAGE DEVICE,” which is hereby incorporated herein by reference.
This application is related to (i) U.S. patent application Ser. No. 10/118,217, filed Apr. 5, 2002, and entitled “MEDIA PLAYER WITH INSTANT PLAY CAPABILITY,” now U.S. Pat. No. 6,934,812, which is hereby incorporated herein by reference, and (ii) U.S. patent application Ser. No. 10/118,069, filed Apr. 5, 2002, and entitled “INTELLIGENT SYNCHRONIZATION OF MEDIA PLAYER WITH HOST COMPUTER,” which is hereby incorporated herein by reference. This application is also related to U.S. Pat. Nos. 6,121,967 and 6,311,242, which are hereby incorporated herein by reference.
BACKGROUND OF THE INVENTION 1. Field of the Invention
The present invention relates to computer systems and, more particularly, to peripheral devices for computer systems.
2. Description of the Related Art
Peripheral devices are often used to supplement the resources of computer systems. One type of peripheral device is a removable storage media device (or portable storage media device) that provides data storage for a computer system. More particularly, computer systems often connect to one or more removable storage media drives to provide additional data storage for the computer systems. These storage media drives can, for example, be a floppy drive, a Compact-Disc (CD) drive, a hard drive, a removable card drive or a Digital Video Disc (DVD) drive. Such drives can be inserted into media bays of portable computer systems or can be separately housed peripheral devices.
Physically connecting a peripheral device to a computer system requires the electrical connection of the peripheral device to the computer system. The electrical connection is achieved with at least one connector. The connector supplies various signals, including address, data, power, and various other signals, between the peripheral device and the computer system. A first half of the connector resides on a cable of the peripheral device or on a housing of the peripheral device, and a second half of the connector resides on the housing of the computer system or on a cable of the computer system. An insertion action involves the connection of the first half of the connector on the cable or housing of the peripheral device with the second half of the connector on the cable or housing of the computer system. By coupling the two devices using at least one connector, the computer system is able to use the resources of the peripheral device. A removal action involves disconnection of: (i) the first half of the connector from the cable or housing of the peripheral device, (ii) the second half of the connector from the cable or housing of the computer system, or (iii) the first half of the connector from the second half of the connector.
Recently, techniques have been developed that allow the insertion and removal of peripheral devices from external slots or connectors of a computer system while the computer system is active. This is generally referred to as “hot plugging” or “hot unplugging.” These techniques prevent electrical damage to the components but are often unable to configure the software structures needed by the operating system in order to utilize the peripheral device.
The removal of a peripheral device that provides data storage, namely, a storage media device, is particularly problematic because data can be lost or corrupted. Even if the storage media drive is not being accessed when the storage media drive is removed, the storage media drive is available for use by the computer system. In such cases, data can be lost or damaged by the removal of the storage media drive.
Hence, prior to removal of a storage media drive, it has been necessary to first inform the operating system of the computer system to prepare the storage media drive for removal. If, instead, a user were to remove the storage media drive without first getting approval from the operating system, then either data on the storage media drive was possibly lost or corrupted or the user was required to reinsert the storage media drive into the computer system so that the operating system can prepare it for removal. For example, once a storage media drive has been made available to a computer system, the storage media drive can be “locked” to encourage against incorrect removal of the storage media drive. In general, the “lock” operates to halt processing and to inform the user that they have removed a “locked” storage media drive which should be reinserted to prevent possible data loss. Hence, if a “locked” storage media drive were to be removed without first being “unlocked,” the user would be encouraged with a visual warning to re-attach the storage media drive so that its removal can be safely managed.
Conventionally, insertion of a connector affiliated with a storage media drive would cause a host computer to mount the storage media drive with respect to the file system of the host computer. However, in order to remove the peripheral storage unit, an icon representing the storage media drive could be selected and dragged using the graphical user interface to a trashcan icon, thereby requesting disconnection. Alternatively, an eject command can request disconnection. In either case, the storage media drive would then be unmounted and disconnected.
When a peripheral device is coupled to a host computer and locked thereto, if the device is removed (i.e., disconnected) without requesting disconnection, a warning can be displayed to notify the user of their improper removal of the device and to request its reinsertion. Hence, conventional approaches merely notify the user that the device should not be removed or, if already removed, should be reconnected. Unfortunately, however, users expect devices to be able to be removed at any time they find it to be convenient. Accordingly, the conventional solutions to the removal of such devices are inadequate because they lead to consumer frustration and possibly loss of data. Furthermore, even with the warnings, users may disregard or ignore the warnings or request. Accordingly, there is a need for improved solutions to facilitate removal of peripheral devices (e.g., removable storage media devices) from its host computer system.
SUMMARY OF THE INVENTION Broadly speaking, the invention relates to improved techniques for rendering a peripheral device removable (e.g., unpluggable). According to one aspect of the invention, the peripheral device is rendered removable from a host computer without preparatory user actions. In effect, the peripheral device can be automatically prepared for removal in the event that its user removes (unplugs) it from its host computer. According to another aspect of the invention, the peripheral device includes a data storage device that is mounted to a file system of the host computer when the host computer desires access to the data storage device. Otherwise, the data storage device is normally unmounted so that if the peripheral device were to be removed (e.g., unplugged) no harm or damage to data stored therein would occur. These aspects of the invention can be utilized alone or in combination with one another. The invention is particularly well suited for peripheral devices that are media players which are resulting “hot” unpluggable without detrimental consequences.
The invention can be implemented in numerous ways, including as a method, system, device, and computer readable medium. Several embodiments of the invention are discussed below.
As a computer readable medium including at least computer program code for accessing a portable electronic device by a host computer over a data link, the portable electronic device having at least storage capability for storing media data, one embodiment of the invention includes at least: computer program code for receiving, at the host computer, an indication that the portable electronic device has been attached to the host computer via the data link; computer program code for logically connecting the portable electronic device to a file system of the host computer once the indication that the portable electronic device has been attached to the host computer has been received; computer program code for performing first processing at the host computer which accesses the portable electronic device provided the portable electronic device is attached to the host computer via the data link; and computer program code for logically disconnecting the portable electronic device from the file system without detaching the portable electronic device from the host computer via the data link, the logically disconnection being performed automatically after completing performance of the first processing which accesses the portable electronic device.
As a computer capable of accessing a portable electronic device, the portable electronic device having at least a bus for data transfer and a storage device for storing media content, one embodiment of the invention includes at least: means for detecting presence of the portable electronic device on the bus associated with the computer; means for mounting the storage device of the portable electronic device with a system of the computer; means for accessing the storage device over the bus to perform initial processing; and means for unmounting the storage device of the portable electronic device from the system of the computer once the initial processing is completed.
As a computer capable of accessing a handheld electronic device, the handheld electronic device having at least a bus for data transfer and a data storage device for storing data, one embodiment of the invention includes at least a file system for storage of data, and a processor. The processor is configured to (i) detect presence of the handheld electronic device on the bus associated with the computer, (ii) mount the data storage device of the handheld electronic device with the file system of the computer, (iv) access the data storage device over the bus to perform initial processing; and (v) unmount the data storage device of the handheld electronic device from the file system of the computer once the initial processing is completed.
Other aspects and advantages of the invention will become apparent from the following detailed description taken in conjunction with the accompanying drawings which illustrate, by way of example, the principles of the invention.
BRIEF DESCRIPTION OF THE DRAWINGS The invention will be readily understood by the following detailed description in conjunction with the accompanying drawings, wherein like reference numerals designate like structural elements, and in which:
FIG. 1 is a block diagram of a remote media access system according to one embodiment of the invention.
FIG. 2 is a block diagram of a remote media access system according to one embodiment of the invention.
FIG. 3 is a block diagram of a media player according to one embodiment of the invention.
FIG. 4 is a flow diagram of media access processing according to one embodiment of the invention.
FIGS. 5A and 5B are flow diagrams of media access processing according to another embodiment of the invention.
DETAILED DESCRIPTION OF THE INVENTION The invention pertains to improved techniques for rendering a peripheral device removable (e.g., unpluggable). According to one aspect of the invention, the peripheral device is rendered removable from a host computer without preparatory user actions. In effect, the peripheral device can be automatically prepared for removal in the event that its user removes (unplugs) it from its host computer. According to another aspect of the invention, the peripheral device includes a data storage device that is mounted to a file system of the host computer when the host computer desires access to the data storage device. Otherwise, the data storage device is normally unmounted so that if the peripheral device were to be removed (e.g., unplugged) no harm or damage to data stored therein would occur. These aspects of the invention can be utilized alone or in combination with one another. The invention is particularly well suited for peripheral devices that are media players which are “hot” unpluggable without detrimental consequences.
Embodiments of this aspect of the invention are discussed below with reference toFIGS. 1-5B. However, those skilled in the art will readily appreciate that the detailed description given herein with respect to these figures is for explanatory purposes as the invention extends beyond these limited embodiments.
FIG. 1 is a block diagram of a remotemedia access system100 according to one embodiment of the invention. The remotemedia access system100 includes amedia player102 and a personal computer (host computer)104. Themedia player102 is, for example, a portable, battery-operated device. In one embodiment, themedia player102 is ahandheld media player102 such as a MP3 player. Themedia player102 is capable of being connected or attached to thehost computer104 through adata link106. As shown inFIG. 1, the data link is represented by a cable. Thehost computer104 includes abus interface108, anoperating system110 and anapplication112. Theapplication112 typically performs processing on thehost computer104 that requires data to be read from or stored to themedia player102. Theoperating system110 serves to provide a software layer between theapplication112 and hardware interface components of thehost computer104. Theoperating system110 can utilize thebus interface108 that couples to thebus link106 and therefore to themedia player102. When thebus link106 is a cable, each end of the cable can have a connector that couples to a port or connector, such as a port orconnector114 of thehost computer104 and a port orconnector116 of themedia player102. In one example, the ports/connectors can be IEEE 1394 (FireWire®) ports/connectors and theperipheral cable106 can be a FireWire® cable.
In one embodiment, the media player is a portable computing device dedicated to processing media such as audio, video or images. For example, themedia player102 can be a music player (e.g., MP3 player), a game player, a video player, a video recorder, a camera, an image viewer and the like. These devices are generally battery operated and highly portable so as to allow a user to listen to music, play games or video, record video or take pictures wherever the user travels. In one implementation, the media player is a handheld device that is sized for placement into a pocket or hand of the user. By being handheld, the media player is relatively small and easily handled and utilized by its user. By being pocket sized, the user does not have to directly carry the device and therefore the device can be taken almost anywhere the user travels (e.g., the user is not limited by carrying a large, bulky and often heavy device, as in a portable computer). Furthermore, the device may be operated by the users hands, no reference surface such as a desktop is needed.
FIG. 2 is a block diagram of a remotemedia access system200 according to one embodiment of the invention. Themedia synchronization system200 includes amedia player202 and a personal computer (host computer)204. Thepersonal computer204 includes amedia device manager206. Thepersonal computer204 further includes amedia database208. Themedia player202 includes amedia database210. Typically, according to one embodiment, themedia player202 will also include a data storage device (e.g., disk drive) for storing media content, a cache memory for storing media content in-use, a screen display for displaying information to a user, and a processor (e.g., microprocessor) for controlling operation of themedia player202. The screen display is often small. In other embodiments, the media player does not include a screen display.
Aperipheral cable212 provides a data path (or data link) between themedia player202 and thepersonal computer204. Theperipheral cable212 provides a peripheral bus that couples themedia player202 to thepersonal computer204. The peripheral bus, for example, could be a IEEE 1394 bus (i.e., FireWire® bus) or a Universal Serial Bus (USB). Alternatively, theperipheral cable212 can be replaced by a wireless link.
Themedia device manager206 can manage access to themedia player202 by thepersonal computer204 over theperipheral cable212. When themedia device manager206 detects that themedia player202 is physically coupled to thepersonal computer204 via theperipheral cable212, then themedia device manager206 can mount the data storage device as needed, but otherwise retain the data storage device unmounted. When mounted, thepersonal computer204 can access the data storage device within themedia player202.
Although the need for access to the data storage device of themedia player202 can vary widely depending on application, one such application is a synchronization operation between the media content stored on thepersonal computer204 and the media content stored on themedia player202. With such an application, the data storage device would be mounted and thus accessible during synchronization but then unmounted once synchronization has completed. Such synchronization can be achieved in a sophisticated manner through comparison of media information stored in therespective media databases208 and210. When comparison of the media information from therespective databases208 and210 indicates that there is a particular media item resident on thepersonal computer204 but not on themedia player202, then the particular media item can be transmitted (downloaded) to the media player over theperipheral cable212. On the other hand, when the comparison of the media information from therespective databases208 and210 indicates that a particular media item is resident on themedia player202 but not on thepersonal computer204, then the particular media item can be either removed (deleted) from themedia player202 or transmitted (e.g., uploaded) over theperipheral cable212 to thepersonal computer204. Hence, by providing themedia player202 with themedia database210, more sophisticated synchronization and management of media content is enabled. Themedia database210 also allows themedia player202 to present a user interface to the user that is more sophisticated than conventional approaches. Such a user interface can be presented on the screen display of themedia player202. The user interface can, for example, allow the user of themedia player202 to browse, sort, search, play, etc. the media content resident on themedia player202. The user interface can also allow the user of themedia player202 to download (add) or delete (remove) media items from themedia player202. Themedia manager206 also has a user interface that allows a user to browse, sort, search, play, make playlists, burn Compact Discs (CDs), etc. the media content resident on thepersonal computer204. The user interface can also allow the user of thepersonal computer204 to download (add) or delete (remove) media items from thepersonal computer204. In one embodiment, themedia manager206 and its associated user interface are provided by iTunes, version 2.0, from Apple Computer, Inc. of Cupertino, Calif.
FIG. 3 is a block diagram of amedia player300 according to one embodiment of the invention. Themedia player300 includes aprocessor302 that pertains to a microprocessor or controller for controlling the overall operation of themedia player300. Themedia player300 stores media data pertaining to media items in afile system304 and acache306. Thefile system304 is, typically, a storage disk or a plurality of disks. Alternatively, thefile system304 can be implemented by other types of non-volatile memory (e.g., FLASH memory). Thefile system304 typically provides high capacity storage capability for themedia player300. However, since the access time to thefile system304 is relatively slow, themedia player300 can also include acache306. Thecache306 is, for example, Random-Access Memory (RAM) provided by semiconductor memory. The relative access time to thecache306 is substantially shorter than for thefile system304. However, thecache306 does not have the large storage capacity of thefile system304. Further, thefile system304, when active, consumes more power than does thecache306. The power consumption is particularly important when themedia player300 is a portable media player that is powered by a battery (not shown). Themedia player300 also includes aRAM320 and a Read-Only Memory (ROM)322. TheROM322 can store programs, utilities or processes to be executed in a non-volatile manner. TheRAM320 provides volatile data storage, such as for thecache306.
Themedia player300 also includes auser input device308 that allows a user of themedia player300 to interact with themedia player300. For example, theuser input device308 can take a variety of forms, such as a button, keypad, dial, etc. Still further, themedia player300 includes a display310 (screen display) that can be controlled by theprocessor302 to display information to the user. Adata bus311 can facilitate data transfer between at least thefile system304, thecache306, theprocessor302, and theCODEC312.
In one embodiment, themedia player300 serves to store a plurality of media items (e.g., songs) in thefile system304. When a user desires to have the media player play a particular media item, a list of available media items is displayed on thedisplay310. Then, using theuser input device308, a user can select one of the available media items. Theprocessor302, upon receiving a selection of a particular media item, supplies the media data (e.g., audio file) for the particular media item to a coder/decoder (CODEC)312. TheCODEC312 then produces analog output signals for aspeaker314. Thespeaker314 can be a speaker internal to themedia player300 or external to themedia player300. For example, headphones or earphones that connect to themedia player300 would be considered an external speaker.
Themedia player300 also includes abus interface316 that couples to adata link318. The data link318 allows themedia player300 to couple to a host computer.
FIG. 4 is a flow diagram of media access processing400 according to one embodiment of the invention. Themedia access processing400 is, for example, performed by themedia device manager206 of the personal computer (host computer)204 illustrated inFIG. 2 or the bus interfaces108 of thehost computer104 illustrated inFIG. 1.
The media access processing400 can be invoked when it is discovered that a media device has recently been attached to the host computer. Once invoked, themedia access processing400 identifies402 the media device recently attached to the host computer.
The media device is then logically connected404 to the file system of the host computer. Hence, the attaching of the media device to the host computer pertains to a physical connection or coupling of the media device to the host computer. Typically, such attachment is made via a data link. The data link is typically a cable having a connector at one or both ends, but can also be a wireless data link. The logical connection of the media device to the file system operates to configure the host computer to be able to access the media device. In particular, the media device typically includes a storage device, such as a data storage disk. In one embodiment, the logical connection involves mounting of the storage device of the media device to the file system of the host computer.
Media-based processing is then performed406 to access the media device (i.e., the storage device of the media device). After the media-based processing has been performed406, the media device is logically disconnected408 from the file system of the host computer. In one embodiment, this involves an “unmounting” of the storage device of the media device from the file system of the host computer. At this point, although logically disconnected, the media device remains attached (e.g., physically connected) to the host computer.
Next, adecision410 determines whether the media device has been detached from the host computer. When thedecision410 determines that the media device has been detached, then themedia device processing400 is complete and ends as the media device has been physically detached from the host computer and thus no longer communicates with or is accessible by the host computer. On the other hand, when thedecision410 determines that the media device has not been detached from the host computer, then adecision412 determines whether access to the media device is needed. As an example, access to the media device would be needed if subsequent processing is about to be invoked (or desirous of being invoked), which would need to access the media device. For example, applications normally receive or obtain instructions pertaining to such subsequent processing. Hence, when thedecision412 determines that access to the media device is not needed, then the media access processing400 returns to repeat thedecision410 and subsequent operations. In this case, the media device is able to be detached whenever desired. In other words, the media device is “hot” unpluggable at this point. Alternatively, when thedecision412 determines that access to the media device is now (or soon to be) needed, then the media access processing400 returns to repeat theoperation404 and subsequent operations so that the media device can be again logically connected to the file system to support access thereto by the host computer, and then subsequently, logically disconnecting the media device from the file system.
FIGS. 5A and 5B are flow diagrams of media access processing500 according to another embodiment of the invention. Themedia access processing500 is, for example, performed by themedia device manager206 of the personal computer (host computer204) illustrated inFIG. 2.
Themedia access processing500 begins with adecision502 that determines whether a new storage device is present on a bus. Typically, the bus is a peripheral bus associated with the host computer. When thedecision502 determines that a new storage device is not now present on the bus, then thedecision502 causes the media access processing500 to wait for the existence of a new storage device on the bus. Once thedecision502 determines that there is a new storage device present on the bus, then the storage device is mounted504 with the file system of the host computer.
Next, adecision506 determines whether the storage device is a media device. When thedecision506 determines that the storage device is not a media device, thenother processing508 can be performed. Suchother processing508 is unrelated to the access processing for gaining access to media content stored on a media device and thus is not further discussed herein. On the other hand, when thedecision506 determines that the storage device is a media device, then the storage device is accessed510 to perform initial media-based processing. The initial media-based processing can serve a wide variety of functions or uses for either the media device or the host computer. In one embodiment, the initial media-based processing pertains to synchronization of the media content between the host computer and the media player. For additional details on synchronization processing, see U.S. patent application Ser. No. 10/118,069, filed Apr. 5, 2002, and entitled “INTELLIGENT SYNCHRONIZATION OF MEDIA PLAYER WITH HOST COMPUTER,” which is hereby incorporated herein by reference. Specifically, in this application being incorporated, operations610-624 ofFIGS. 6A and 6B are particularly descriptive of appropriate synchronization operations that can be performed according to one embodiment. After the initial media-based processing has been performed and thus the access to the storage device completed, the storage device is unmounted512 from the file system. At this point, the storage remains physically attached to the host computer but is eligible to be detached as the user desires. Consequently, the media access processing500 automatically renders the storage device removable without any need for user interaction prior to its physical removal.
Next, adecision514 determines whether the storage device has been physically disconnected from the host computer. When thedecision514 determines that the storage device has not been physically disconnected, adecision516 determines whether access to the storage device is needed. When either thedecision514 determines that the storage device has been physically disconnected or when thedecision516 determines that access to the storage device is not needed, then adecision518 determines whether themedia access processing500 is done or completed. When thedecision518 determines that themedia access processing500 is done, then the media access processing500 ends. Alternatively, when thedecision518 determines that themedia access processing500 is not done, then the media access processing500 returns to repeat thedecision514 and subsequent operations.
On the other hand, when thedecision516 determines that access to the storage device is needed, then the storage device is mounted520 with the file system of the host computer. Here, since the storage device was previously mounted504 and then unmounted512, the mounting520 can also be referred to as remounting. After the storage device has been mounted520, the storage device is accessed522 to perform subsequent media-based processing. The subsequent media-based processing pertains to processing performed by the host computer with respect to the storage device (media device) such that processing beyond the initial media-based processing is able to be carried out. Following the completion of the subsequent media-based processing, the storage device is unmounted524 from the file system. At this point, the storage device remains physically attached to the host computer but is eligible to be detached as the user desires. Hence, the media access processing500 again automatically renders the storage device removable without any need for user interaction prior to its physical removal. Following theoperation524, the media access processing500 returns to repeat thedecision514 and subsequent operations.
Accordingly, by unmounting the storage device from the file system after the pending media media-based processing which utilizes the storage device completes, the storage device (media device) remains in an unmounted condition, for the most part. Stated differently, the default position for the storage device connected to the host computer is in an unmounted condition. When unmounted, the storage device (media device) permits the detachment (or disconnection) of the storage device (media device) from the host computer by the user without any preparatory user interactions. In other words, since the storage device is unmountable, the storage device (media device) can simply be unplugged from the host computer and none of the host computer, the media device or their data will be harmed or damaged by such user action.
In one embodiment, the storage device (media device) is considered as a removable media device or virtual removable drive. The storage device thus emulates the removability of a floppy, CD-ROM drive or memory card. In this embodiment, the host computer can initiate a “disk inserted” message to trick itself into thinking that a new removable media (e.g., disk) has just been inserted. As a result, the media device can be recognized and the media can be mounted even though the media device was never physically detached from the host computer after being previously recognized and mounted. The remount occurs without user interaction with either the host computer or the media player.
Optionally, instead of using the default condition as being unmounted, the data storage device within the media player can remain normally mounted. For example, the data storage device of the media player can remain mounted until a specific request to unmount. This optional approach can be utilized in a “hard drive” mode where the data storage device of the media player operates as a mass storage device (i.e., hard drive) for the host computer.
The invention can be implemented in software, hardware or a combination of hardware and software. The invention can also be embodied as computer readable code on a computer readable medium. The computer readable medium is any data storage device that can store data which can thereafter be read by a computer system. Examples of the computer readable medium include read-only memory, random-access memory, CD-ROMs, magnetic tape, optical data storage devices, and carrier waves. The computer readable medium can also be distributed over network-coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.
The advantages of the invention are numerous. Different embodiments or implementations may yield one or more of the following advantages. One advantage of the invention is that peripheral devices, e.g., media devices, are able to be “hot” unpluggable without data loss or corruption. Another advantage of the invention is that peripheral devices can have “plug-and-play” as well as “remove-and-go” characteristics which better satisfies user needs and usage.
The many features and advantages of the present invention are apparent from the written description and, thus, it is intended by the appended claims to cover all such features and advantages of the invention. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the invention to the exact construction and operation as illustrated and described. Hence, all suitable modifications and equivalents may be resorted to as falling within the scope of the invention.