JP5375650B2 - Multi-core system, control method and program for multi-core system - Google Patents

Multi-core system, control method and program for multi-core system Download PDF

Info

Publication number
JP5375650B2
JP5375650B2 JP2010030143A JP2010030143A JP5375650B2 JP 5375650 B2 JP5375650 B2 JP 5375650B2 JP 2010030143 A JP2010030143 A JP 2010030143A JP 2010030143 A JP2010030143 A JP 2010030143A JP 5375650 B2 JP5375650 B2 JP 5375650B2
Authority
JP
Japan
Prior art keywords
dma transfer
program
fifo
interrupt
synthesized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2010030143A
Other languages
Japanese (ja)
Other versions
JP2011164525A (en
Inventor
正太郎 河野
賢太郎 笹川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2010030143A priority Critical patent/JP5375650B2/en
Publication of JP2011164525A publication Critical patent/JP2011164525A/en
Application granted granted Critical
Publication of JP5375650B2 publication Critical patent/JP5375650B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、マルチコアシステム、マルチコアシステムの制御方法及びプログラムに関する。   The present invention relates to a multicore system, a control method for a multicore system, and a program.

複数のCPU(Central Processing Unit)コアを内蔵したマルチコアで構成され、組み込み用途向けのプロセッサ(MPU:Micro Processing Unit)が開発されている。これらのプロセッサは、周辺デバイスも含めてワンチップ化されている。また、マルチコアCPU上において、異なる複数のOS(Operating System)を動作させる技術が知られている。   A processor (MPU: Micro Processing Unit) that is composed of a multi-core including a plurality of CPU (Central Processing Unit) cores and has been developed has been developed. These processors are integrated into a single chip including peripheral devices. In addition, a technique for operating a plurality of different OSs (Operating Systems) on a multi-core CPU is known.

また、MPUの機能として、単一の割り込み要求(IRQ:Interrupt ReQuest)を、複数のCPUコアへと通知する手段が知られている。さらに、MPUは、レジスタ設定に基づいて、どの割り込み要求をどのCPUコアに対して割り当てるかを設定することができる。   As a function of the MPU, means for notifying a single interrupt request (IRQ: Interrupt ReQuest) to a plurality of CPU cores is known. Furthermore, the MPU can set which interrupt request is assigned to which CPU core based on the register setting.

また、例えば、図8に示すように、MPU50内部のCPUからADAC51(Audio DAC)に対して、I2S(Inter-IC Sound)バスを経由して、音声データを転送する技術が知られている。音声データは、例えば、PCM(Pulse Code Modulation)音声である。なお、I2Sは、音声データのインターフェイスデバイスを構成する、PHILIPS(登録商標)社製のシリアル通信フォーマットである。I2S規格では、PCM音声や圧縮音声(μ−lawやADPCMなど)を、I2Sバスを経由してADACに出力することができる。   For example, as shown in FIG. 8, a technique is known in which audio data is transferred from a CPU in the MPU 50 to an ADAC 51 (Audio DAC) via an I2S (Inter-IC Sound) bus. The audio data is, for example, PCM (Pulse Code Modulation) audio. I2S is a serial communication format manufactured by PHILIPS (registered trademark), which constitutes an interface device for audio data. In the I2S standard, PCM audio and compressed audio (μ-law, ADPCM, etc.) can be output to the ADAC via the I2S bus.

また、図8において、I2C(Inter-Integrated Circuit)バスは、PHILIPS(登録商標)社で開発されたデバイス制御用のシリアルバスである。ADAC51は、音声データをステレオ音声に変換する。DACは、D/Aコンバータである。ADACから出力されるアナログ音声(ステレオ)が、スピーカーにおいて再生される。   In FIG. 8, an I2C (Inter-Integrated Circuit) bus is a device control serial bus developed by PHILIPS (registered trademark). The ADAC 51 converts audio data into stereo audio. The DAC is a D / A converter. Analog audio (stereo) output from the ADAC is reproduced on the speaker.

また、FIFO(First In First Out)バッファを備えるI2Sデバイスが知られている。このようなI2Sデバイスは、FIFOバッファに格納されている音声データをデキューしてI2Sバスを経由してADACに出力する。そして、FIFOバッファからデキューされて減少したデータのサイズが4、8、16、32バイト等の境界に達した場合、割り込み(以下、「FIFO境界割り込み」とする)を発生させることが可能なI2Sデバイスがある。一般的に、この割り込みは、PIO(Programmed Input/Output)転送に使用される。   In addition, an I2S device including a FIFO (First In First Out) buffer is known. Such an I2S device dequeues the audio data stored in the FIFO buffer and outputs it to the ADAC via the I2S bus. When the size of the data dequeued and reduced from the FIFO buffer reaches a boundary of 4, 8, 16, 32 bytes, etc., an I2S that can generate an interrupt (hereinafter referred to as “FIFO boundary interrupt”) There is a device. Generally, this interrupt is used for PIO (Programmed Input / Output) transfer.

本願の出願人は、先に出願した特願2009−190103において、単一のマルチコアCPU上で複数のOSを動作させ、それら複数のOSでI2Sデバイスを共有するマルチコアシステムにおいて、I2Sデバイスの制御を行う主系OSがカーネルパニック又はフリーズ等のために動作不能となった場合においても、他の予備系OSに切替えてI2Sデバイスの制御を継続可能とする技術を開示している。これにより、簡易な構成で音切れの発生を防止することができる。   In the previously filed Japanese Patent Application No. 2009-190103, the applicant of the present application controls an I2S device in a multicore system in which a plurality of OSs are operated on a single multicore CPU and the I2S devices are shared by the plurality of OSs. A technique is disclosed in which even when the main OS to be performed becomes inoperable due to kernel panic or freeze, the I2S device control can be continued by switching to another spare OS. Thereby, occurrence of sound interruption can be prevented with a simple configuration.

図9を参照して、特願2009−190103に記載された技術を簡単に説明する。
特願2009−190103では、複数OSからの同時音声出力時におけるDMA(Direct Memory Access)アンダーランエラー発生回避のため、2つの解決手段(解決手段1、解決手段2)を定義している。
The technique described in Japanese Patent Application No. 2009-190103 will be briefly described with reference to FIG.
In Japanese Patent Application No. 2009-190103, two solution means (solution means 1 and solution means 2) are defined in order to avoid the occurrence of DMA (Direct Memory Access) underrun errors during simultaneous audio output from a plurality of OSs.

解決手段1では、DMA転送終了割り込みを複数OS(OS[1]310、OS[2]320)で受信し、予備系OS(OS[1]310)側のドライバ管理部315が有する割り込みハンドラを用いて2系統のHW(Hard Ware)タイマー217を設定し、主系OS(OS[2]320)側のDMA転送完了割り込みスレッド329でHWタイマー217を解除する。解決手段2では、HWタイマー217がタイムアウトした場合、主系ドライバコア部327(サウンドドライバの一機能)を主系(ドライバコア部327)から予備系(ドライバコア部314)へと切り替え、音声データの整合性をとる。 In Solution 1, a DMA transfer end interrupt is received by a plurality of OSs (OS [1] 310, OS [2] 320), and an interrupt handler included in the driver management unit 315 on the standby OS (OS [1] 310) side is provided. The two systems of HW (Hard Ware) timers 217 are set, and the HW timer 217 is canceled by the DMA transfer completion interrupt thread 329 on the main OS (OS [2] 320) side. In Solution 2, when the HW timer 217 times out, the main driver core unit 327 (one function of the sound driver) is switched from the main system (driver core unit 327) to the standby system (driver core unit 314), and the audio data To ensure consistency.

解決手段1では、主系側のDMA転送完了割り込みスレッド329における処理方法を、音声ミキシング処理時間とDMA転送間隔との大小関係に応じて、2つのパターン(パターンA、パターンB)から選択する。図10に示すように、「DMA転送間隔>(ミキシング処理時間×2)」である場合には、パターンAを選択し、「DMA転送間隔≦(ミキシング処理時間×2)」である場合には、パターンBを選択する。   In the solution 1, the processing method in the DMA transfer completion interrupt thread 329 on the main system side is selected from two patterns (pattern A and pattern B) according to the magnitude relationship between the audio mixing processing time and the DMA transfer interval. As shown in FIG. 10, when “DMA transfer interval> (mixing processing time × 2)”, pattern A is selected, and when “DMA transfer interval ≦ (mixing processing time × 2)”. , Pattern B is selected.

パターンAでは、図11の(A)図に示すように、「ミキシング処理→DMA転送開始要求」の順で処理を行う。また、パターンBでは、図11の(B)図に示すように、「DMA転送開始要求→ミキシング処理」の順で処理を行う。   In pattern A, as shown in FIG. 11A, processing is performed in the order of “mixing processing → DMA transfer start request”. In the pattern B, as shown in FIG. 11B, processing is performed in the order of “DMA transfer start request → mixing processing”.

しかし、パターンBでは、DMA転送を行う音声データを1パケット(DMA転送サイズ)分先読みする都合上、アプリケーションが参照可能なパラメータである音声データの再生済みサンプル数と、実際の音声データの再生済みサンプル数がずれてしまう。すなわち、パターンBでは、音声データを1パケット分先読みするため、画音同期を行う動画プレーヤーで動画を再生する場合、実際に再生中の音声データと、動画プレーヤーが再生中と認識する音声データが1パケット分ずれてしまい、画音同期の精度が低下してしまうという課題があった。   However, in pattern B, for the purpose of pre-reading the audio data for DMA transfer by one packet (DMA transfer size), the number of reproduced samples of audio data, which is a parameter that can be referred to by the application, and the actual audio data are The number of samples will shift. That is, in the pattern B, since the audio data is prefetched for one packet, when the moving image player that performs image / synchronization reproduces the moving image, the audio data that is actually being reproduced and the audio data that the moving image player recognizes are being reproduced There is a problem that the accuracy of the image / synchronization is lowered due to a shift of one packet.

そこで、特願2009−262545に記載された技術では、図12に示すように、「ミキシング処理時間<DMA転送間隔<(ミキシング処理時間×2)」である場合には、パターンBではなくパターンAを選択するものとして、「主系→予備系切り替えのための異常検出手段」を新たに定義している。   Therefore, in the technique described in Japanese Patent Application No. 2009-262545, as shown in FIG. 12, when “mixing processing time <DMA transfer interval <(mixing processing time × 2)”, pattern A instead of pattern B is used. Is newly defined as “abnormality detection means for switching the main system to the standby system”.

この異常検出手段では、DMA転送完了割り込みを受信した場合に、I2SデバイスのFIFO境界割り込みを予備系側で受信することを許可する。そして、予備系側のドライバ管理部がFIFO境界割り込みを受信した場合には、FIFOバッファ内のデータ数とDMA転送用バッファに蓄えられているデータのサンプル数とを比較する。比較の結果、DMA転送用バッファに蓄えられているサンプル数がFIFOバッファ内のデータ数から計算される閾値に達していない場合には、ドライバコア部に関して主系から予備系への切り替えを行う。尚、FIFO境界割り込みとは、FIFOバッファに溜まっているデータが4バイト境界になった都度、発生する割り込みである。   This abnormality detection means permits the reception of the FIFO boundary interrupt of the I2S device on the standby side when the DMA transfer completion interrupt is received. When the driver management unit on the standby side receives the FIFO boundary interrupt, the number of data in the FIFO buffer is compared with the number of samples of data stored in the DMA transfer buffer. As a result of the comparison, when the number of samples stored in the DMA transfer buffer has not reached the threshold calculated from the number of data in the FIFO buffer, the driver core unit is switched from the main system to the standby system. The FIFO boundary interrupt is an interrupt that occurs every time the data accumulated in the FIFO buffer becomes a 4-byte boundary.

しかしながら、特願2009−262545では、DMA転送完了割り込みの受信をトリガとしてI2SデバイスのFIFO境界割り込みを許可するものである。このため、DMA転送割り込みスレッドでのミキシング処理中においてもFIFO境界割り込みが発生することになり、予備系側のパフォーマンスが低下するという課題があった。   However, in Japanese Patent Application No. 2009-262545, the FIFO boundary interrupt of the I2S device is permitted with the reception of the DMA transfer completion interrupt as a trigger. For this reason, a FIFO boundary interrupt occurs even during the mixing process in the DMA transfer interrupt thread, and there is a problem that the performance on the standby side is degraded.

本発明の目的は、上述した課題を解決するために、予備系への負荷を抑えながら画音同期精度の低下を抑制し、かつ、音切れの発生を防止することが可能なマルチコアシステム、マルチコアシステムの制御方法及びプログラムを提供することである。   In order to solve the above-described problems, an object of the present invention is to provide a multi-core system and a multi-core system capable of suppressing a decrease in image / synchronization accuracy while suppressing a load on a standby system and preventing occurrence of sound interruption. A system control method and program are provided.

本発明の第1の態様に係るマルチコアシステムは、第1のプロセッサコア上で動作し、第1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納する主系プログラムと、第2のプロセッサコア上で動作し、前記主系プログラムの予備系として動作する予備系プログラムと、前記DMA転送用バッファから転送される合成音声データを順次格納し、当該格納した合成音声データを再生する音声出力部と、を備え、前記予備系プログラムは、DMA転送完了割込み要求の受信に応じてタイマーを設定し、所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部に格納されている合成音声データの格納量に応じて定める所定のデータ量に達しているか否かを判定し、当該所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行するものである。   The multi-core system according to the first aspect of the present invention operates on the first processor core, mixes the first and second audio data, and stores the mixed synthesized audio data in the DMA transfer buffer. The main system program, the standby system program that operates on the second processor core and operates as a backup system of the main system program, and the synthesized voice data transferred from the DMA transfer buffer are sequentially stored and stored. An audio output unit for reproducing the synthesized audio data, and the standby program sets a timer in response to reception of the DMA transfer completion interrupt request, and when the timer times out after a predetermined time elapses, The amount of synthesized speech data stored in the transfer buffer is equal to the amount of synthesized speech data stored in the speech output unit. It is determined whether or not a predetermined data amount determined according to the delivery amount has been reached, and when the predetermined data amount has not been reached, the mixing and storing of the synthesized voice data executed by the main program is taken over. It is something to execute.

本発明の第2の態様に係るマルチコアシステムの制御方法は、第1のプロセッサコア上で動作し、第1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納する主系プログラムと、第2のプロセッサコア上で動作し、前記主系プログラムの予備系として動作する予備系プログラムと、前記DMA転送用バッファから転送される合成音声データを順次格納し、当該格納した合成音声データを再生する音声出力部と、を備えたマルチコアシステムの制御方法であって、前記予備系プログラムを用いて、DMA転送完了割込み要求の受信に応じてタイマーを設定するステップと、所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部に格納されている合成音声データの格納量に応じて定める所定のデータ量に達しているか否かを判定するステップと、前記所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行するステップと、を実行するものである。   The control method of the multi-core system according to the second aspect of the present invention operates on the first processor core, mixes the first and second audio data, and transfers the mixed synthesized audio data to the DMA transfer buffer. A main system program stored in the first processor core, a standby system program operating on the second processor core and operating as a standby system of the main system program, and synthesized voice data transferred from the DMA transfer buffer. A multi-core system control method comprising: an audio output unit that reproduces the stored synthesized audio data; and a step of setting a timer in response to reception of a DMA transfer completion interrupt request using the standby program; The synthesized sound stored in the DMA transfer buffer when the timer times out after a predetermined time elapses Determining whether or not the data storage amount has reached a predetermined data amount determined according to the storage amount of the synthesized voice data stored in the voice output unit; and has not reached the predetermined data amount Sometimes, the step of taking over and carrying out the mixing and storing of the synthesized voice data executed by the main system program is executed.

本発明の第3の態様に係るプログラムは、複数のプロセッサコアと、DMA転送用バッファから転送される合成音声データを順次格納して再生する音声出力部と、を含むマルチコアシステムにおいて、前記複数のプロセッサコア上でそれぞれ動作する複数のプログラムのうちで、第1のプロセッサコア上で動作し、第1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納するプログラムを主系プログラムとして、第2のプロセッサコア上で動作し、前記主系プログラムの予備系として動作する予備系プログラムであって、DMA転送完了割込み要求の受信に応じてタイマーを設定するステップと、所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部の格納量に応じて定める所定のデータ量に達しているか否かを判定するステップと、前記所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行するステップと、を前記プロセッサコアに実行させるものである。   A program according to a third aspect of the present invention is a multi-core system including a plurality of processor cores and an audio output unit that sequentially stores and reproduces synthesized audio data transferred from a DMA transfer buffer. Among a plurality of programs that respectively operate on the processor core, operate on the first processor core, mix the first and second audio data, and store the mixed synthesized audio data in the DMA transfer buffer A standby program that operates on the second processor core as a main program and operates as a standby system for the main program, the step of setting a timer in response to reception of a DMA transfer completion interrupt request And the DMA transfer buffer when the timer times out after a predetermined time elapses. Determining whether or not the amount of synthesized speech data stored in the memory reaches a predetermined data amount determined according to the storage amount of the sound output unit, and when the predetermined data amount is not reached The processor core executes the step of taking over and executing the mixing and storing of the synthesized voice data executed by the main system program.

上述した本発明の各態様により、予備系への負荷を抑えながら画音同期精度の低下を抑制し、かつ、音切れの発生を防止することが可能なマルチコアシステム、マルチコアシステムの制御方法及びプログラムを提供することができる。   According to each aspect of the present invention described above, a multi-core system, a control method for a multi-core system, and a program capable of suppressing a drop in image / synchronization accuracy while suppressing a load on a standby system and preventing occurrence of sound interruption Can be provided.

本発明の実施の形態に係るマルチコアシステムのハードウェア構成の概要を示すブロック図である。It is a block diagram which shows the outline | summary of the hardware constitutions of the multi-core system which concerns on embodiment of this invention. 本発明の実施の形態に係るマルチコアシステムのハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the multi-core system which concerns on embodiment of this invention. 本発明の実施の形態に係るマルチコアシステムの機能構成を示すブロック図である。It is a block diagram which shows the function structure of the multi-core system which concerns on embodiment of this invention. 本発明の実施の形態に係る動作シーケンス図である。It is an operation | movement sequence diagram which concerns on embodiment of this invention. 本発明に関連する技術の動作シーケンス図である。It is an operation | movement sequence diagram of the technique relevant to this invention. 本発明の実施の形態に係るFIFO境界割り込み回数と閾値との関係を示す表である。It is a table | surface which shows the relationship between the FIFO boundary interruption frequency and threshold value which concerns on embodiment of this invention. 本発明に関連する技術のFIFO境界割り込み回数と閾値との関係を示す表である。It is a table | surface which shows the relationship between the FIFO boundary interruption frequency of the technique relevant to this invention, and a threshold value. 本発明に関連する技術を説明するための図である。It is a figure for demonstrating the technique relevant to this invention. 本発明に関連する技術を説明するための図である。It is a figure for demonstrating the technique relevant to this invention. 本発明に関連する技術を説明するための図である。It is a figure for demonstrating the technique relevant to this invention. 本発明に関連する技術を説明するための図である。It is a figure for demonstrating the technique relevant to this invention. 本発明及び本発明に関連する技術における選択パターンを説明するための図である。It is a figure for demonstrating the selection pattern in the technique relevant to this invention and this invention.

まず、図1を参照して、本発明の実施の形態に係るマルチコアシステムの概要について説明する。図1は、本実施の形態に係るマルチコアシステムのハードウェア構成の概要を示すブロック図である。   First, an outline of a multi-core system according to an embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram showing an outline of the hardware configuration of the multi-core system according to the present embodiment.

マルチコアシステム2は、プロセッサコア61、62と、DMA転送用バッファ63と、音声出力部64と、を備える。   The multi-core system 2 includes processor cores 61 and 62, a DMA transfer buffer 63, and an audio output unit 64.

プロセッサコア61は、主系として動作するプログラム610を動作させる。プロセッサコア62は、主系プログラムの予備系として動作するプログラム620を動作させる。プログラム610は、第1及び第2の音声データをミキシングして、ミキシングした合成音声データをDMA転送用バッファ63に格納する。   The processor core 61 operates a program 610 that operates as a main system. The processor core 62 operates a program 620 that operates as a standby system for the main program. The program 610 mixes the first and second audio data, and stores the mixed synthesized audio data in the DMA transfer buffer 63.

DMA転送用バッファ63は、プログラム610、620がミキシングした合成音声データを格納する。音声出力部64は、DMA転送用バッファ63から転送される合成音声データを順次格納し、格納した合成音声データを再生する。   The DMA transfer buffer 63 stores the synthesized voice data mixed by the programs 610 and 620. The voice output unit 64 sequentially stores the synthesized voice data transferred from the DMA transfer buffer 63 and reproduces the stored synthesized voice data.

続いて、本発明の実施の形態に係るマルチコアシステムの処理の概要について説明する。
主系のプログラム610は、第1及び第2の音声データをミキシングして、ミキシングした合成音声データをDMA転送用バッファ63に格納する。そして、DMA転送用バッファ63に格納された合成音声データが一定のデータ量に達したときに、DMA転送用バッファ63に格納された合成音声データが音声出力部64に転送される。音声出力部64は、DMA転送用バッファ63から転送された合成音声データを順次格納し、当該格納した合成音声データを再生する。
Subsequently, an outline of processing of the multi-core system according to the embodiment of the present invention will be described.
The main program 610 mixes the first and second audio data and stores the mixed synthesized audio data in the DMA transfer buffer 63. When the synthesized voice data stored in the DMA transfer buffer 63 reaches a certain amount of data, the synthesized voice data stored in the DMA transfer buffer 63 is transferred to the voice output unit 64. The voice output unit 64 sequentially stores the synthesized voice data transferred from the DMA transfer buffer 63 and reproduces the stored synthesized voice data.

予備系のプログラム620は、DMA転送完了割込み要求の受信に応じてタイマーを設定する。そして、予備系のプログラム620は、所定の時間経過後にタイマーがタイムアウトした場合に、DMA転送用バッファ63に格納されている合成音声データの格納量が、音声出力部64に格納されている合成音声データの格納量に応じて定める所定のデータ量に達しているか否かを判定する。判定の結果、所定のデータ量に達していないときには、予備系のプログラム620は、主系プログラム610が実行していた合成音声データのミキシング及び格納を引き継いで実行する。   The standby program 620 sets a timer in response to receiving the DMA transfer completion interrupt request. Then, when the timer times out after a predetermined time elapses, the standby program 620 determines the amount of synthesized speech data stored in the DMA transfer buffer 63 as the synthesized speech stored in the speech output unit 64. It is determined whether or not a predetermined data amount determined according to the data storage amount has been reached. As a result of the determination, when the predetermined amount of data has not been reached, the standby program 620 takes over the mixing and storing of the synthesized voice data that has been executed by the main program 610.

続いて、図2及び図3を参照して、本発明の実施の形態に係るマルチコアシステムの構成について説明する。図2は、本実施の形態に係るマルチコアシステムのハードウェア構成を示すブロック図である。   Subsequently, the configuration of the multi-core system according to the embodiment of the present invention will be described with reference to FIGS. 2 and 3. FIG. 2 is a block diagram showing a hardware configuration of the multi-core system according to the present embodiment.

図2に示すように、マルチコアシステム1は、組み込み用のMPU10と、音声出力装置20と、外部共有メモリとしてのSDRAM(Synchronous Dynamic Random Access Memory)30と、を備えている。   As shown in FIG. 2, the multi-core system 1 includes a built-in MPU 10, an audio output device 20, and an SDRAM (Synchronous Dynamic Random Access Memory) 30 as an external shared memory.

MPU10は、マルチコアCPUと、周辺デバイス(I2Sデバイス13、I2Cデバイス14、DMAコントローラ15)とがワンチップ化されたIC(Integrated Circuit)である。CPU11、12は、それぞれ1つ又は複数のCPUコアを含む。例えば、4つのCPUコアを有するマルチコアCPUのうち、CPU11は1つのCPUコアを含み、CPU12は3つのCPUコアを含む。また、CPU11、12は、複数のマルチコアCPUから構成されるようにしてもよい。CPUコアは、プロセッサコア61、62に相当する。   The MPU 10 is an integrated circuit (IC) in which a multi-core CPU and peripheral devices (I2S device 13, I2C device 14, and DMA controller 15) are integrated into one chip. Each of the CPUs 11 and 12 includes one or a plurality of CPU cores. For example, among multi-core CPUs having four CPU cores, the CPU 11 includes one CPU core, and the CPU 12 includes three CPU cores. The CPUs 11 and 12 may be composed of a plurality of multi-core CPUs. The CPU core corresponds to the processor cores 61 and 62.

MPU10は、マルチコアCPU上において複数のOSを動作させる。OS110がCPU11上において動作する。OS120がCPU12上において動作する。ここで、OS110とOS120は異なる種類のOSである。例えば、OS110をμITRON等のリアルタイムOSとし、OS120は高機能組み込みOSとする組み合わせが考えられる。高機能組み込みOSとは、例えば、組み込みLinux(登録商標)やWindows CE(登録商標)等である。   The MPU 10 operates a plurality of OSs on the multi-core CPU. The OS 110 operates on the CPU 11. The OS 120 operates on the CPU 12. Here, the OS 110 and the OS 120 are different types of OSs. For example, a combination is conceivable in which the OS 110 is a real-time OS such as μITRON and the OS 120 is a high-function embedded OS. The high-function embedded OS is, for example, embedded Linux (registered trademark) or Windows CE (registered trademark).

OS110上において、アプリケーションプログラム111(図では、略して「アプリ」として示す)、及びデバイスドライバであるサウンドドライバ112が動作する。アプリケーションプログラム111から出力された音声データが、サウンドドライバ112へと入力される。また、OS120上において、アプリケーションプログラム121、122、123(図では、略して「アプリ」としてそれぞれ示す)、サウンドサーバ124、及びデバイスドライバであるサウンドドライバ125が動作する。アプリケーションプログラム121及びアプリケーションプログラム122から出力された音声データは、サウンドサーバ124へと入力される。サウンドサーバ124から出力される音声データと、アプリケーションプログラム123から出力された音声データとが、サウンドドライバ125へと入力される。   On the OS 110, an application program 111 (shown as "application" for short in the figure) and a sound driver 112 as a device driver operate. Audio data output from the application program 111 is input to the sound driver 112. In addition, on the OS 120, application programs 121, 122, and 123 (represented as “apps” for short in the drawing), a sound server 124, and a sound driver 125 that is a device driver operate. The audio data output from the application program 121 and the application program 122 is input to the sound server 124. The sound data output from the sound server 124 and the sound data output from the application program 123 are input to the sound driver 125.

I2Sデバイス13は、I2Sバス(I2S bus)を経由して音声データをADAC&AMP21へと送信する、1系統のデバイスである。I2Sデバイス13はFIFOバッファ131を備えており、FIFOバッファ131に音声データを格納する。ここでは、I2Sデバイス13は、音声データとして、ステレオPCMを扱う。   The I2S device 13 is a one-system device that transmits audio data to the ADAC & AMP 21 via the I2S bus (I2S bus). The I2S device 13 includes a FIFO buffer 131 and stores audio data in the FIFO buffer 131. Here, the I2S device 13 handles stereo PCM as audio data.

I2Cデバイス14は、デバイス制御用のシリアルバスである。I2Cデバイス14は、ADACが備えるレジスタへの読み書きを行うために使用される。   The I2C device 14 is a serial bus for device control. The I2C device 14 is used for reading from and writing to a register included in the ADAC.

DMAコントローラ15は、MPU10の外部に接続されたSDRAM30と、他のデバイス間のDMA転送を制御する。ここでは、SDRAM30上のOS間共有メモリ40から、I2Sデバイス13のFIFOバッファ131への音声データの転送を、DMAコントローラ15の1チャンネルを用いて行う。
The DMA controller 15 controls the DMA transfer between the SDRAM 30 connected to the outside of the MPU 10 and other devices. Here, transfer of audio data from the inter-OS shared memory 40 on the SDRAM 30 to the FIFO buffer 131 of the I2S device 13 is performed using one channel of the DMA controller 15.

尚、本実施の形態では、通常、OS120側のサウンドドライバ125が、音声ミキシング処理及び周辺デバイス(I2Sデバイス13、I2Cデバイス14、DMAコントローラ15)の制御を行うものとして説明する。   In this embodiment, it is assumed that the sound driver 125 on the OS 120 side normally performs audio mixing processing and control of peripheral devices (I2S device 13, I2C device 14, DMA controller 15).

音声出力装置20は、ADAC&AMP21と、スピーカー22とを備えている。ADAC&AMP21は、音声出力装置20の外部インタフェースを構成する。ADAC&AMP21は、I2Sバスを経由して送信される音声データをアナログ信号に変換及び増幅して、スピーカー22を用いて再生する。I2Sデバイス13及び音声出力装置20は、音声出力部64に相当する。   The audio output device 20 includes an ADAC & AMP 21 and a speaker 22. The ADAC & AMP 21 constitutes an external interface of the audio output device 20. The ADAC & AMP 21 converts and amplifies audio data transmitted via the I2S bus into an analog signal and reproduces it using the speaker 22. The I2S device 13 and the audio output device 20 correspond to the audio output unit 64.

SDRAM30は、MPU10の外部にバスを介して接続される、揮発性のメモリ(RAM)である。SDRAM30には、OS間共有メモリ40として、MPU10の複数のOSが共有するメモリ空間が確保される。   The SDRAM 30 is a volatile memory (RAM) connected to the outside of the MPU 10 via a bus. In the SDRAM 30, a memory space shared by a plurality of OSs of the MPU 10 is secured as the OS shared memory 40.

OS間共有メモリ40内には、サウンドキュー(サウンドキュー41、サウンドキュー42、サウンドキュー43)及びDMA転送用バッファ44が設定される。サウンドキューは、アプリケーションプログラムが出力した音声データを格納するリングバッファである。サウンドキューとして、音声データを出力するアプリケーションプログラムの数に相当する数のキューが作成される。ここでは、OS110のアプリケーションプログラム111と、OS120のサウンドサーバ124と、OS120のアプリケーションプログラム123とに相当する、3個のサウンドキュー(サウンドキュー41、サウンドキュー42、サウンドキュー43)が作成される。サウンドキュー(サウンドキュー41、サウンドキュー42、サウンドキュー43)の音声データが音声ミキシング処理された後に、DMA転送用バッファ44に格納される。なお、サウンドキューは、リングバッファ以外のキューイング手段を用いて構成するものとしてもよい。   In the inter-OS shared memory 40, a sound cue (sound cue 41, sound cue 42, sound cue 43) and a DMA transfer buffer 44 are set. The sound cue is a ring buffer that stores audio data output by the application program. A number of cues corresponding to the number of application programs that output audio data are created as sound cues. Here, three sound cues (sound cue 41, sound cue 42, and sound cue 43) corresponding to the application program 111 of OS 110, the sound server 124 of OS 120, and the application program 123 of OS 120 are created. The sound data of the sound cues (sound cues 41, sound cues 42, and sound cues 43) are subjected to sound mixing processing and then stored in the DMA transfer buffer 44. Note that the sound cue may be configured using cueing means other than the ring buffer.

図3は、本実施の形態に係るマルチコアシステムの機能構成を示すブロック図である。図3では、図2において示したサウンドドライバ112を、上位アプリI/F部113とドライバコア部114に分割して示している。また、サウンドドライバ125を、上位アプリI/F部126とドライバコア部127に分割して示している。また、上位アプリI/F部113は、サンプリングレート変換機能116を有する。また、上位アプリI/F部126は、サンプリングレート変換機能130を有する。   FIG. 3 is a block diagram showing a functional configuration of the multi-core system according to the present embodiment. 3, the sound driver 112 shown in FIG. 2 is divided into a higher application I / F unit 113 and a driver core unit 114. Further, the sound driver 125 is divided into a higher application I / F unit 126 and a driver core unit 127. Further, the upper application I / F unit 113 has a sampling rate conversion function 116. Further, the upper application I / F unit 126 has a sampling rate conversion function 130.

上位アプリI/F部113は、アプリケーションプログラム111から出力された音声データをOS間共有メモリ40内のサウンドキュー41に格納する。このときに、上位アプリI/F部113のサンプリングレート変換機能116は、アプリケーションプログラム111から受け取った音声データに対して、サンプリングレートの変換や量子化ビット数の変換を必要に応じて行い、その出力結果を、OS間共有メモリ40内のサウンドキュー41へと格納する。   The upper application I / F unit 113 stores the audio data output from the application program 111 in the sound queue 41 in the inter-OS shared memory 40. At this time, the sampling rate conversion function 116 of the upper application I / F unit 113 performs sampling rate conversion and quantization bit number conversion on the audio data received from the application program 111 as necessary. The output result is stored in the sound queue 41 in the inter-OS shared memory 40.

上位アプリI/F部126は、サウンドサーバ124とアプリケーションプログラム123とから出力された音声データをOS間共有メモリ40内のサウンドキュー42、43に格納する。このときに、上位アプリI/F部126のサンプリングレート変換機能130は、サウンドサーバ124とアプリケーションプログラム123とから受け取った音声データに対して、サンプリングレートの変換や量子化ビット数の変換を必要に応じて行い、その出力結果を、OS間共有メモリ40内のサウンドキュー42、43へと格納する。サンプリングレート変換機能116、130は、例えば、48kHz 24bitの音声を、44.1kHz 16bitの音声へと変換する。   The upper application I / F unit 126 stores the audio data output from the sound server 124 and the application program 123 in the sound queues 42 and 43 in the inter-OS shared memory 40. At this time, the sampling rate conversion function 130 of the upper application I / F unit 126 needs to convert the sampling rate and the quantization bit number for the audio data received from the sound server 124 and the application program 123. The output result is stored in the sound queues 42 and 43 in the inter-OS shared memory 40. The sampling rate conversion functions 116 and 130 convert, for example, 48 kHz 24-bit sound into 44.1 kHz 16-bit sound.

ドライバコア部114、127は、OS間共有メモリ40の各サウンドキューに格納されている音声データをミキシングし、音声ミキシング処理後の音声データを、DMA転送を用いてI2Sデバイス13のFIFOバッファ131へと転送する。尚、本実施の形態では、サウンドドライバ112、125の一部であって、音声ミキシング処理及びI2Sデバイス13、I2Cデバイス14の制御を行う機能部分を、ドライバコア部114、125として定義する。また、音声ミキシング処理とは、各OS上で動作する複数のアプリケーションプログラムからの音声データをミキシングして、単一の音声データとしてDMA転送用の領域(DMA転送用バッファ44)にコピーする処理を指す。   The driver core units 114 and 127 mix the audio data stored in each sound queue of the inter-OS shared memory 40, and the audio data after the audio mixing process is transferred to the FIFO buffer 131 of the I2S device 13 using DMA transfer. And forward. In the present embodiment, a functional part that is a part of the sound drivers 112 and 125 and controls the audio mixing process and the I2S device 13 and the I2C device 14 is defined as the driver core units 114 and 125. The audio mixing process is a process of mixing audio data from a plurality of application programs operating on each OS and copying the audio data to a DMA transfer area (DMA transfer buffer 44) as a single audio data. Point to.

本実施の形態では、システム動作時に、複数のOSのうち、1つのOS(主系)のドライバコア部のみが動作する。その他のOS(予備系)のドライバコア部は、通常は待機状態となっており、主系側のOSがカーネルパニックやフリーズ等した場合にのみ動作する。なお、主系とは、正常時に動作するドライバコア部を有するシステムを指す。予備系とは、主系側の動作不能となった時に動作するドライバコア部を有するシステムを指す。ここで、主系及び予備系とは、あくまでもサウンド再生機能(サウンドドライバの一部機能)についての主系及び予備系であり、主系OS及び予備系OSのことではない。すなわち、予備系側のOSとは、サウンド再生機能に関する予備系としての機能を備えているOSのことを指す。   In the present embodiment, only the driver core unit of one OS (main system) among a plurality of OSs operates during system operation. Other OS (standby) driver core units are normally in a standby state, and operate only when the OS on the main system side performs a kernel panic, freeze, or the like. The main system refers to a system having a driver core unit that operates in a normal state. The standby system refers to a system having a driver core unit that operates when the main system becomes inoperable. Here, the main system and the standby system are the main system and the standby system for the sound reproduction function (part of the function of the sound driver), and are not the main system OS and the standby system OS. That is, the OS on the standby system side refers to an OS having a function as a backup system related to the sound reproduction function.

ソフトウェアミキサ128は、ドライバコア部127が呼び出す関数である。ソフトウェアミキサ128は、各サウンドキューに格納された音声データをミキシングし、DMA転送用バッファ44に格納する。   The software mixer 128 is a function that the driver core unit 127 calls. The software mixer 128 mixes the audio data stored in each sound queue and stores it in the DMA transfer buffer 44.

共通割り込み制御部16は、各CPUコアに対して、割り込み要求(IRQ)の割り振りを行う。共通割り込み制御部16は、基本的には、MPU10内にハードウェアの機能として備えられる。なお、ハードウェアの機能として共通割り込み制御部16がMPU10内に搭載されていない場合には、ソフトウエアの機能として実装することも可能である。   The common interrupt control unit 16 allocates an interrupt request (IRQ) to each CPU core. The common interrupt control unit 16 is basically provided as a hardware function in the MPU 10. When the common interrupt control unit 16 is not installed in the MPU 10 as a hardware function, it can be implemented as a software function.

共通割込み制御部16に入力される割り込み要求は、音声データのDMA転送が完了した場合に、DMAコントローラ15が発行するDMA転送完了割り込みと、I2Sデバイス13が発行するFIFO境界割り込みと、を含む。DMAコントローラ15は、音声データのDMA転送が完了した場合に、DMA転送完了割り込みを発行する。DMA転送完了割り込みの発生から一定の時間内にDMA転送開始要求が無い場合には、I2Sデバイス13のFIFOバッファ131が空となり、I2Sアンダーランエラーが発生する。また、I2Sデバイス13は、FIFOバッファ131に溜まっているデータが4バイト境界になった都度、FIFO境界割り込みを発行する。   The interrupt request input to the common interrupt control unit 16 includes a DMA transfer completion interrupt issued by the DMA controller 15 and a FIFO boundary interrupt issued by the I2S device 13 when the DMA transfer of audio data is completed. The DMA controller 15 issues a DMA transfer completion interrupt when the DMA transfer of audio data is completed. If there is no DMA transfer start request within a certain time from the occurrence of the DMA transfer completion interrupt, the FIFO buffer 131 of the I2S device 13 becomes empty and an I2S underrun error occurs. Further, the I2S device 13 issues a FIFO boundary interrupt every time the data accumulated in the FIFO buffer 131 becomes a 4-byte boundary.

ドライバ管理部115は、予備系側のOSの割り込みハンドラが呼び出す関数群である。ドライバ管理部115は、HWタイマー17の設定、FIFO境界割り込みの開始/停止命令の設定や、主系のドライバコア部を用いた動作を予備系のドライバコア部を用いた動作へと切り替える切り替え処理を行う。尚、ここでは、HWタイマー17は、MPU10が備えるハードウェアタイマーを指す。   The driver management unit 115 is a function group called by the interrupt handler of the OS on the standby system side. The driver management unit 115 sets the HW timer 17, sets the FIFO boundary interrupt start / stop command, and the switching process that switches the operation using the main driver core unit to the operation using the standby driver core unit. I do. Here, the HW timer 17 refers to a hardware timer provided in the MPU 10.

続いて、本発明の実施の形態に係るマルチコアシステムの動作を概略的に説明する。
まず、DMA転送処理及び音声ミキシング処理の流れについて説明する。
SDRAM30からFIFOバッファ131に対してDMA転送が行われた後に、複数のOS110、120がDMA転送完了割り込みを受信する。主系側のOS120が正常に動作している場合には、受信したDMA転送完了割り込みが、DMA転送完了割り込みスレッド129に到達する。そして、DMA転送完了割り込みスレッド129は音声データのDMA転送完了割り込みをトリガとして動作し、DMA転送完了割り込みスレッド129内において音声データの音声ミキシング処理及びDMA転送開始要求処理が行われる。そして、DMA転送用バッファ44に格納された音声ミキシング処理後の音声データが、SDRAM30からFIFOバッファ131に対してDMA転送される。
Subsequently, the operation of the multi-core system according to the embodiment of the present invention will be schematically described.
First, the flow of DMA transfer processing and audio mixing processing will be described.
After the DMA transfer from the SDRAM 30 to the FIFO buffer 131, the plurality of OSs 110 and 120 receive a DMA transfer completion interrupt. When the master system OS 120 is operating normally, the received DMA transfer completion interrupt reaches the DMA transfer completion interrupt thread 129. The DMA transfer completion interrupt thread 129 operates using a voice data DMA transfer completion interrupt as a trigger, and voice data voice mixing processing and DMA transfer start request processing are performed in the DMA transfer completion interrupt thread 129. The audio data after the audio mixing process stored in the DMA transfer buffer 44 is DMA-transferred from the SDRAM 30 to the FIFO buffer 131.

尚、マルチコアシステム1では、音声ミキシング処理及びDMA転送開始要求処理の処理順序に関して、主系側のOS120における音声ミキシング処理時間とI2Sアンダーランエラーの関係に基づいて、上述したパターンA又はパターンBのいずれかのパターンが選択される。本実施の形態では、DMAアンダーランエラーとミキシング処理時間は実施環境のスペックに応じて決まるため、選択条件「音声ミキシング処理時間<DMA転送間隔<(音声ミキシング処理時間×2)」を満たす場合を対象とし、パターンAが予め選択されるものとして説明する。すなわち、本実施の形態では、DMA転送開始要求処理に先立ち、音声ミキシング処理が行われる。   In the multi-core system 1, regarding the processing order of the audio mixing processing and the DMA transfer start request processing, the pattern A or the pattern B described above is based on the relationship between the audio mixing processing time and the I2S underrun error in the OS 120 on the main system side. Either pattern is selected. In this embodiment, since the DMA underrun error and the mixing processing time are determined according to the specifications of the implementation environment, the case where the selection condition “voice mixing processing time <DMA transfer interval <(voice mixing processing time × 2)” is satisfied. A description will be given assuming that the pattern A is selected in advance. That is, in this embodiment, the audio mixing process is performed prior to the DMA transfer start request process.

次に、本発明の実施の形態に係るマルチコアシステムの動作のうち、主系側のOSの監視機能と、予備系への切り替え機能について説明する。
まず、予備系側のOS110がDMA転送完了割込みを受信した場合には、予備系側のOS110のドライバ管理部115が、HWタイマー17を設定する。
Next, of the operations of the multi-core system according to the embodiment of the present invention, the OS monitoring function on the main system side and the switching function to the standby system will be described.
First, when the standby-system OS 110 receives a DMA transfer completion interrupt, the driver management unit 115 of the standby-system OS 110 sets the HW timer 17.

設定されたHWタイマー17の解除は、主系側のOS120のDMA転送完了割り込みスレッド129が行う。具体的には、主系側のOS120のDMA転送完了割り込みスレッド129にDMA転送完了割り込みが到達した場合には、DMA転送完了割り込みスレッド129が、上記設定されたHWタイマー17を解除する。また、HWタイマー17は、ミキシング終了処理時間(DMAアンダーランエラー発生時間−予備系での音声ミキシング処理時間)の経過時にタイムアウトする。これにより、主系側のOS120のDMA転送完了割り込みスレッド129にDMA転送完了割り込みが到達せず、かつ、ミキシング終了処理時間が経過した場合には、設定したHWタイマー17が解除されずにタイムアウトする。   The set HW timer 17 is released by the DMA transfer completion interrupt thread 129 of the OS 120 on the main system side. Specifically, when the DMA transfer completion interrupt thread 129 reaches the DMA transfer completion interrupt thread 129 of the OS 120 on the main system side, the DMA transfer completion interrupt thread 129 releases the set HW timer 17. Further, the HW timer 17 times out when the mixing end processing time (DMA underrun error occurrence time−voice mixing processing time in the standby system) elapses. As a result, when the DMA transfer completion interrupt does not reach the DMA transfer completion interrupt thread 129 of the OS 120 on the main system side and the mixing end processing time has elapsed, the set HW timer 17 is not released and times out. .

タイムアウトしたHWタイマー17は、予備系側のOS110のドライバ管理部115へとタイマー割り込みを発行する。予備系側のOS110のドライバ管理部115は、HWタイマー17からのタイマー割り込みを受信した場合には、I2Sデバイス13に対してFIFO境界割り込みの開始を要求する。このように、選択条件「音声ミキシング処理時間<DMA転送間隔<(音声ミキシング処理時間×2)」を満たす場合において、予備系側のドライバ管理部115がDMA転送完了割込みを受信したときには、ミキシング終了処理時間の経過をトリガとして、I2Sデバイス13からのFIFO境界割り込みの開始を許可する。   The timed-out HW timer 17 issues a timer interrupt to the driver management unit 115 of the OS 110 on the standby side. When receiving the timer interrupt from the HW timer 17, the driver management unit 115 of the standby OS 110 requests the I2S device 13 to start a FIFO boundary interrupt. As described above, when the selection condition “voice mixing processing time <DMA transfer interval <(voice mixing processing time × 2)” is satisfied, when the backup side driver management unit 115 receives the DMA transfer completion interrupt, the mixing is completed. The start of a FIFO boundary interrupt from the I2S device 13 is permitted with the passage of the processing time as a trigger.

予備系側のOS110のドライバ管理部115は、I2Sデバイス13からのFIFO境界割り込みを受信した場合、DMA転送用バッファ44に格納されている音声データのサンプル数が所定の閾値に達しているか否かを判定する。判定の結果、音声データのサンプル数が、FIFOバッファ131に格納されている音声データのサンプル数から算出される所定の閾値に達していない場合、ドライバ管理部115は、主系のドライバコア部127を用いた動作を予備系のドライバコア部114を用いた動作へと切り替える切り替え処理を行う。ドライバ管理部115は、予備系への切替え処理を行った後、I2Sデバイス13からのFIFO境界割り込みの受信を禁止する。   When the driver management unit 115 of the standby-side OS 110 receives the FIFO boundary interrupt from the I2S device 13, whether or not the number of audio data samples stored in the DMA transfer buffer 44 has reached a predetermined threshold value. Determine. As a result of the determination, if the number of audio data samples has not reached a predetermined threshold calculated from the number of audio data samples stored in the FIFO buffer 131, the driver management unit 115 sets the main driver core unit 127. A switching process for switching the operation using the operation to the operation using the spare driver core unit 114 is performed. The driver management unit 115 prohibits reception of the FIFO boundary interrupt from the I2S device 13 after performing the switching process to the standby system.

これにより、DMA転送用バッファ44の音声データの格納量が、必要なデータ量となっているか否かを比較判定することで、主系側のOS120の動作不能を監視することが可能となる。   Accordingly, it is possible to monitor the inoperability of the OS 120 on the main system side by comparing and determining whether or not the amount of audio data stored in the DMA transfer buffer 44 is a necessary data amount.

尚、所定の閾値とは、FIFOバッファ131に格納されている残りの音声データが全てデキューされるまでに、残りの音声ミキシング処理及びDMA転送開始要求処理の実行を完了させることが可能なサンプル数の音声データがDMA転送用バッファ44に格納されているかどうかを判定するための基準値である。つまり、DMA転送用バッファ44に格納されている音声データのサンプル数が、所定の閾値に達している場合は、その時点から残りの音声ミキシング処理及びDMA転送開始要求処理を実行しても、I2Sアンダーランエラーが発生しないことになる。   The predetermined threshold is the number of samples that can complete execution of the remaining audio mixing processing and DMA transfer start request processing until all the remaining audio data stored in the FIFO buffer 131 is dequeued. Is the reference value for determining whether or not the audio data is stored in the DMA transfer buffer 44. That is, if the number of audio data samples stored in the DMA transfer buffer 44 has reached a predetermined threshold, the remaining I2S processing and DMA transfer start request processing are executed even if the remaining audio mixing processing and DMA transfer start request processing are executed. Underrun error will not occur.

FIFOバッファ131に格納されている音声データのサンプル数は、例えば、FIFOバッファ131のレジスタを参照することによって特定することができる。また、FIFO境界割り込みが発生した回数によって、FIFOバッファ131からデキューされた音声データのサイズが分かる。そのため、そのサイズによってFIFOバッファ131からデキューされた音声データのサンプル数が分かるため、FIFO境界割り込みが発生した回数から、FIFOバッファ131に格納されている音声データのサンプル数を算出するようにしてもよい。   The number of samples of audio data stored in the FIFO buffer 131 can be specified by referring to a register of the FIFO buffer 131, for example. Also, the size of the audio data dequeued from the FIFO buffer 131 can be determined by the number of times the FIFO boundary interrupt has occurred. Therefore, since the number of samples of the audio data dequeued from the FIFO buffer 131 can be known based on the size, the number of samples of the audio data stored in the FIFO buffer 131 may be calculated from the number of times the FIFO boundary interrupt has occurred. Good.

予備系のドライバコア部114へと動作が切り替えられた場合には、予備系のドライバコア部114は、主系側のドライバコア部127が途中まで行った音声ミキシング処理を引き継いで実行する。予備系のドライバコア部114は、DMA転送用バッファ44に格納されている音声データのサンプル数を参照することで、主系側のドライバコア部127がミキシングした音声データのサンプル数を特定することができる。これにより、サウンドキュー41、42、43に格納されている音声データのうちから、引き継いでミキシングを開始する音声データを特定することができる。なお、DMA転送用バッファ44に格納されている音声データのサンプル数は、ソフトウェアミキサ128がOS間共有メモリ40にその値を格納しておくことによって特定することができるようにしてもよく、DMA転送用バッファ44に格納されている音声データのサンプル数を数えることによって特定することができるようにしてもよい。   When the operation is switched to the standby driver core unit 114, the standby driver core unit 114 takes over and executes the audio mixing processing performed halfway by the driver core unit 127 on the main system side. The backup driver core unit 114 refers to the number of audio data samples stored in the DMA transfer buffer 44 to identify the number of audio data samples mixed by the main driver core unit 127. Can do. As a result, it is possible to specify the audio data to be taken over from the audio data stored in the sound cues 41, 42, and 43. The number of audio data samples stored in the DMA transfer buffer 44 may be specified by the software mixer 128 storing the value in the inter-OS shared memory 40. It may be specified by counting the number of audio data samples stored in the transfer buffer 44.

続いて、図4及び図5を参照して、本実施の形態に係る動作及び本発明に関連する技術の動作を説明する。尚、図3に示したように、FIFO境界割り込みは共通割り込み制御部16を経由してドライバ管理部115に出力されるが、図4及び図5ではその点について省略して記載している。   Next, the operation according to the present embodiment and the operation of the technology related to the present invention will be described with reference to FIGS. As shown in FIG. 3, the FIFO boundary interrupt is output to the driver management unit 115 via the common interrupt control unit 16, but this point is omitted in FIGS.

図4は、本実施の形態に係る動作シーケンス図である。ここでは、正常に動作している主系側のOS120が、DMA転送完了割り込みを受信した後の処理について説明する。
まず、DMA転送完了割り込みをMPU10が受信した場合には、共通割り込み制御部16は、複数のCPUコアに対して、割り込み要求(IRQ)を送信する(S101)。
FIG. 4 is an operation sequence diagram according to the present embodiment. Here, a description will be given of processing after the main OS OS 120 operating normally receives a DMA transfer completion interrupt.
First, when the MPU 10 receives a DMA transfer completion interrupt, the common interrupt control unit 16 transmits an interrupt request (IRQ) to a plurality of CPU cores (S101).

共通割込み制御部16から割り込み要求を受信した場合、予備系側のOS110上において動作するドライバ管理部115は、HWタイマー17を設定する(S102)。
また、共通割込み制御部16から割り込み要求を受信した場合、主系側のOS120は、割込みハンドラを用いてDMA転送完了割り込みスレッド129に対して割り込みを出力する。そして、DMA転送完了割り込みスレッド129は、音声データのDMA転送完了割り込みをトリガとして動作し、DMA転送完了割り込みスレッド129内において音声データの音声ミキシング処理及びDMA転送開始要求処理が行われる。
When an interrupt request is received from the common interrupt control unit 16, the driver management unit 115 operating on the standby OS 110 sets the HW timer 17 (S102).
Further, when an interrupt request is received from the common interrupt control unit 16, the main system OS 120 outputs an interrupt to the DMA transfer completion interrupt thread 129 using an interrupt handler. The DMA transfer completion interrupt thread 129 operates using a voice data DMA transfer completion interrupt as a trigger, and voice data voice mixing processing and DMA transfer start request processing are performed in the DMA transfer completion interrupt thread 129.

ミキシング終了処理時間が経過することでHWタイマー17がタイムアウトした場合には、HWタイマー17は、予備系側のドライバ管理部115に対してタイマー割り込みを出力する(S104)。タイマー割り込みを受信した予備系側のドライバ管理部115は、I2Sデバイス13に対してFIFO境界割り込み開始要求を行う(S105)。すなわち、HWタイマー17のタイムアウトをトリガとして、I2Sデバイス13からのFIFO境界割り込みを許可する。尚、HWタイマー17がタイムアウトするよりも前に、DMA転送完了割込みスレッド129がミキシング処理を完了してタイマーを解除した場合には、タイマー割込みとFIFO境界割込みは発生しない。タイマーの解除後、DMA転送完了割込みスレッド129は、DMA転送開始要求を行う。   If the HW timer 17 times out due to the mixing end processing time elapses, the HW timer 17 outputs a timer interrupt to the driver management unit 115 on the standby side (S104). The driver management unit 115 on the standby side that has received the timer interrupt makes a FIFO boundary interrupt start request to the I2S device 13 (S105). That is, the FIFO boundary interrupt from the I2S device 13 is permitted using the timeout of the HW timer 17 as a trigger. If the DMA transfer completion interrupt thread 129 completes the mixing process and releases the timer before the HW timer 17 times out, the timer interrupt and the FIFO boundary interrupt do not occur. After the timer is released, the DMA transfer completion interrupt thread 129 makes a DMA transfer start request.

FIFO境界割り込み開始要求を受信したI2Sデバイス13は、予備系側のドライバ管理部115に対してFIFO境界割り込みの出力を開始する(S106)。そして、FIFO境界割り込みを受信した予備系側のドライバ管理部115は、DMA転送用バッファ44に格納されている音声データのサンプル数を取得して、取得したサンプル数が閾値に達しているか否かを判定する。   Upon receiving the FIFO boundary interrupt start request, the I2S device 13 starts outputting the FIFO boundary interrupt to the standby side driver management unit 115 (S106). Then, the driver management unit 115 on the standby side that has received the FIFO boundary interrupt acquires the number of samples of the audio data stored in the DMA transfer buffer 44, and whether or not the acquired number of samples has reached the threshold value. Determine.

判定の結果、サンプル数が閾値に達している場合には、ドライバ管理部115は、主系側のドライバコア127が正常に動作して音声ミキシング処理を行っているため、予備系のドライバコア部114への動作の切り替えは行わない。一方で、サンプル数が閾値に達していない場合には、主系側のドライバコア部127が正常に動作していないため、ドライバ管理部115は、予備系のドライバコア部114への動作の切り替えを行う。具体的には、ドライバ管理部115は、予備系側のドライバコア部114に対して音声ミキシング処理の開始を要求する。これにより、予備系側のドライバコア部114が、音声ミキシング処理を開始する。   As a result of the determination, if the number of samples has reached the threshold value, the driver management unit 115 performs the audio mixing processing by operating the driver core 127 on the main system side normally. The operation is not switched to 114. On the other hand, if the number of samples has not reached the threshold value, the driver core unit 127 on the main system side is not operating normally, and the driver management unit 115 switches the operation to the standby driver core unit 114. I do. Specifically, the driver management unit 115 requests the driver core unit 114 on the standby side to start the audio mixing process. As a result, the driver core unit 114 on the standby side starts the audio mixing process.

音声ミキシング処理が正常に終了した場合、主系側のドライバコア部127は、FIFO境界割り込み停止要求をI2Sデバイス13に対して出力する(S107)。I2Sデバイス13は、FIFO境界割り込み停止要求の出力を受けると、FIFO境界割り込みの出力を停止する。   When the audio mixing process is normally completed, the main driver core unit 127 outputs a FIFO boundary interrupt stop request to the I2S device 13 (S107). When receiving the output of the FIFO boundary interrupt stop request, the I2S device 13 stops the output of the FIFO boundary interrupt.

尚、予備系のドライバコア部114への動作が切り替えられた場合には、予備系のドライバコア部114は、I2Sデバイス13に対してFIFO境界割り込み停止要求を出力する。I2Sデバイス13は、FIFO境界割り込み停止要求の出力を受けると、FIFO境界割り込みの出力を停止する。そして、予備系のドライバコア部114は、主系側のOS120が動作不能となったところから、音声データの音声ミキシング処理を引き継いで行う。   When the operation to the standby driver core unit 114 is switched, the standby driver core unit 114 outputs a FIFO boundary interrupt stop request to the I2S device 13. When receiving the output of the FIFO boundary interrupt stop request, the I2S device 13 stops the output of the FIFO boundary interrupt. Then, the spare driver core unit 114 takes over the audio mixing processing of the audio data from the point where the OS 120 on the main system side becomes inoperable.

図5は、本発明に関連する技術(特願2009−262545)の動作シーケンス図である。ここでは、正常に動作している主系側のOS120が、DMA転送完了割り込みを受信した後の処理について説明する。尚、特願2009−262545に開示されるマルチコアシステムは、本実施の形態に係るマルチコアシステムと略同様の構成を有しているが、HWタイマーを利用しておらず、予備系側のドライバ管理部が有する機能が異なっている。また、図5において示すS201の処理は図4で示したS101での処理と同一であるため、ここではその説明を省略する。   FIG. 5 is an operation sequence diagram of a technique (Japanese Patent Application No. 2009-262545) related to the present invention. Here, a description will be given of processing after the main OS OS 120 operating normally receives a DMA transfer completion interrupt. The multi-core system disclosed in Japanese Patent Application No. 2009-262545 has substantially the same configuration as that of the multi-core system according to the present embodiment, but does not use the HW timer and manages the driver on the standby side. The part has different functions. Further, the process of S201 shown in FIG. 5 is the same as the process of S101 shown in FIG.

共通割込み制御部16から割り込み要求を受信した場合、予備系側のドライバ管理部は、I2Sデバイス13に対してFIFO境界割り込み開始要求を行う(S202)。すなわち、共通割込み制御部16からの割り込み要求の受信をトリガとして、I2Sデバイス13からのFIFO境界割り込みを許可する。   When an interrupt request is received from the common interrupt control unit 16, the standby side driver management unit issues a FIFO boundary interrupt start request to the I2S device 13 (S202). That is, the FIFO boundary interrupt from the I2S device 13 is permitted with the reception of the interrupt request from the common interrupt control unit 16 as a trigger.

また、共通割込み制御部16から割り込み要求を受信した場合、主系側のOS120は、割込みハンドラを用いてDMA転送完了割り込みスレッド129に対して割り込みを出力する。そして、DMA転送完了割り込みスレッド129内において音声データの音声ミキシング処理及びDMA転送開始要求処理が行われる。   Further, when an interrupt request is received from the common interrupt control unit 16, the main system OS 120 outputs an interrupt to the DMA transfer completion interrupt thread 129 using an interrupt handler. Then, in the DMA transfer completion interrupt thread 129, voice data mixing processing and DMA transfer start request processing are performed.

FIFO境界割り込み開始要求を受信したI2Sデバイス13は、予備系側のドライバ管理部に対してFIFO境界割り込みの出力を開始する(S204)。予備系側のドライバ管理部は、DMA転送用バッファ44に格納されている音声データのサンプル数が、閾値に達しているか否かを判定し、判定結果に応じて、予備系のドライバコア部への動作の切り替えを行う。   The I2S device 13 that has received the FIFO boundary interrupt start request starts outputting the FIFO boundary interrupt to the standby side driver management unit (S204). The spare side driver management unit determines whether or not the number of samples of the audio data stored in the DMA transfer buffer 44 has reached a threshold value, and depending on the determination result, the spare side driver management unit proceeds to the standby side driver core unit. Switch the operation of.

音声ミキシング処理が終了した場合、主系側のドライバコア部127は、FIFO境界割り込み停止要求をI2Sデバイス13に対して出力する(S205)。I2Sデバイス13は、FIFO境界割り込み停止要求の出力を受けると、FIFO境界割り込みの出力を停止する。   When the audio mixing process is completed, the driver core unit 127 on the main system side outputs a FIFO boundary interrupt stop request to the I2S device 13 (S205). When receiving the output of the FIFO boundary interrupt stop request, the I2S device 13 stops the output of the FIFO boundary interrupt.

続いて、図6及び7を参照して、本発明に関連する技術に対する、本実施の形態の効果について説明する。
図6及び7では、マルチコアシステム1の動作スペックとして、音声サンプリング周波数が約48000Hz(実際の値は、1/(0.00001875)=53333.33Hz)であり、I2Sアンダーランエラー発生時間が1200μsであり、音声ミキシング処理時間が650μsであり、DMA転送単位が1024サンプルである場合に決定される閾値の一例を示している。約48000Hzという値は、MPEG(Moving Picture Experts Group)動画における音声出力等で使用される周波数である。また、この例では、HWタイマー17がタイムアウトする時間は550μs(1200μs−650μs)である。
Next, with reference to FIGS. 6 and 7, the effect of the present embodiment on the technology related to the present invention will be described.
6 and 7, as the operation specifications of the multi-core system 1, the audio sampling frequency is about 48000 Hz (actual value is 1 / (0.00001875) = 533333.33 Hz), and the I2S underrun error occurrence time is 1200 μs. Yes, an example of a threshold value determined when the audio mixing processing time is 650 μs and the DMA transfer unit is 1024 samples is shown. A value of about 48000 Hz is a frequency used for audio output or the like in a moving picture experts group (MPEG) moving image. In this example, the time for the HW timer 17 to time out is 550 μs (1200 μs-650 μs).

また、図6及び7では、FIFOバッファ131は、段数が32段であり、4段分のデータを送出するのに150μs(1段分の送出に37.5μs)が必要な場合を例示している。ここで、1段に1サンプルの音声データが格納されている。また、ミキシングされた音声データのサイズが4byteであるものとする。つまり、FIFOバッファ131に格納されている音声データが32(4byte×8段)バイト減少する毎に、FIFO境界割り込みが発生する場合について例示している。   In FIGS. 6 and 7, the FIFO buffer 131 has 32 stages and exemplifies a case where 150 μs (37.5 μs for transmission for one stage) is required to transmit four stages of data. Yes. Here, one sample of audio data is stored in one stage. Also, it is assumed that the size of the mixed audio data is 4 bytes. That is, the case where a FIFO boundary interrupt occurs every time the audio data stored in the FIFO buffer 131 is reduced by 32 (4 bytes × 8 stages) bytes is illustrated.

図6及び7において、「FIFO境界割り込み回数」は、DMA転送完了割り込みの受信時を起点とした割り込みの回数を示す。また、「FIFO境界割り込みが発生する時間」は、DMA転送完了割り込みの受信時を起点とした時間を示す。尚、閾値は、FIFOバッファ131に格納されている音声データのサンプル数と、音声サンプリング周波数から算出可能である。   6 and 7, “FIFO boundary interrupt count” indicates the number of interrupts starting from the reception of the DMA transfer completion interrupt. The “time when the FIFO boundary interrupt occurs” indicates the time from the time of receiving the DMA transfer completion interrupt. Note that the threshold value can be calculated from the number of audio data samples stored in the FIFO buffer 131 and the audio sampling frequency.

図6に示す閾値の例について説明する。例えば、2回目のFIFO境界割り込みが発生した場合、FIFOバッファ131の残りサンプル数は12サンプルである(すなわち、12サンプルが送出される)。このため、150μs(残り12サンプルを150μsで)が経過するとI2Sアンダーランエラーが発生すると算出することができる。ここで、150μsの余裕を持ってDMA転送単位のサンプル数の音声データのミキシングが完了していることを期待値とした場合、2回目のFIFO境界割り込みが発生した時点で、DMA転送用バッファ44には18サンプルの音声データが格納されている必要がある。このため、閾値を「18」としている。   An example of the threshold shown in FIG. 6 will be described. For example, when the second FIFO boundary interrupt occurs, the number of remaining samples in the FIFO buffer 131 is 12 samples (that is, 12 samples are transmitted). Therefore, it can be calculated that an I2S underrun error occurs after 150 μs (the remaining 12 samples are 150 μs). Here, assuming that the mixing of the audio data of the number of samples in the DMA transfer unit with a margin of 150 μs is an expected value, the DMA transfer buffer 44 is generated when the second FIFO boundary interrupt occurs. Needs to store audio data of 18 samples. For this reason, the threshold is set to “18”.

予備系側のドライバ管理部115は、例えば、FIFOバッファ131の残りサンプル数や音声サンプリング周波数から閾値を算出する計算式や、FIFOバッファ131の残りサンプル数から閾値を特定する図6に示したテーブルなどを参照可能となるように構成することで、閾値を特定可能とする。この計算式又はテーブルは、例えば、ドライバ管理部115自身や、OS間共有メモリ40が有することで、ドライバ管理部115が参照可能とする。   The standby-side driver management unit 115 calculates, for example, a threshold value from the number of remaining samples in the FIFO buffer 131 and the audio sampling frequency, and the table shown in FIG. 6 that identifies the threshold from the number of remaining samples in the FIFO buffer 131. The threshold value can be specified by configuring so that reference can be made. This calculation formula or table can be referred to by the driver management unit 115 by having the driver management unit 115 itself or the inter-OS shared memory 40, for example.

図6及び図7に示すように、本発明に関連する技術(図7)ではFIFO境界割り込みの発生回数が7回となるのに対して、本実施の形態(図6)では4回に留まる。すなわち、本発明に関連する技術に比べて、本実施の形態によれば、FIFO境界割り込みの発生回数を少なくすることができる。従って、予備系側のパフォーマンスへの影響を軽減することができる。   As shown in FIGS. 6 and 7, the technique related to the present invention (FIG. 7) generates seven FIFO boundary interrupts, whereas the present embodiment (FIG. 6) stays only four times. . That is, compared with the technique related to the present invention, according to the present embodiment, the number of FIFO boundary interrupts can be reduced. Therefore, it is possible to reduce the influence on the performance on the standby side.

以上に説明した本実施の形態によれば、単一のマルチコアCPU上にそれぞれ搭載された複数のOS間が、音声出力用のI2Sバスを共有するマルチコアシステムにおいて、主系側のOSがダウンした場合においても予備系側のOSからの音声出力が途切れることを回避することができる。
さらに、本実施の形態によれば、「ミキシング処理時間<DMA転送間隔<(ミキシング処理時間×2)」である場合において、予備系側OSのパフォーマンスを低下させずに、アプリケーションが参照可能なパラメータである音声データの再生済みサンプル数と、実際の音声データの再生済みサンプル数との誤差を最小にすることができる。
According to the present embodiment described above, in a multi-core system in which a plurality of OSs mounted on a single multi-core CPU share an I2S bus for audio output, the OS on the main system side goes down. Even in this case, it is possible to avoid interruption of audio output from the OS on the standby side.
Further, according to the present embodiment, in the case of “mixing processing time <DMA transfer interval <(mixing processing time × 2)”, the parameters that can be referred to by the application without degrading the performance of the standby OS. The error between the number of reproduced samples of audio data and the number of reproduced samples of actual audio data can be minimized.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、MPU10が2つのOS110、120を備えている場合を例に説明したが、本発明はこれに限定されない。すなわち、MPU10が3つ以上のOSを備えるものとしてもよい。かかる場合には、予備系側のOSが複数存在することになる。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention. For example, although the case where the MPU 10 includes two OSs 110 and 120 has been described as an example, the present invention is not limited to this. That is, the MPU 10 may include three or more OSs. In such a case, there are a plurality of OSs on the standby side.

1 マルチコアシステム、
10 MPU、
11、12 CPU、
13 I2Sデバイス、
14 I2Cデバイス、
15 DMAコントローラ、
16 共通割り込み制御部、
17 HWタイマー、
20 音声出力装置、
21 ADAC&AMP、
22 スピーカー、
30 SDRAM、
40 OS間共有メモリ、
41、42、43 サウンドキュー、
44 DMA転送用バッファ、
110、120 OS、
131 FIFOバッファ、
111、121、122、123 アプリ、
112、125 サウンドドライバ、
113、126 上位アプリI/F部、
114、127 ドライバコア部、
115 ドライバ管理部、
116、130 サンプリングレート変換機能、
124 サウンドサーバ、
128 ソフトウェアミキサ、
129 DMA転送割り込みスレッド、

2 マルチコアシステム、
61、62 プロセッサコア、
63 DMA転送用バッファ、
64 音声出力部、
610、620 プログラム、

50 組み込み用MPU、
51 AUDIO DAC、

216 共通割り込み制御部、
217 HWタイマー、
230 SDRAM、
240 OS間共有メモリ、
241、242、243 サウンドキュー、
244 DMA転送用バッファ、
310 OS[1]、
311 アプリ[1]、
313 上位アプリI/F部、
314 ドライバコア部、
315 ドライバ管理部、
320 OS[2]、
323 アプリ[4]
324 サウンドサーバ、
326 上位アプリI/F部、
327 ドライバコア部、
328 ソフトウェアミキサ、
329 DMA転送完了割り込みスレッド、
1 multi-core system,
10 MPU,
11, 12 CPU,
13 I2S devices,
14 I2C devices,
15 DMA controller,
16 Common interrupt controller,
17 HW timer,
20 audio output device,
21 ADAC & AMP,
22 speakers,
30 SDRAM,
40 OS shared memory,
41, 42, 43 Sound cue,
44 DMA transfer buffer,
110, 120 OS,
131 FIFO buffer,
111, 121, 122, 123 apps,
112, 125 sound driver,
113, 126 Upper application I / F part,
114, 127 driver core part,
115 Driver management unit,
116, 130 Sampling rate conversion function,
124 sound server,
128 software mixer,
129 DMA transfer interrupt thread,

2 multi-core system,
61, 62 processor cores,
63 DMA transfer buffer,
64 audio output unit,
610, 620 programs,

50 MPU for installation,
51 AUDIO DAC,

216 common interrupt controller,
217 HW timer,
230 SDRAM,
240 OS shared memory,
241, 242, 243 Sound cue,
244 DMA transfer buffer,
310 OS [1],
311 app [1],
313 Host application I / F part,
314 Driver core part,
315 Driver management unit,
320 OS [2],
323 application [4]
324 sound server,
326 Upper application I / F part,
327 driver core part,
328 software mixer,
329 DMA transfer completion interrupt thread,

Claims (7)

1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納する主系プログラムを動作させる第1のプロセッサコアと、
前記主系プログラムの予備系として動作する予備系プログラムを動作させる第2のプロセッサコアと、
前記DMA転送用バッファから転送される合成音声データを順次格納し、当該格納した合成音声データを再生する音声出力部と、を備え、
前記予備系プログラムは、
DMA転送完了割込み要求の受信に応じてタイマーを設定し、所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部に格納されている合成音声データの格納量に応じて定める所定のデータ量に達しているか否かを判定し、当該所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行する
ことを特徴とするマルチコアシステム。
A first processor core for operating a main program for mixing the first and second audio data and storing the mixed synthesized audio data in a DMA transfer buffer;
A second processor core that operates a standby system program that operates as a standby system of the main system program;
A voice output unit that sequentially stores the synthesized voice data transferred from the DMA transfer buffer and reproduces the stored synthesized voice data;
The preliminary program is
A timer is set in response to the reception of the DMA transfer completion interrupt request, and when the timer times out after a predetermined time elapses, the storage amount of the synthesized voice data stored in the DMA transfer buffer is the voice output unit. It is determined whether or not a predetermined amount of data determined according to the amount of synthesized speech data stored in is reached, and when the predetermined amount of data has not been reached, the synthesis executed by the main system program A multi-core system that performs mixing and storage of audio data.
前記タイマーがタイムアウトする所定の時間を、
DMAアンダーランエラー発生時間から、前記主系のプログラムが実行していた合成音声データのミキシングを前記予備系のプログラムが引き継いだ場合に前記予備系のプログラムがミキシング処理に要する時間を控除して算出したミキシング処理終了時間とする
ことを特徴とする請求項1に記載のマルチコアシステム。
A predetermined time for the timer to time out,
Calculated by subtracting the time required for mixing by the standby program when the standby program takes over mixing of the synthesized voice data that was executed by the main program from the DMA underrun error occurrence time The multicore system according to claim 1, wherein the mixing processing end time is set.
前記音声出力部は、
前記DMA転送用バッファから転送される合成音声データをエンキューして、前記再生をする合成音声データがデキューされるFIFOバッファを有し、
前記FIFOバッファに格納されている合成音声データが所定の単位デキューされる毎に、前記予備系プログラムにFIFO境界割り込みを出力し、
前記予備系プログラムは、
前記タイマーがタイムアウトした場合に、前記音声出力部に対して前記FIFO境界割り込みの出力を許可し、前記音声出力部からのFIFO境界割り込みを受信する都度、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記FIFOバッファに格納されている合成音声データの格納量に応じて定める所定の閾値に達しているか否かを判定し、当該所定の閾値に達していないときに、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行する
ことを特徴とする請求項1又は2に記載のマルチコアシステム。
The audio output unit
A FIFO buffer that enqueues the synthesized voice data transferred from the DMA transfer buffer and dequeues the synthesized voice data to be reproduced;
Each time the synthesized voice data stored in the FIFO buffer is dequeued by a predetermined unit, a FIFO boundary interrupt is output to the standby program,
The preliminary program is
When the timer times out, the output of the FIFO boundary interrupt is permitted to the voice output unit, and the synthesis stored in the DMA transfer buffer is received each time the FIFO boundary interrupt is received from the voice output unit. It is determined whether the storage amount of the audio data has reached a predetermined threshold determined according to the storage amount of the synthesized audio data stored in the FIFO buffer, and when the predetermined threshold is not reached, The multi-core system according to claim 1 or 2, wherein the mixing and storing of the synthesized voice data executed by the main system program is carried over.
前記マルチコアシステムは、
前記DMA転送用バッファに格納された合成音声データを前記FIFOバッファに転送して、当該転送が完了した場合に、DMA転送完了割り込みを前記予備系プログラムに出力するDMAコントローラを更に備え、
前記予備系プログラムは、
前記タイマーがタイムアウトした場合に、前記DMAコントローラからの前記DMA転送完了割り込みを受信したときに、前記FIFO境界割り込みの出力を有効にするFIFO境界割り込み開始要求を前記音声出力部に出力し、
前記合成音声データのミキシング及び格納を完了した場合に、前記FIFO境界割り込みの出力を無効にするFIFO境界割り込み停止要求を前記音声出力部に出力する
ことを特徴とする請求項3に記載のマルチコアシステム。
The multi-core system is
Further comprising: a DMA controller that transfers the synthesized voice data stored in the DMA transfer buffer to the FIFO buffer and outputs a DMA transfer completion interrupt to the standby program when the transfer is completed;
The preliminary program is
When the timer times out, when the DMA transfer completion interrupt is received from the DMA controller, a FIFO boundary interrupt start request for enabling the output of the FIFO boundary interrupt is output to the audio output unit,
The multi-core system according to claim 3, wherein when the mixing and storing of the synthesized voice data is completed, a FIFO boundary interrupt stop request for invalidating the output of the FIFO boundary interrupt is output to the voice output unit. .
前記音声出力部は、
I2Sデバイスと、DAコンバータを含む音声出力装置と、を有し、
前記I2Sデバイスは、
前記DMA転送用バッファから転送される合成音声データをエンキューして、前記再生をする合成音声データがデキューされるFIFOバッファを有し、
前記音声出力装置は、
前記FIFOバッファからデキューされた合成音声データをアナログ信号に変換して再生する
ことを特徴とする請求項1に記載のマルチコアシステム。
The audio output unit
An I2S device and an audio output device including a DA converter;
The I2S device is
A FIFO buffer that enqueues the synthesized voice data transferred from the DMA transfer buffer and dequeues the synthesized voice data to be reproduced;
The audio output device is
The multi-core system according to claim 1, wherein the synthesized voice data dequeued from the FIFO buffer is converted into an analog signal and reproduced.
第1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納する主系プログラムを動作させる第1のプロセッサコアと、前記主系プログラムの予備系として動作する予備系プログラムを動作させる第2のプロセッサコアと、前記DMA転送用バッファから転送される合成音声データを順次格納し、当該格納した合成音声データを再生する音声出力部と、を備えたマルチコアシステムの制御方法であって、
前記予備系プログラムを用いて、
DMA転送完了割込み要求の受信に応じてタイマーを設定するステップと、
所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部に格納されている合成音声データの格納量に応じて定める所定のデータ量に達しているか否かを判定するステップと、
前記所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行するステップと、を実行する
ことを特徴とするマルチコアシステムの制御方法。
A first processor core that operates the main program for mixing the first and second audio data and stores the mixed synthesized audio data in the DMA transfer buffer, and operates as a backup system for the main program A multi-core system comprising: a second processor core that operates a standby system program; and a voice output unit that sequentially stores the synthesized voice data transferred from the DMA transfer buffer and reproduces the stored synthesized voice data. A control method,
Using the preliminary program,
Setting a timer in response to receiving a DMA transfer completion interrupt request;
When the timer times out after a predetermined time elapses, the amount of synthesized speech data stored in the DMA transfer buffer is determined according to the amount of synthesized speech data stored in the speech output unit. Determining whether a predetermined amount of data has been reached;
When the predetermined amount of data has not been reached, the step of taking over and carrying out the mixing and storing of the synthesized speech data executed by the main system program is executed.
複数のプロセッサコアと、DMA転送用バッファから転送される合成音声データを順次格納して再生する音声出力部と、を含むマルチコアシステムにおいて、前記複数のプロセッサコア上でそれぞれ動作する複数のプログラムのうちで、第1のプロセッサコア上で動作し、第1及び第2の音声データをミキシングして、当該ミキシングした合成音声データをDMA転送用バッファに格納するプログラムを主系プログラムとして、第2のプロセッサコア上で動作し、前記主系プログラムの予備系として動作する予備系プログラムであって、
DMA転送完了割込み要求の受信に応じてタイマーを設定するステップと、
所定の時間経過後に前記タイマーがタイムアウトした場合に、前記DMA転送用バッファに格納されている合成音声データの格納量が、前記音声出力部の格納量に応じて定める所定のデータ量に達しているか否かを判定するステップと、
前記所定のデータ量に達していないときには、前記主系プログラムが実行していた合成音声データのミキシング及び格納を引き継いで実行するステップと、を前記第2のプロセッサコアに実行させる
ことを特徴とするプログラム。
In a multi-core system including a plurality of processor cores and an audio output unit that sequentially stores and reproduces synthesized audio data transferred from the DMA transfer buffer, a plurality of programs respectively operating on the plurality of processor cores Then, the second processor operates on the first processor core, mixes the first and second audio data, and stores the mixed synthesized audio data in the DMA transfer buffer as a main program. A standby system program that operates on a core and operates as a backup system of the main system program,
Setting a timer in response to receiving a DMA transfer completion interrupt request;
Whether the storage amount of the synthesized voice data stored in the DMA transfer buffer reaches a predetermined data amount determined according to the storage amount of the voice output unit when the timer times out after a predetermined time elapses Determining whether or not,
When the predetermined amount of data has not been reached, the second processor core executes the step of taking over and executing the mixing and storing of the synthesized voice data executed by the main program. program.
JP2010030143A 2010-02-15 2010-02-15 Multi-core system, control method and program for multi-core system Expired - Fee Related JP5375650B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010030143A JP5375650B2 (en) 2010-02-15 2010-02-15 Multi-core system, control method and program for multi-core system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010030143A JP5375650B2 (en) 2010-02-15 2010-02-15 Multi-core system, control method and program for multi-core system

Publications (2)

Publication Number Publication Date
JP2011164525A JP2011164525A (en) 2011-08-25
JP5375650B2 true JP5375650B2 (en) 2013-12-25

Family

ID=44595241

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010030143A Expired - Fee Related JP5375650B2 (en) 2010-02-15 2010-02-15 Multi-core system, control method and program for multi-core system

Country Status (1)

Country Link
JP (1) JP5375650B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5842206B2 (en) 2012-01-27 2016-01-13 株式会社トプスシステムズ Processor core and multi-core processor system
CN107229531B (en) * 2016-03-26 2020-04-21 上海冠瑞医疗设备股份有限公司 Communication interrupt data processing method based on high-voltage generator

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4280029B2 (en) * 2002-05-30 2009-06-17 パナソニック株式会社 Digital signal processing apparatus and digital signal processing method
JP2008292755A (en) * 2007-05-24 2008-12-04 Denso Corp Voice data processor

Also Published As

Publication number Publication date
JP2011164525A (en) 2011-08-25

Similar Documents

Publication Publication Date Title
JP5382133B2 (en) Multi-core system, control method and program for multi-core system
JP5099090B2 (en) Multi-core system, multi-core system control method, and multi-processor
US8069291B2 (en) Method and computer program product for event detection
JP2005202767A (en) Processor system, dma control circuit, dma control method, control method for dma controller, image processing method, and image processing circuit
JP6181844B2 (en) Dual Host Embedded Shared Device Controller
JP2007079789A (en) Computer system and event processing method
JP2001524707A (en) Using firmware to enhance controller functionality
JP2003114864A (en) Data transfer control circuit
JP5375650B2 (en) Multi-core system, control method and program for multi-core system
JP2014170363A (en) Information processing device, job scheduling method, and job scheduling program
KR20110033942A (en) System, method or apparatus for combining multiple streams of media data
CN110023907B (en) Processing method and device
KR20180091364A (en) System-on-chip comprising a cpu operating as a debug host and method of operation thereof
WO2007094460A1 (en) Parallel processing device and exclusive access control
JP2002073341A (en) Dsp program download system
US11803499B2 (en) Method of operating audio subsystem for USB module, system-on-chip performing the same and method of operating system-on-chip using the same
TW201344416A (en) System resource conserving method and operating system thereof
JP2006113716A (en) Semiconductor integrated circuit
JPH07244607A (en) Queue memory system and method thereof
JP2004094970A (en) Data transfer device
JP2000181855A (en) Dma transfer system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130111

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130723

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130807

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130827

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130909

R150 Certificate of patent or registration of utility model

Ref document number: 5375650

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees