CN101453516A - Bluetooth MP3 playing method on mobile phone and mobile phone thereof - Google Patents

Bluetooth MP3 playing method on mobile phone and mobile phone thereof Download PDF

Info

Publication number
CN101453516A
CN101453516A CNA2008102029704A CN200810202970A CN101453516A CN 101453516 A CN101453516 A CN 101453516A CN A2008102029704 A CNA2008102029704 A CN A2008102029704A CN 200810202970 A CN200810202970 A CN 200810202970A CN 101453516 A CN101453516 A CN 101453516A
Authority
CN
China
Prior art keywords
bluetooth
sbc
chip
baseband chip
mobile phone
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.)
Granted
Application number
CNA2008102029704A
Other languages
Chinese (zh)
Other versions
CN101453516B (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.)
Wingtech Communication Co Ltd
Original Assignee
Wingtech Group Ltd
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 Wingtech Group Ltd filed Critical Wingtech Group Ltd
Priority to CN2008102029704A priority Critical patent/CN101453516B/en
Publication of CN101453516A publication Critical patent/CN101453516A/en
Application granted granted Critical
Publication of CN101453516B publication Critical patent/CN101453516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method for playing a bluetooth MP3 on a mobile phone, which comprises: step 1, a bluetooth function menu option is added; step 2, a baseband chip in the mobile phone controls a bluetooth module and a bluetooth headset to match; step 3, the baseband chip triggers to use a bluetooth headset channel to play the MP3; step 4, the baseband chip starts a DSP chip to perform decoding playing on an MP3 file; step 5, the baseband chip reads SBC audio data from an RAM inside the DSP chip; step 6, the baseband chip reads the SBC audio data from an SRAM appointed cache and performs transmission coding once again; and step 7, the bluetooth module processes the SBC audio data through an A2DP protocol stack and then sends the SBC audio data to the bluetooth headset. The invention also discloses a mobile phone used for the method for playing the bluetooth MP3. The method realizes the function of realizing the listening of MP3 playing by high-end bluetooth stereo on a low-end mobile phone platform.

Description

The player method of bluetooth MP3 and mobile phone on a kind of mobile phone
Technical field
The present invention relates to the MP3 play-back technology of mobile phone, the player method of bluetooth MP3 and this mobile phone on particularly a kind of low-end mobile phone.
Background technology
The personal mobile communication technology constantly develops, and the effect of mobile phone is increasing, and the function of mobile phone is because the also constantly enhancing of people's demand.Nowadays, all become reality by mobile phone surf the Net, take pictures photography etc., and along with the requirement of people's amusement increases, functions such as MP3, MP4 are integrated on the mobile phone all also.And wherein, using the Bluetooth stereo earphone to listen to the MP3 song has become the standard configuration of middle and high end mobile phone.
The general function of using bluetooth A2DP to answer the MP3 broadcast is based on following condition realization: first, need be on the cell phone platform of middle and high end, second, need this cell phone platform inner integrated the multimedia dsp chip, codec functions with MP3, the 3rd, this DSP can be with audio data stream directly by on the hardware mode transmission Bluetooth chip, at last, pass through again bluetooth module with digital coding after A2DP agreement (Advenced Audio Distribution Profile Bluetooth audio frequency mode agreement) thus mode sends on the bluetooth earphone function that realizes answering MP3.
As shown in Figure 1, be the hardware signal frame diagram that prior art MP3A2DP plays.It has represented the transmission course of audio data stream on hardware link.At first, baseband chip calls coupling and associated program mates by UART mouth control bluetooth module and bluetooth earphone, and after having mated, same mode has started the Bluetooth stereo ear-phone function.When carrying out the MP3 broadcast, be to carry out MP3 decoding by the built-in DSP of baseband chip to play at this moment, under the situation that the Bluetooth stereo earphone is arranged, it is directly delivered to decoded audio data stream on the link of bluetooth A2DP through the PCM hardware link, send on the bluetooth earphone with wireless mode again, realize that A2DP MP3 plays.
As shown in Figure 3, be the control flow chart that prior art MP3 A2DP plays.When MP3 plays beginning, at first judged whether A2DP equipment, whether the stereophone of the bluetooth that has matched is arranged in other words, and whether this stereo function is opened.If do not have, just get through the analog channel of local loud speaker, export from this machine.If there has been A2DP equipment, judge that current whether permission of this equipment use, just this A2DP equipment is opened if allow to use, and the judgement feedback information, if successfully open the voice frequency link that just calls asynchronous process function configuration A2DP equipment, this is an asynchronous process process at once.After the information that this A2DP equipment voice frequency link of feedback has successfully configured from Bluetooth protocol, with regard to the relevant interface of calling system sound intermediate frequency service role.This interface is the file type of playing according to current needs in essence, call corresponding playback process function, in current needs broadcast is the MP3 format file, so what it finally called is MP3 playback process function, concrete work is that the handle with file imports in the playback process function, after this function obtains fileinfo, according to fileinfo the hardware decode controller that MP3 plays is configured, realize the decoding processing and the PCM data flow transmission of mp3 file, dispose the A2DP hardware processing module simultaneously, the PCM data that transmit are carried out the coding again of A2DP host-host protocol, enable on the A2DP link, directly to transmit.Carry out the MP3 voice playing, the voice data of MP3 is delivered on the A2DP link, realize that MP3 A2DP plays.And need change the A2DP running status of current task simultaneously, MP3 A2DP broadcast state from original idle condition be set to play carry out state.
Yet,,, therefore need a kind of method that high-end multimedia recreation is used that on low-end mobile phone, realizes cheaply because the restriction of the software/hardware resource of platform own will realize that such function is not to be easy to thing for the low-end mobile phone platform.
Summary of the invention
For overcoming the deficiency of above-mentioned prior art, the technical problem to be solved in the present invention provides player method and this mobile phone of bluetooth MP3 on a kind of low-end mobile phone, and the high-end Bluetooth stereo of realization is answered the function that MP3 plays on the cell phone platform of low side.
For solving the problems of the technologies described above, technical scheme of the present invention is:
The player method of bluetooth MP3 on a kind of mobile phone is characterized in that may further comprise the steps:
Step 1: under the multimedia menu of mobile phone, add the Bluetooth function menu option, and create activation and this bluetooth module that corresponding interfaces windows is used for bluetooth module and be connected with the coupling of bluetooth earphone;
Step 2: baseband chip is controlled described bluetooth module and bluetooth earphone mates in the mobile phone, starts the bluetooth earphone stereo function then;
Step 3: the user starts the MP3 play button, and baseband chip triggers and uses the bluetooth earphone passage to play MP3;
Step 4: baseband chip starts dsp chip to mp3 file broadcasts of decoding, and dsp chip carries out SBC to the audio data stream of playing encodes, and the SBC audio data stream after will encoding is stored in the buffer memory that the internal RAM of dsp chip own distributes;
Step 5: after the SBC voice data in the internal RAM of dsp chip reached first buffer memory, baseband chip was read the SBC voice data from the dsp chip internal RAM, and these data was write in the SRAM named cache of baseband chip;
Step 6: after the SBC data volume in the SRAM of the baseband chip named cache reaches second buffering capacity, baseband chip is read and is carried out transfer encoding once more getting the SBC voice data from the SRAM named cache, and the UART mouth of startup baseband chip, the SBC voice data is sent to bluetooth module;
Step 7: bluetooth module send on the bluetooth earphone, thereby the stereo MP3 that realizes bluetooth earphone is answered after the SBC voice data is handled by the A2DP protocol stack.
The SRAM named cache of base band FLASH chip in the step 5 just distributes from SRAM when definite MP3 uses the bluetooth earphone passage, and this buffer memory is the 400K byte.
Baseband chip is according to the Maximum Bit Rate that the form and the UART mouth data transmissions of SBC coding reaches in the step 6, calculates the data volume of SBC transfer of data and the time interval of transmission each time.
A kind of mobile phone that is used for the player method of above-mentioned bluetooth MP3, comprise baseband chip, bluetooth module and bluetooth earphone, described bluetooth module links to each other with described baseband chip by the UART mouth, it is characterized in that this UART is also multiplexing uses as voice-grade channel, described baseband chip also links to each other by data/address bus with dsp chip, and this dsp chip is used for audio coding decoding.
Described baseband chip can be the GSM6600D baseband chip of Spreadtrum Communications Inc., and platform software is based on the application software of this 6600D platform.
Described bluetooth module can be the Audio Processing chip of the BC41B143A model of CSR company.
Described dsp chip can be the dsp chip of the AIT706P model of AIT company.
Compared with prior art, the invention has the beneficial effects as follows:
The invention provides a kind of low-cost method that realizes that Bluetooth of mobile phone MP3 plays, be implemented on the cell phone platform of low side and realize high-end multimedia application.Key technology of the present invention is with baseband chip as master control side, the control dsp chip carries out the SBC coding to the MP3 that plays, sub-band coding behind the coding (Sub-Band Coding, abbreviation SBC) data flow is read buffer memory among the SRAM by the data/address bus that baseband chip is connected with dsp chip by baseband chip, pass through the coordination system of real time operating system in the base band again, the SBC data flow that is buffered among the SRAM is sent on the Bluetooth chip by the UART mouth, and the A2DP agreement by bluetooth module sends to realization broadcast on the bluetooth earphone again.
Description of drawings
Fig. 1 is the hardware signal frame diagram that prior art MP3A2DP plays;
Fig. 2 is that the inventive method realizes that MP3A2DP plays hardware signal frame diagram cheaply;
Fig. 3 is the software control flow chart that prior art MP3A2DP plays;
Fig. 4 is that the inventive method provides and realizes MP3A2DP Play Control flow chart cheaply.
Embodiment
Specific embodiments of the present invention are further described in detail below in conjunction with drawings and Examples, but should not limit protection scope of the present invention with this.
See also Fig. 2.The present invention is used to realize the mobile phone of the player method of bluetooth MP3 cheaply, comprise baseband chip, bluetooth module and bluetooth earphone, described bluetooth module links to each other with described baseband chip by the UART mouth, this UART is also multiplexing to be used as voice-grade channel, described baseband chip also links to each other by data/address bus with dsp chip, and this dsp chip is used for audio coding decoding.
Baseband chip adopts the GSM 6600D baseband chip of Spreadtrum Communications Inc., and platform software is based on the application software of this 6600D platform.Bluetooth module adopts the Audio Processing chip of the BC41B143A model of CSR (Cambri dgeSilicon Radio Limited) company.Dsp chip adopts the dsp chip of the AIT706P model of AIT (Alpha Imaging Technology Corp) company.
As shown in Figure 2, the invention provides and realize that MP3 A2DP plays hardware signal frame diagram cheaply, represented the transmission course of sound intermediate frequency data flow of the present invention on hardware link.At first, baseband chip calls coupling and associated program mates by UART mouth control bluetooth module and bluetooth earphone, and after having mated, same mode has started the Bluetooth stereo ear-phone function.When carrying out the MP3 broadcast, be to carry out MP3 decoding by the controlled DSP in outside to play at this moment, under the situation that the Bluetooth stereo earphone is arranged, baseband chip sends instructions and allows it that decoded audio data stream is not directly outputed to loud speaker with the form of analog signal from the audio frequency simulation passage, but handle through internal processes, decoded audio data coding is become the SBC audio data stream, be buffered in the internal RAM of DSP.And the system data bus (BUS) of B/B by 8 or 16 read out the SBC data from DSP, and also be cached among the SRAM of B/B inside.B/B takes out the SBC data in the internal RAM of timesharing again and sends on the A2DP link of bluetooth module from the UART mouth through after the transfer encoding, sends on the bluetooth earphone number with wireless mode again, realizes that A2DP MP3 plays.
See also Fig. 4.The player method of bluetooth MP3 on the low-end mobile phone of the present invention may further comprise the steps:
Step 1: under the multimedia menu of mobile phone, add the Bluetooth function menu option, and create activation and this bluetooth module that corresponding interfaces windows is used for bluetooth module and be connected with the coupling of bluetooth earphone and other bluetooth equipments (such as other bluetooth cellular phones or PC or the like);
Step 2: baseband chip is controlled described bluetooth module and bluetooth earphone mates in the mobile phone, starts the bluetooth earphone stereo function then;
Step 3: the user starts the MP3 play button, and baseband chip triggers and uses the bluetooth earphone passage to play MP3;
Step 4: baseband chip starts dsp chip to mp3 file broadcasts of decoding, and dsp chip carries out SBC to the audio data stream of playing encodes, and the SBC audio data stream after will encoding is stored in the buffer memory that the internal RAM of dsp chip own distributes;
Step 5: after the SBC voice data in the internal RAM of dsp chip reaches first buffer memory, be 32KB as buffer memory, baseband chip is read the SBC voice data from the dsp chip internal RAM, and these data is write in the SRAM named cache of baseband chip;
Step 6: after the SBC data volume in the SRAM of the baseband chip named cache reaches second buffering capacity, present embodiment has used the data buffering of 32K, baseband chip handle from the SRAM named cache is got the transfer encoding that A2DP was read and transmitted once more to the SBC voice data, promptly be transformed into and meet A2DP host-host protocol coded system, and the UART mouth of startup baseband chip, the SBC voice data is sent to bluetooth module;
Step 7: bluetooth module send on the bluetooth earphone, thereby the stereo MP3 that realizes bluetooth earphone is answered after the SBC voice data is handled by the A2DP protocol stack.
The SBC cataloged procedure is in the step 4:
This part be operated in DSP in finish, by firmware program with the PCM signal that obtains after the mp3 file decoding, be sent in the hardware audio data processing module of DSP, and the SBC coded message of configuration module, the form of being pressed SBC by the hardware audio data processing module produces the SBC audio data stream.And under the control of firmware program, be stored among the RAM of DSP, wait for the processing of next one.
As shown in Figure 4, be that the inventive method provides and realizes MP3A2DP Play Control flow chart cheaply.When MP3 plays beginning, at first judge whether A2DP equipment (the stereophone whether bluetooth that has matched is arranged in other words, and whether this stereo function is opened) on the flow process.If do not have, just get through the analog channel of local loud speaker, export from this machine.If have A2DP equipment, judge that current whether permission of this equipment use.Use if allow, the function that asynchronous call A2DP equipment is opened in the program (promptly triggers message mechanism so, in the AUDIO flow of task, call the OPEN function of A2DP, and the information that whether wait A2DP is opened in this task), and the feedback information in the judgement Bluetooth protocol, after successfully opening, base band control DSP enters the MP3 playing flow, start the inner SBC coded program of DSP, and start B/B read data scheduling flow simultaneously, timer (TIMER), the information of using DSP end buffer memory to expire simultaneously triggers the action of reading of data scheduling flow, and what voice data can not had delay reads from DSP and deposits in the B/B internal RAM.After the data of B/B internal RAM reach certain buffer memory, call the voice frequency link of asynchronous process function configuration A2DP equipment immediately, this is an asynchronous process process.After the information that this A2DP equipment voice frequency link of feedback has successfully configured from Bluetooth protocol, start the bluetooth task, trigger the transmission link of the audio data stream of bluetooth, enter simultaneously in the bluetooth task, obtain the current bluetooth equipment state and the rate parameter of UART mouth, calculate the time interval of from the B/B internal RAM, next time reading audio frequency parameter and the data volume that ought last time send.Read the SBC voice data of current less important transmission, and it is carried out necessary transfer encoding, restart the UART mouth, it is transferred to the protocol stack end of bluetooth module.Configuration uses the time interval that calculates to configure the scheduling parameter that bluetooth sends incident next time.Bluetooth module is delivered to data on the link of A2DP, realizes that MP3 A2DP plays.And need change the A2DP running status of current bluetooth task simultaneously.
The object of the present invention is to provide a kind of low-cost method that realizes that Bluetooth of mobile phone MP3 plays, be implemented on the cell phone platform of low side and realize high-end multimedia application.The inventive method is to use existing low-end mobile phone platform resource, utilizes existing plug-in dsp chip sound intermediate frequency codec functions, and uniting and adjustment Bluetooth function module realizes the stereosonic broadcast of MP3 A2DP.Its key technology is with baseband chip as master control side, DSP carries out the SBC coding to the MP3 that plays by software flow control, the data/address bus (BUS) that SBC data flow behind the coding is connected with dsp chip by baseband chip is read buffer memory among the SRAM by baseband chip, pass through the coordination system of RTOS in the base band (real time operating system) again, the SBC data flow that is buffered among the SRAM is sent on the Bluetooth chip by the UART mouth, and the A2DP agreement by bluetooth module sends to realization broadcast on the bluetooth earphone again.Technological difficulties and innovation be following some, the first, SBC coding control flow during MP3 plays and the SBC data behind the coding read the base band sram cache from DSP.The second, mode and flow process that the SBC audio data stream is transferred on the Bluetooth chip are controlled.The 3rd, the scheduling mechanism control and the main control process flow of the system that whole functional realizes are realized.
The specific implementation of the inventive method, need finish the software/hardware treatment step of following six aspects:
(1) the functional software control interface of cell phone platform and interface are set up;
(2) bluetooth module hard/software integrates;
(3) broadcast of the MP3 of DSP end and the control of SBC coding;
(4) buffer memory in SDRAM of the transmission control flow of SBC audio data stream and SBC voice data;
(5) transmission means of SBC voice data from SRAM to the Bluetooth chip handled and dispatched bluetooth protocol repertory and transmit voice data with the A2DP protocol mode to bluetooth earphone;
(6) the machine-processed scheduling controlling of RTOS and the realization of main control process flow in the software systems;
Below, the present invention will be described in detail above-mentioned 6 performing step.
(1) the functional software control interface of cell phone platform and interface are set up
At first, under the multimedia menu of cell phone platform, add the Bluetooth function menu option, and create corresponding interfaces windows and be used for the activation of bluetooth module and be connected with the coupling of blue clamp lug machine/other bluetooth equipments.
(2) bluetooth module hard/software integrates;
At first, on the hardware, need on mobile phone board, be integrated into bluetooth module, and the connection of relevant communication/voice-grade channel and auxiliary circuit configuration, and in the present embodiment, bluetooth module and baseband chip are by the UART port communications.The audio signal of general bluetooth module and source of sound end all is through linear impulsive coded modulation (the Linear Pulse Code Modlation on the chip, be called for short PCM) etc. the pure audio channel transfer, but in the cell phone platform of low side, can not all have such condition, use as voice-grade channel so the UART mouth that has used baseband chip to communicate by letter with bluetooth module in this scheme is multiplexing.In addition, on software, general purpose control program module transplanting such as the relevant chip reset of bluetooth module (control pin configuration, control function is write), activation and protocol stack transmission are incorporated on our the existing platform software.With the interface correlation of setting up in the preceding step one.
(3) broadcast of the MP3 of DSP end and the control of SBC coding
Be provided with in the program, activated at bluetooth earphone under the state of Bluetooth stereo function and play MP3, will trigger automatically and use the bluetooth earphone passage to play.And DSP carries out hardware decoding broadcast to mp3 file when, need control by flow process, the firmware program of scheduling DSP inside carries out the SBC coding to the audio data stream of playing simultaneously, and the back SBC audio data stream of will encode is stored among the BUFFER that the internal RAM of DSP own distributes.
if(MP3_GetBTPlayState())
{
SbcPtrBase=BL_Malloc(BLOCK_MEM_POOL_2);//500Kb?size????
sprate=mp3_fi?leinfo.samprate;
SBC_getConfig(mp3_sbc_config);
//AIT_Message(″mp3_sbc_config->channel_mode
is:%d,,mp3_sbc_config->alloc_method?is?%d?\n″,
mp3_sbc_config->channel_mode,mp3_sbc_config->alloc_method);
AITS_Audio_SBC_Encode_Config(mp3_sbc_config->channel_mode,(mp3_sbc_config->alloc_method+1),16,8,SBCTargetBitrate,sprate);
AITS_Audio_SBC_Init(&host_buf_refsize);
if(host_buf_refsize>SBC_POOL_SIZE)
{
AIT_Message(″NOTE.SBC?HOST?BUF?SIZE?too?small!!\r\n″);
return;
}
SbcPtr=SbcPtrBase;
host_sbc_buf=(u_char*)SbcPtr;
mmp_sbc_info.buf=(u_short*)host_sbc_buf;
mmp_sbc_info.buf_len=host_buf_refsize;
//AIT_Message(″SBC?Host(addr,size)=(0x%08x,%d)\n″,
host_sbc_buf,host_buf_refsize);
//setting?for?pf_a2dp
g_adm_dec_output_buf.buffer_size=84*1024;
g_adm_dec_output_buf.data_buffer_ptr=(int16*)SbcPtrBase;
g_adm_dec_output_buf.data_count=0;
g_adm_dec_output_buf.data_in_pos=0;
g_adm_dec_output_buf.data_out_pos=0;
open_flag=FALSE;
AITS_Audio_SBC_Encode_Enable(1);
}
(4) buffer memory in SDRAM of the transmission control flow of SBC audio data stream and SBC voice data;
By the firmware information exchanging mechanism among base band program and the DSP, when among the DSP MP3 being carried out the SBC coding and being stored in after SBC voice data in the DSP internal RAM reaches certain buffer memory.The base band primary control program uses regularly and the mechanism of message trigger.From the DSP internal RAM, the SBC voice data is read by the data/address bus that DSP is connected with base band, and these data are write in the SRAM appointed area (being BUFFER) of base band FLASH chip.The appointed area of this SRAM must just distribute from SRAM when definite MP3 uses the bluetooth earphone passage, being used for the SBC data fully uses at base band the processing/buffer memory here, for the performance index such as fluency that the stable and MP3 that takes into account system itself plays, determine in this scheme to use the SRAM space of a 400K byte as buffer memory.In this step, coordinate the buffer memory at the DSP/ base band two ends of MP3 broadcast, SBC coding, SBC audio data stream, be the key point of technology, for the smoothness that makes MP3 play/answer, we have used timer Timing Processing and two kinds of mechanism of message-driven to guarantee unobstructed audio data transmission.
PUBLIC?uint?16?MP3_BTSBC_DataPooling(void)
{
uint16?status;
AIT_EnterActive();
if((SBC_POOL_SIZE-g_adm_dec_output_buf.data_count)>=64*1024)
{
mmp_sbc_info.buf=(u_short*)SbcPtr;
status=AITS_Audio_SBC_GetFrames(&mmp_sbc_info);
if((g_adm_dec_output_buf.data_count>=32*1024)&&(open_flag==0))
{
if(!A2DP_IsAudioOpen())
{
A2DP_Play(115200);
}
open_flag=1;
}
if(status==AUDIO_NO_ERROR)
{
int?size=mmp_sbc_info.ret_get_frames*
mmp_sbc_info.size_per_frame;
int?allow_size=SBC_POOL_SIZE-(SbcPtr-SbcPtrBase);
AIT_Message("sizze=ox%x,frames?is?%d,per_frames?is:0x%x\n",
size,mmp_sbc_info.ret_get_frames,mmp_sbc_info.size_per_frame);
if(allow_size<size)
{
SbcPtr+=size;
size=(SbcPtr-(SbcPtrBase+SBC_POOL_SIZE));
SbcPtr=SbcPtrBase;
SCI_MEMCPY(SbcPtr,SbcPtrBase+SBC_POOL_SIZE,size);
}
SbcPtr+=size;
g_adm_dec_output_buf.data_count+=size;
}
}
else
{
}
AITS_ACTIVE_CLK_ON_BYPASS_DRAWLCD(1);
AIT_EnterBypass();
}
(5) transmission means of SBC voice data from SRAM to the Bluetooth chip handled and dispatched bluetooth protocol repertory and transmit voice data with the A2DP protocol mode to bluetooth earphone;
In order to make the more smooth of Bluetooth audio frequency transmission, to handle just trigger the audio transmission of bluetooth protocol repertory after the SBC data volume in base band end internal SRAM buffer memory reaches certain buffering capacity.At first to start the audio data stream transmission process flow process of bluetooth protocol repertory, in this handling process, data pointer be pointed to the SBC metadata cache of base band internal SRAM again.The Maximum Bit Rate that reaches according to the form and the UART mouth data transmissions of SBC coding, transform operation through data processing algorithm, mainly be to convert the A2DP transformat to, on existing SBC data, add seeker information necessary in the A2DP transformat and in the fixed block information of each payload (data block), and, calculate the time interval of data quantity transmitted and transmission each time to the compensating of the influence of current various factors.To set the event trigger mechanism configuration parameter in the bluetooth task among the RTOS (real time operating system) this blanking time, be used for smooth link up the SBC data are taken out and carried out transfer encoding once more from the base band internal SRAM.These send in the bluetooth module from the hardware interface UART mouth that is used for communicating by letter between bluetooth module and base band through the audio data stream after transfer encodings, handle via the A2DP protocol stack that is specifically designed to the stereo audio transmission in the bluetooth module protocol stack again, send on the bluetooth earphone, thereby the stereo MP3 that realizes bluetooth earphone answers.This A2DP protocol stack is existing functional block.
bool_t?SBC_getPacket(void**packet,uint16_t*packetSize,uint16_t*frames)
{
ADM_DecOutputBuf_T*audio_buf;
uint8_t *pkt_ptr;
uint8_t *frame_ptr;
uint8_t *left_ptr;
uint8_t *payload_ptr;
if(!sbcStarted)
{
return?FALSE;
}
audio_buf=A2DP_GetAudioData();
if(!audio_buf‖(audio_buf->data_count<
activeConfig->bytes_per_payload))
{
return?FALSE;
}
pkt_ptr=pmalloc(activeConfig->bytes_per_payload+1+
AV_FIXED_MEDIA_PACKET_HDR_SIZE);
frame_ptr=pkt_ptr+AV_FIXED_MEDIA_PACKET_HDR_SIZE+1;
payload_ptr=pkt_ptr+AV_FIXED_MEDIA_PACKET_HDR_SIZE;
left_ptr=(uint8_t*)audio_buf->data_buffer_ptr+audio_buf->data_out_pos;
if((audio_buf->data_out_pos+activeConfig->bytes_per_payload)<=
AUDIO_BUF_SIZE(audio_buf->buffer_size))
{
SCI_MEMCPY(frame_ptr,left_ptr,activeConfig->bytes_per_payload);
}
else
{
uint32_tcopy_count;/*in?bytes*/
copy_count=AUDIO_BUF_SIZE(audio_buf->buffer_size)-
audio_buf->data_out_pos;
SCI_MEMCPY(frame_ptr,left_ptr,copy_count);
SCI_MEMCPY(frame_ptr+copy_count,
(uint8_t*)&audio_buf->data_buffer_ptr[0],
activeConfig->bytes_per_payload-copy_count);
}
audio_buf->data_out_pos+=activeConfig->bytes_per_payload;
if(audio_buf->data_out_pos>=
AUDIO_BUF_SIZE(audio_buf->buffer_size))
audio_buf->data_out_pos-=
AUDIO_BUF_SIZE(audio_buf->buffer_size);
SCI_DisableIRQ();
audio_buf->data_count-=activeConfig->bytes_per_payload;
SCI_RestoreIRQ();
*payload_ptr=activeConfig->frames_per_payload;
*packet=pkt_ptr;
*packetSize=activeConfig->bytes_per_payload+1+
AV_FIXED_MEDIA_PACKET_HDR_SIZE;
*frames=activeConfig->frames_per_payload;
return?TRUE;
}
static?uint16_ttransmitAudioPacket(void)
{
a2InstData_t *instData;
uint16_t totalFrames;
uint16_t i,count;
instData=&globalInstData;
if((instData->con[0].state!=connected_streaming)
&&(instData->con[1].state!=connected_streaming))
{
return?FALSE;
}
count=2;
totalFrames=0;
for(i=0;i<count;++i){
uint16_tframes;
void *data;
uint16_tdataLen;
if(!SBC_getPacket(&data,&dataLen,&frames))
{
break;
}
if(instData->con[0].state==connected_streaming)
{
AvStreamDataReqSend(instData->con[0].streamHandle,
FALSE,
FALSE,
96,/*any?dynamic?PT?in?the?range?96-127
*/
instData->time_stamp,
dataLen,
data);
}
else?if(instData->con[1].state==connected_streaming)
{
AvStreamDataReqSend(instData->con[1].streamHandle,
FALSE,
FALSE,
96,/*any?dynamic?PT?in?the?range?96-127
*/
instData->time_stamp,
dataLen,
data);
}
else
{
A2DP_ASSERT(0?&&"transmitAudioPacket:no?valid?con");
}
/*prepare?fornext?packet*/
instData->time_stamp+=frames*
instData->ActiveConfig.data_per_encoding;
totalFrames+=frames;
}
return?totalFrames;
}
(6) the machine-processed scheduling controlling of RTOS and the realization of main control process flow in the software systems
The main effect of this work is for the effectively transmission of control data stream, makes audio data transmission unobstructed, keeps the coherent of sound playing not stop.The main effect that technology weighs this work is for the effectively transmission of control data stream, makes audio data transmission unobstructed, keeps the coherent of sound playing not stop.Technology focuses on: 1, need handle the task of bluetooth among the RTOS and the priority relationship and the coordination system of MP3 playing task well, and these are handled in the configuration of system, revise in the uniting and adjustment.2, the switching that data flow each task in transmission course is handled and in the successive processing of data flow some in each task.3, voice data is handled at the read-write operation of each buffer area, to the round-robin of the space piece section of each buffer area, the i.e. alternating movement writing and read of data flow in a certain amount of cache blocks.And the above all is embedded in each functional module control of main control process flow.
static?void?audioInterruptHandler(void)
{
a2InstData_t*instData=&globalInstData;
if(instData->isAudioOpen){
instData->time_stamp=0;
instData->packetRefTime=SCI_GetTickCount();
SBC_startEncode();
audioSamplesHandler(0,0);
}else{
bool_tret
A2DP_ASSERT(instData->audio_timer);
ret=cancel_timed_event(instData->audio_timer,0,0);
A2DP_ASSERT(ret);
instData->audio_timer=0;
SBC_stopEncode();
}
}
The above is preferred embodiment of the present invention only, is not to be used for limiting practical range of the present invention.Be that all equivalences of doing according to the content of the present patent application claim change and modification, all should be technology category of the present invention.

Claims (7)

1, the player method of bluetooth MP3 on a kind of mobile phone is characterized in that may further comprise the steps:
Step 1: under the multimedia menu of mobile phone, add the Bluetooth function menu option, and create activation and this bluetooth module that corresponding interfaces windows is used for bluetooth module and be connected with the coupling of bluetooth earphone;
Step 2: baseband chip is controlled described bluetooth module and bluetooth earphone mates in the mobile phone, starts the bluetooth earphone stereo function then;
Step 3: the user starts the MP3 play button, and baseband chip triggers and uses the bluetooth earphone passage to play MP3;
Step 4: baseband chip starts dsp chip to mp3 file broadcasts of decoding, and dsp chip carries out SBC to the audio data stream of playing encodes, and the SBC audio data stream after will encoding is stored in the buffer memory that the internal RAM of dsp chip own distributes;
Step 5: after the SBC voice data in the internal RAM of dsp chip reached first buffer memory, baseband chip was read the SBC voice data from the dsp chip internal RAM, and these data was write in the SRAM named cache of baseband chip;
Step 6: after the SBC data volume in the SRAM of the baseband chip named cache reaches second buffering capacity, baseband chip is read and is carried out transfer encoding once more getting the SBC voice data from the SRAM named cache, and the UART mouth of startup baseband chip, the SBC voice data is sent to bluetooth module;
Step 7: bluetooth module send on the bluetooth earphone, thereby the stereo MP3 that realizes bluetooth earphone is answered after the SBC voice data is handled by the A2DP protocol stack.
2, the player method of bluetooth MP3 according to claim 1 is characterized in that the SRAM named cache of base band FLASH chip in the step 5, just distributes from SRAM when definite MP3 uses the bluetooth earphone passage, and this buffer memory is the 400K byte.
3, the player method of bluetooth MP3 according to claim 1, it is characterized in that baseband chip in the step 6 according to the Maximum Bit Rate that the form and the UART mouth data transmissions of SBC coding reaches, calculate the data volume of SBC transfer of data and the time interval of transmission each time.
4, a kind of mobile phone that is used for the player method of aforesaid right requirement 1~3 described bluetooth MP3, comprise baseband chip, bluetooth module and bluetooth earphone, described bluetooth module links to each other with described baseband chip by the UART mouth, it is characterized in that this UART is also multiplexing uses as voice-grade channel, described baseband chip also links to each other by data/address bus with dsp chip, and this dsp chip is used for audio coding decoding.
5, mobile phone according to claim 4 is characterized in that described baseband chip is the GSM 6600D baseband chip of Spreadtrum Communications Inc., and platform software is based on the application software of this 6600D platform.
6, mobile phone according to claim 4 is characterized in that described bluetooth module is the Audio Processing chip of the BC41B143A model of CSR company.
7, mobile phone according to claim 4 is characterized in that described dsp chip is the dsp chip of the AIT706P model of AIT company.
CN2008102029704A 2008-11-19 2008-11-19 Bluetooth MP3 playing method on mobile phone and mobile phone thereof Active CN101453516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008102029704A CN101453516B (en) 2008-11-19 2008-11-19 Bluetooth MP3 playing method on mobile phone and mobile phone thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008102029704A CN101453516B (en) 2008-11-19 2008-11-19 Bluetooth MP3 playing method on mobile phone and mobile phone thereof

Publications (2)

Publication Number Publication Date
CN101453516A true CN101453516A (en) 2009-06-10
CN101453516B CN101453516B (en) 2011-01-12

Family

ID=40735529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008102029704A Active CN101453516B (en) 2008-11-19 2008-11-19 Bluetooth MP3 playing method on mobile phone and mobile phone thereof

Country Status (1)

Country Link
CN (1) CN101453516B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938567A (en) * 2010-09-15 2011-01-05 中兴通讯股份有限公司 Mobile phone and method for closing dialing function of mobile phone
CN102629471A (en) * 2012-03-07 2012-08-08 深圳市福智软件技术有限公司 Multi-decoder audio system, system signal flow and composed mobile equipment
CN101645717B (en) * 2009-09-07 2012-12-19 中兴通讯股份有限公司 Method and terminal for sharing audio information by multiple users by utilizing Bluetooth headsets
TWI448186B (en) * 2011-12-14 2014-08-01 Hon Hai Prec Ind Co Ltd Bluetooth headset and method for determining matched device
CN104183250A (en) * 2014-08-26 2014-12-03 惠州Tcl移动通信有限公司 Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN106856580A (en) * 2016-12-21 2017-06-16 歌尔科技有限公司 A kind of method of bluetooth earphone and its monitoring condition sound
CN107124512A (en) * 2017-04-28 2017-09-01 北京小米移动软件有限公司 The switching method and apparatus of audio-frequency play mode
WO2018152679A1 (en) * 2017-02-21 2018-08-30 万魔声学科技有限公司 Audio file transmitting method and apparatus, audio file receiving method and apparatus, devices and system
CN108648772A (en) * 2018-04-19 2018-10-12 上海康斐信息技术有限公司 A kind of the Bluetooth audio frequency playback method and electronic equipment of low-power consumption
CN111526506A (en) * 2020-07-01 2020-08-11 恒玄科技(北京)有限公司 Charging box and method for wireless communication and audio playing kit

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286770B (en) * 2007-04-09 2011-07-06 艾威梯科技(北京)有限公司 Method and system for automatically configuring audio encoding format transmitted by bluetooth A2DP
CN101217038B (en) * 2008-01-17 2011-06-22 中兴通讯股份有限公司 An encoding method of audio data SBC algorithm and Bluetooth stereo subsystem
CN101222793B (en) * 2008-01-25 2010-06-16 中兴通讯股份有限公司 Method and system for regulating bluetooth stereo acoustic quality

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645717B (en) * 2009-09-07 2012-12-19 中兴通讯股份有限公司 Method and terminal for sharing audio information by multiple users by utilizing Bluetooth headsets
CN101938567B (en) * 2010-09-15 2015-06-10 中兴通讯股份有限公司 Mobile phone and method for closing dialing function of mobile phone
WO2012034320A1 (en) * 2010-09-15 2012-03-22 中兴通讯股份有限公司 Mobile phone and method for turning off mobile phone dialing function
CN101938567A (en) * 2010-09-15 2011-01-05 中兴通讯股份有限公司 Mobile phone and method for closing dialing function of mobile phone
TWI448186B (en) * 2011-12-14 2014-08-01 Hon Hai Prec Ind Co Ltd Bluetooth headset and method for determining matched device
CN102629471A (en) * 2012-03-07 2012-08-08 深圳市福智软件技术有限公司 Multi-decoder audio system, system signal flow and composed mobile equipment
WO2013131367A1 (en) * 2012-03-07 2013-09-12 福兴达科技实业(深圳)有限公司 Multi-decoder audio system, system signal procedure, and formed mobile device
CN104183250A (en) * 2014-08-26 2014-12-03 惠州Tcl移动通信有限公司 Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN104183250B (en) * 2014-08-26 2017-04-12 惠州Tcl移动通信有限公司 Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN106856580A (en) * 2016-12-21 2017-06-16 歌尔科技有限公司 A kind of method of bluetooth earphone and its monitoring condition sound
CN106856580B (en) * 2016-12-21 2019-11-29 歌尔科技有限公司 A kind of method of bluetooth headset and its monitoring condition sound
WO2018152679A1 (en) * 2017-02-21 2018-08-30 万魔声学科技有限公司 Audio file transmitting method and apparatus, audio file receiving method and apparatus, devices and system
CN107124512A (en) * 2017-04-28 2017-09-01 北京小米移动软件有限公司 The switching method and apparatus of audio-frequency play mode
CN108648772A (en) * 2018-04-19 2018-10-12 上海康斐信息技术有限公司 A kind of the Bluetooth audio frequency playback method and electronic equipment of low-power consumption
CN111526506A (en) * 2020-07-01 2020-08-11 恒玄科技(北京)有限公司 Charging box and method for wireless communication and audio playing kit

Also Published As

Publication number Publication date
CN101453516B (en) 2011-01-12

Similar Documents

Publication Publication Date Title
CN101453516B (en) Bluetooth MP3 playing method on mobile phone and mobile phone thereof
CN109361984B (en) Charging box, wireless earphone, earphone set and voice processing system
US7292880B2 (en) Hands-free function
CN107659551A (en) For carrying out the System and method for of voice communication using LTE
CN101207412B (en) Tv set for controlling blue tooth mobile phone
CN1805324B (en) Method and system for controlling accessing device of individual lan
US7489946B2 (en) Cellular phone in form factor of a conventional audio cassette
US20090023417A1 (en) Multiple interactive modes for using multiple earpieces linked to a common mobile handset
CN102932567B (en) Terminal and audio processing method
US20050208893A1 (en) Bluetooth earphone module with audio player function
CN203872357U (en) Bluetooth intercommunication apparatus with push-to-talk (PTT) button
CN107005800A (en) Transmission, method of reseptance and the device of audio file, equipment and its system
CN103945340A (en) Bluetooth ptt talkback system
CN201323575Y (en) Bluetooth headset
JP2004312662A (en) Mobile terminal having function of outputting effect sound/background sound by using key button on communication
WO2015087548A1 (en) Telephone device and mobile-phone linking method
CN102332949B (en) Compass external talker, compass voice communication system and method
CN101931680B (en) Bluetooth system
TW201442484A (en) Communication device with self-on-demand module and the method of the same
CN101510904A (en) Mobile phone loudspeaker and implementing method thereof
CN110366752A (en) A kind of voice frequency dividing transmission method, plays end, source circuit and plays terminal circuit source
CN101430640A (en) Communication terminal with USB audio card, and method for implementing USB audio card in communication terminal
CN108650592A (en) A kind of method and stereo control system for realizing neckstrap formula surround sound
CN101009897A (en) Apparatus and method for outputting audio data using wireless terminal
CN101465908A (en) Method for Bluetooth voice talking through mobile phone and mobile phone

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: WINGTECH COMMUNICATIONS CO., LTD.

Free format text: FORMER OWNER: WINGTECH GROUP LIMITED

Effective date: 20120111

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20120111

Address after: 314006, No. 777, Middle South Road, Nanhu District, Zhejiang, Jiaxing (Jiaxing science and technology city)

Patentee after: Wingtech Communication Co., Ltd.

Address before: 314006, Jiaxing, Zhejiang on the north side of South Central Road, two West Road

Patentee before: Wingtech Group Limited