1. Field of the Invention
The present invention relates to an improved information processing technique, and more specifically, to an information processing technique which allows both a device which supplies data and a device which processes data to operate at the same rate without having to have a common clock signal.
2. Description of the Related Art
In recent years, with the advance in semiconductor technology, information processing equipment for processing information using an electronic circuit is becoming increasingly popular. An example of information processing equipment is an automotive information system such as a car audio system. In a typical car audio system, a disk playback device serving as a device for supplying data reads audio data representing a sound waveform from a recording medium such as a CD, and a device for processing data such as a digital sound processor or a D/A converter processes the received audio data to reproduce a sound signal.
The car audio system is also called a car stereo system. A typical car audio system is designed to give an acoustic output into a car room by driving a loudspeaker with an amplifier in accordance with a sound signal supplied from an AM/FM tuner, a cassette tape deck, a disk playback device such as a CD player or MD player, or an auto CD changer.
In some cases, a car audio system is combined with an electronic device realized by advanced semiconductor technology, such as a car navigation system, a mobile telephone, a voice recognition system, etc. In the following description, such a mixed system is also called an automotive information system.
In the present invention, the term xe2x80x9caudio dataxe2x80x9d is used to describe data representing sound information such as music. On the other hand, the term xe2x80x9cdigital dataxe2x80x9d is used to describe data in digital form such as character codes, numeric codes, etc.
The disk playback device is a device which reads audio data or digital data from a storage medium such as a CD. CDs used together with the disk playback device can be generally classified into two groups: music CDs on which audio data is stored; and CD-ROMs on which digital data is stored. Herein, reading audio data from a music CD and reading digital data from a CD-ROM are both called xe2x80x9cplaybackxe2x80x9d.
In the information processing system, the processing of data is required, in some cases, to be performed at the same rate as the rate at which data is supplied, as is the case with reproduction of an audio signal from audio data. For example, in the case where audio data read from a music CD in a data supplying device is stored in a buffer, and a data processing device reproduces an audio signal by reading audio data from the buffer, if there is a difference in operation speed between the data supplying device and the data processing device, the data can overflow the buffer before being processed or a break of sound can occur because of a too-slow rate at which data is read.
Conventionally, to prevent the above-described problems, a data supplying device such as a disk playback device and a data processing device such as a digital sound processor are disposed in a single unit and a common clock signal is used. This limits the construction of the system and thus it is difficult to flexibly combine various separate units into a system.
In view of the above-described problems, it is an object of the present invention to provide a technique which allows a data processing device to operate at the same rate as that of a data supplying device without having to have a common clock signal. It is another object of the present invention to provide a technique of easily controlling the data processing rate in a highly reliable fashion by means of a simple method.
According to a first aspect of the invention, to achieve the above objects, there is provided an information processing apparatus including a buffer for storing given data; writing means for writing data into a buffer; reading means for reading data from the buffer; and starting means for making the reading means start reading data when data has been written into the buffer such that the first half storage area of the buffer has become filled with the data.
In this information processing apparatus, when the first half storage area of the buffer becomes filled with data written therein, a reading operation is begun starting from the first storage location of the buffer. This allows the distance between the data writing location and the data reading location to have a maximum possible value equal to a half the full storage capacity of the buffer, thereby minimizing the probability that some data is lost by a delay in supplying data and probability that the buffer overflows with data due to a change in the writing speed or reading speed.
According to a second aspect of the invention, there is provided an information processing apparatus including a buffer for storing given data; writing means for writing data into a buffer; reading means for reading data from the buffer; and control means for controlling the rate at which data is read from the buffer, in accordance with the rate at which data is given.
According to a ninth aspect of the invention, there is provided an automotive information system, based on the second aspect of the invention described above, wherein the system includes a disk playback device for supplying audio data and a main unit for processing the audio data supplied, wherein the main unit includes a buffer for storing given data; writing means for writing audio data into a buffer; reading means for reading audio data from the buffer; and control means for controlling the rate at which the audio data is read from the buffer, in accordance with the rate at which the audio data is given.
According to a third aspect of the invention, there is provided an information processing apparatus including a buffer for storing given data; writing means for writing data into a buffer; reading means for reading data from the buffer; and control means for controlling the rate at which data is read from the buffer, in accordance with the relationship between the rate at which data is given and the rate at which the data is being read from the buffer.
In the second, ninth, and third aspects of the invention, data is read from the buffer at a rate exactly adjusted relative to the rate at which data is supplied to the buffer regardless of a difference in operation speed, caused by for example a difference in clock signal, between the device which supplies data and the device which processes data. That is, when the device for supplying data and the device for processing data are constructed separately from each other, the invention makes it possible for the data processing device to operate at the same rate as that of the data supplying device.
According to a fourth aspect of the invention, there is provided an information processing apparatus including a buffer for storing given data; writing means for writing data into a buffer; reading means for reading data from the buffer; starting means for making the reading means start reading data when data has been written into the buffer such that the first half storage area of the buffer has become filled with the data; writing time measuring means for measuring the writing time required to write data into the buffer starting from the first storage location to the exact middle storage location of the buffer; reading time measuring means for measuring the time required to read the data from the buffer starting from the first storage location to the exact middle storage location of the buffer; and control means for controlling the rate at which data is read from the buffer, in accordance with the relationship between the writing time and the reading time.
According to a seventh aspect of the invention, there is provided a method of processing data corresponding to the apparatus according to the fourth aspect of the invention described above, wherein the method includes the steps of writing given data into a buffer; reading data from the buffer; making the reading step start reading data when data has been written into the buffer such that the first half storage area of the buffer has become filled with the data; measuring the writing time required to write data into the buffer starting from the first storage location to the exact middle storage location of the buffer; measuring the reading time required to read the data from the buffer starting from the first storage location to the exact middle storage location of the buffer; and controlling the rate at which data is read from the buffer, in accordance with the relationship between the writing time and the reading time.
According to a twelfth aspect of the invention, there is provided a storage medium on which an information processing program used by a computer to perform an information process, based on the fourth or seventh aspect of the invention described above is stored, wherein the process includes the steps of writing given data into a buffer; starting reading data from the buffer when data has been written into the buffer such that the first half storage area of the buffer has become filled with the data; measuring the writing time required to write data into the buffer starting from the first storage location to the exact middle storage location of the buffer; measuring the reading time required to read the data from the buffer starting from the first storage location to the exact middle storage location of the buffer; and controlling the rate at which data is read from the buffer, in accordance with the relationship between the writing time and the reading time.
According to a tenth aspect of the invention, based on the fourth aspect of the invention described above, there is provided an automotive information system including a disk playback device for supplying audio data and a main unit for processing the audio data supplied, wherein the main unit includes a buffer for storing given data; writing means for writing audio data received from the disk playback device into the buffer; reading means for reading audio data from the buffer; starting means for making the reading means start reading data when audio data has been written into the buffer such that the first half storage area of the buffer has become filled with the audio data; writing time measuring means for measuring the writing time required to write audio data into the buffer starting from the first storage location to the exact middle storage location of the buffer; reading time measuring means for measuring the time required to read the audio data from the buffer starting from the first storage location to the exact middle storage location of the buffer; and control means for controlling the rate at which audio data is read from the buffer, in accordance with the relationship between the writing time and the reading time.
According to an eleventh aspect of the invention, there is provided a method, corresponding to the system according to the tenth aspect of the invention, for controlling an automotive information system with a disk playback device for supplying audio data and with a main unit for processing the audio data supplied, wherein the method performs, in the main unit, a process including the steps of writing audio data received from the disk playback device into a buffer; reading audio data from the buffer; starting reading data from the buffer when audio data has been written into the buffer such that the first half storage area of the buffer has become filled with the audio data; measuring the writing time required to write audio data into the buffer starting from the first storage location to the exact middle storage location of the buffer; measuring the reading time required to read the audio data from the buffer starting from the first storage location to the exact middle storage location of the buffer; and controlling the rate at which audio data is read from the buffer, in accordance with the relationship between the writing time and the reading time.
In the fourth, seventh, twelfth, tenth, and eleventh aspects of the invention, data is read from the buffer at a rate exactly adjusted relative to the rate at which data is supplied to the buffer regardless of a difference in operation speed, caused by for example a difference in clock signal, between the device which supplies data and the device which processes data. That is, when the device for supplying data and the device for processing data are constructed separately from each other, the invention makes it possible for the data processing device to operate at the same rate as that of the data supplying device. The timing of starting to read data is determined in such a simple manner that when data has been written into the buffer such that the first half storage area has become filled with the data, reading data from the buffer is started. Furthermore, the rate at which data is processed is controlled on the basis of the times required to write and read the same amount of data.
According to a fifth aspect of the invention, there is provided an information processing apparatus based on any of the second to fourth aspects described above, wherein the control means controls the above-described rate by dividing the given clock by a divisor in such a manner that when the rate at which data is written into the buffer is lower than the rate at which data is read from the buffer, the clock is divided by a reduced divisor but the clock is divided by an increased divisor when the rate at which data is written into the buffer is higher than the rate at which data is read from the buffer.
According to an eighth aspect of the invention, there is provided a method of processing information based on the seventh aspect describe above, wherein the rate controlling step controls the above-described rate by dividing the clock by a divisor in such a manner that when the rate at which data is written into the buffer is lower than the rate at which data is read from the buffer, the clock is divided by a reduced divisor but the clock is divided by an increased divisor when the rate at which data is written into the buffer is higher than the rate at which data is read from the buffer.
According to the fifth and eighth aspects of the invention, it becomes possible to easily control the processing rate by simply increasing or reducing the divisor by which the clock signal is divided.
According to a sixth aspect of the invention, there is provided an information processing apparatus based on any of first to fifth aspects described above, wherein at least one of the operation of writing data and the operation of reading data is performed by means of DMA.
According to the sixth aspect of the invention, it becomes possible to read and write data from and to the buffer memory at a high rate by means of direct memory access (DMA). This makes it possible to process, in a highly reliable fashion, a large amount of data per unit time, such as audio data read from a music CD, received from another unit via a cable.