This Application claims priority of Taiwan Patent Application No. 100135715, filed on Oct. 3, 2011, the contents of which are incorporated herein by reference.
1. Field of the Invention
The disclosure relates generally to a Musical Instrument Digital Interface (MIDI) CODEC device, and more particularly relates to a CODEC device having a High Definition Audio (HDA) interface.
2. Description of the Related Art
Following the introduction of Intel's High Definition Audio (HDA) Specification Rev 1.0, the HDA interface has gradually gained popularity among PC users. The HDA architecture, defined by the Intel specification, attempts to meet the needs for high-quality audio in PCs. This architecture defines the delivery of high-fidelity audio content from a PC's memory to one or more audio coding and decoding (CODEC) devices, using a HDA controller that performs direct memory access (DMA) transfer of audio data over a HDA bus or a HDA link. The audio data delivered over the HDA bus is received, processed, and outputted by the various components of the CODEC devices.
Nowadays, most host systems use a HDA interface to perform the inputting/outputting of audio signals, and the HDA interface is applied in most computers as an industry standard. Therefore, present CODEC interfaces all follow the standard of the HDA specification in order to connect to a HDA controller.
However, the conventional HDA controller and CODEC device are limited to the standard HDA specification protocol for data transmission, and it does not support MIDI data or signal transmissions. Moreover, the inputting of MIDI data can be transmitted only via the I/O port, and the operating speed of the I/O port is slow. Accordingly, the MIDI I/O port is not included in most host systems. Thus, it is very difficult to implement MIDI input/output on computer host systems having HDA controllers.
In summary, a CODEC device having a HDA interface is required, in order to use an industrial standard HDA interface to connect to peripherals with a MIDI, such as keyboards or voice synthesizers.
An embodiment of a coding and decoding (CODEC) device comprises a first interface compatible with a High Definition Audio (HDA) specification, a second interface compatible with a Musical Instrument Digital Interface (MIDI) specification, and a converter. The converter is configured to convert a first MIDI command received from the first interface and output a corresponding first converted MIDI command via the second interface, and to convert a second MIDI command received from the second interface and output a corresponding second converted MIDI command via the first interface.
An embodiment of a method for a CODEC device is provided. The method comprises receiving a first MIDI command from a first interface, wherein the first interface is compatible with the HDA specification. The first MIDI command is converted. Subsequently, a corresponding first converted MIDI command is outputted via a second interface to a MIDI device, wherein the second interface is compatible with a MIDI specification.
An embodiment of another method for a CODEC device is provided. The method comprises receiving a second MIDI command from a second interface, wherein the second interface is compatible with a MIDI specification. The second MIDI command is converted. Subsequently, a corresponding second converted MIDI command is outputted via a first interface, wherein the first interface is compatible with a HDA specification.
The invention will become more fully understood by referring to the following detailed description with reference to the accompanying drawings, wherein:
The making and using of the embodiments of the present invention are discussed in detail below. It should be appreciated, however, that the embodiments provide many applicable inventive concepts that can be embodied in a wide variety of specific contexts. The specific embodiments discussed are merely illustrative of specific ways to make and use the invention, and do not limit the scope of the invention.
Due to the data transmission architecture of the conventional HDA controller having a fixed transmission format protocol, and data or signal transmission of the Musical Instrument Digital Interface (referred to as MIDI hereafter) not being supported by the conventional HDA controller, the present invention utilizes the converter 110 to convert the data format between a MIDI device and a HDA controller. Thus, when the MIDI device 140 couples to the MIDI CODEC device 100 via a MIDI port, the converter 110 converts a HDA data D1 received from the HDA controller 150 into a MIDI output signal. On the other hand, the converter 110 may also convert a MIDI input signal received from the MIDI device 140 into a HDA data D2, so that the communication between a computer device and MIDI device is established by the data transmission architecture of the HDA controller 150. It should be noted that the HDA controller 150 can recognize the formats of HDA data D1 and HDA data D2. Furthermore, due to the MIDI input signal and the MIDI output signal being in MIDI formats, by the conversion of the converter 110, when the MIDI device 140 receives the MIDI output signal, the MIDI device 140 can output the content of the HDA data D1 accordingly. The HDA data D1 is converted from MIDI data MIDI-1 by the driver 165 in the computer device 160 which corresponds to the CODEC device 100. On the other hand, the HDA data D2 can be transmitted to the computer device 160 via the HDA controller 150, and be converted to MIDI data MIDI-2 which has a file format of a MIDI application program executed by a computer. Therefore, the content or command of the MIDI input signal can be recognized by the computer device 160.
The CODEC device 100 comprises a storage device 120 configured to store the HDA data D1 and the HDA data D2, and the outputting and inputting of the stored data in the storage device 120 are controlled and managed by the control unit 130. The storage device 120 may be registers such as vender specific registers. For example, when the storage device 120 receives the HDA data D2 converted by the converter 110, the control unit 130 generates an unsolicited response signal and transmits the unsolicited response signal to the driver 165 of the computer device 160 via the HDA controller 150. When the computer device 160 receives the unsolicited response signal, the driver 165 of the computer device 160 transmits a corresponding command to the HDA controller 150, and then the computer device 160 will obtain the HDA data D2 in the storage device 120 via the HDA controller 150.
Also, it should be noted that the HDA architecture has two main transmission formats as shown in
The format of the MIDI data is not supported by data transmission architecture of the HDA controller 150, and the format of the MIDI data has an unfixed transmission bit rate. Therefore, one embodiment of the present invention is to perform MIDI data communication via the HDA controller based on the transmission of the command format of the HDA specification. As a result, the HDA data D1 and the HDA data D2 of this embodiment are in the command format. When MIDI data is transmitted in the command/response field 1810 in a frame, the stream field 1820 of the frame may contain other data or nulls.
In an embodiment, the computer device 160 can be a host system utilizing an x86 or x64 instruction set, such as C7 or Nano processor and chip sets produced by VIA Technologies, Inc. In another embodiment, the computer device 160 can be a System on Chip (SoC) utilizing reduced instruction set computing, such as a Single-Chip System utilizing Advanced RISC Machine (ARM) or Microprocessor without an Interlocked Pipeline Stages (MIPS) instruction set. The computer 160 can couple to the HDA controller 150 via a standard interface such as Peripheral Component Interconnect (PCI) or PCI express.
For example, the operation system executed by the computer 160 can be a Microsoft Windows, Apple Mac OS, Unix, Symbian, Windows Phone, Android, or iOS system. Generally speaking, the driver 165 is executed by the operation system in order to drive the CODEC device 100. In an embodiment, the driver 165 provides two service endpoints for the operation system, wherein one service endpoint is for the HDA, and the other one is for the MIDI. In another embodiment, the CODEC device 100 can be driven by two independent drivers, wherein one driver provides a service endpoint for HDA, and the other one provides a service endpoint for MIDI. The application program executed by the operation system can drive the CODEC device 100 to use HDA and MIDI functions.
According to the definition in the specification, the HDA controller 150 has a register for temporarily storing the commands to be outputted to the CODEC device 100 and the responses from the CODEC device 100.
When a related application program transmits a MIDI command (ex. the MIDI data MIDI-1) via the operation system to the MIDI service endpoint provided by the driver 165, the driver 165 will pack the MIDI data MIDI-1 into a command compatible with the HDA specification and output the command to the register of the HDA controller 150. Then, the HDA controller 150 transmits the HDA format command to the CODEC device 100. After the converter 110 receives the command, the converter 110 unpacks the MIDI data MIDI-1 contained in the command, and stores the MIDI data MIDI-1 as data D1 into the storage device 120. And then, the CODEC 100 transmits the MIDI data MIDI-1 to the MIDI device 140 via a MIDI.
On the other hand, when the MIDI device 140 transmits MIDI data MIDI-2 command to the CODEC 100 via a MIDI, the MIDI data MIDI-2 will be stored in the storage device 120 as data D2. Accordingly, the control unit 130 generates an unsolicited response signal with a special tag, indicating that a MIDI data MIDI-2 command has been stored in the CODEC device 100. And then, the HDA controller 150 transmits the unsolicited response signal to the driver 165. In one embodiment, the special tag to indicate a MIDI data is stored in the CODEC device may be contained in the tag field 1813b or the sub tag field 1813c or the combination of the two.
In an embodiment, when the driver 165 receives the unsolicited response signal, the driver 165 is aware that the MIDI device 140 has transmitted a command into the CODEC device 100 according to the special tag. The driver 165 will generate another command for reading the data D2 from the storage device 120 of the CODEC device 100. When the CODEC device 100 returns the data D2 from the storage device 120 to the driver 165, the driver 165 will transmit the MIDI data MIDI-2 to the related application program via the MIDI service endpoint.
Generally speaking, the transmission rate of a MIDI is much lower than the transmission rate of an HDA interface. Therefore, the control unit 130 of the CODEC device 100 and the driver 165 must manage the transmission traffic. When the MIDI data in a command format transmitted by the HDA interface is too large, the controller 130 will detect that the available space of the storage device 120 is not enough. Therefore, the controller 130 will notify the driver 165 to suspend the transmission of the MIDI data via the HDA interface. The controller 130 will notify the driver 165 to continue the transmission of MIDI data after the converter 110 gradually transmits the MIDI data in the storage device 120 to the MIDI device 140.
On the other hand, when the CODEC device 100 receives the MIDI data from the MIDI device 140, the unsolicited response signal can be transmitted to the driver 165 after the amount of the MIDI data stored in the storage device 120 reaches a predetermined amount. Therefore, the processing efficiency of the computer device 160 increases because there is no need to transmit the unsolicited response signal to the driver 165 each time when a MIDI data is received.
As described above, the present invention uses the transmission in the command format to perform the transmission of the MIDI data via the HDA controller in one embodiment. Thus, the transmission format of the HDA data D1, the HDA data D2, and the unsolicited response signal is the command format.
In another embodiment of the present invention, the MIDI command can be transmitted by using the stream format of HDA. As described above, the stream format has a fixed data transmission rate, but the MIDI data does not have a fixed data transmission rate. Therefore, one of the stream formats supported by the HDA interface can be selected to satisfy the maximum data rate of the lowest fixed rate format of the MIDI in order to reduce the processing burden of the entire system. When MIDI data is transmitted in the stream field 1820 in a frame, the command/response field 1810 of the frame may contain other data or nulls.
After the MIDI service endpoint of the driver receives the MIDI command, the driver can insert the MIDI command in the stream format according to the fixed rate and transmit the stream format to the CODEC device 100 via the HDA controller 150. The converter 110 of CODEC device 100 obtains the MIDI command from the stream format, stores the MIDI command in the storage device 120, and transmits the MIDI command to the MIDI device 140 via the MIDI. If the driver does not receive a MIDI command within a unit period under the fixed rate, the driver will insert nulls or meaningless data into the stream format. If the converter 110 of the CODEC device 100 obtains nulls or meaningless data, no further operation will be performed.
On the other hand, when the CODEC device 100 receives the MIDI command from the MIDI device 140, the MIDI command can be temporally stored in the storage device 120. Next, the converter 110 inserts the MIDI data into the stream format according to the fixed rate, and transmits the stream format to the driver 165 via the HDA controller 150. When the driver 165 receives the MIDI command in the stream format, the driver 165 transmits the MIDI command to a related application program. Similarly, if the converter 110 does not receive the MIDI command from the MIDI device 140 within a unit period under the fixed rate, the converter 110 will insert nulls or meaningless data into the stream format according to the fixed rate. If the driver 165 obtains nulls or meaningless data in the stream format, no further operation will be performed.
While the invention has been described by ways of examples and in terms of preferred embodiments, it is to be understood that the invention is not limited thereto. Those who are skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
100135715 | Oct 2011 | TW | national |