WO2022042327A1 - 音频驱动马达的通路配置方法及设备 - Google Patents

音频驱动马达的通路配置方法及设备 Download PDF

Info

Publication number
WO2022042327A1
WO2022042327A1 PCT/CN2021/112366 CN2021112366W WO2022042327A1 WO 2022042327 A1 WO2022042327 A1 WO 2022042327A1 CN 2021112366 W CN2021112366 W CN 2021112366W WO 2022042327 A1 WO2022042327 A1 WO 2022042327A1
Authority
WO
WIPO (PCT)
Prior art keywords
motor
dac
audio
module
message
Prior art date
Application number
PCT/CN2021/112366
Other languages
English (en)
French (fr)
Inventor
黄停
朱辰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US18/042,942 priority Critical patent/US20230319477A1/en
Priority to EP21860166.4A priority patent/EP4195637A4/en
Publication of WO2022042327A1 publication Critical patent/WO2022042327A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/60Substation equipment, e.g. for use by subscribers including speech amplifiers
    • H04M1/6016Substation equipment, e.g. for use by subscribers including speech amplifiers in the receiver circuit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/04Circuit arrangements, e.g. for selective connection of amplifier inputs/outputs to loudspeakers, for loudspeaker detection, or for adaptation of settings to personal preferences or hearing impairments
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/008Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/60Substation equipment, e.g. for use by subscribers including speech amplifiers
    • H04M1/6033Substation equipment, e.g. for use by subscribers including speech amplifiers for providing handsfree use or a loudspeaker mode in telephone sets
    • H04M1/6041Portable telephones adapted for handsfree use
    • H04M1/6058Portable telephones adapted for handsfree use involving the use of a headset accessory device connected to the portable telephone
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/033Headphones for stereophonic communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S1/00Two-channel systems
    • H04S1/007Two-channel systems in which the audio signals are in digital form
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/66Digital/analogue converters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/03Connection circuits to selectively connect loudspeakers or headphones to amplifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/05Detection of connection of loudspeakers or headphones to amplifiers

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a channel configuration method and device for an audio drive motor.
  • Motors are widely used in electronic devices (for example, smart phones). At present, electronic devices can only drive motors through independent motor drives, which are only used to drive motors, and the cost is high. Moreover, there are only a few fixed The motor vibration effect of , the vibration effect cannot be edited.
  • the codec chip has a total of three digital-to-analog converter DACs, of which the DAC left channel DAC L and the DAC right channel are used for earpieces and headphones, and the DAC ultrasonic channel DAC UL For ultrasound use, there is no extra DAC available for motor use.
  • the present application provides a channel configuration method and device for an audio driving motor, which can realize the audio driving motor, reduce the cost, and improve the richness of the special effects of the motor.
  • the present application provides a path configuration method for an audio drive motor, which is applied to an electronic device, wherein the electronic device is provided with an Android system, and the audio drive motor system of the electronic device includes an audio service module, an audio abstraction module, A codec driver and a codec chip, the audio service module is communicatively connected to the audio abstraction module, the audio abstraction module is communicatively connected to the codec driver, and the codec driver is connected to the codec
  • the audio service module is set in the application architecture layer of the Android system, the audio abstraction module is set in the hardware abstraction layer of the Android system, and the codec driver is set in the Android system.
  • the kernel layer, the codec chip is arranged on the hardware layer of the Android system, and the method includes:
  • the headphone plugging and unplugging message is received by the audio abstraction module, the DAC path configuration policy of the digital-to-analog converter in the codec chip is determined according to the headphone plugging and unplugging message, and the DAC path configuration policy is sent to the Codec driver, the DAC channel is used to transmit earpiece or earphone data, and transmit motor data to Class D amplifier ClassD to drive the motor;
  • the DAC channel configuration strategy is received by the codec driver, and the codec chip is controlled by the codec driver to reconfigure the DAC channel according to the DAC channel configuration strategy.
  • the electronic device re-determines the configuration strategy of the DAC channel in the codec chip when detecting the action of plugging and unplugging the earphone through the audio drive motor system, and reconfigures the DAC channel according to the configuration strategy of the DAC channel, so that the DAC channel not only It can transmit earpiece or earphone data, and can also transmit motor data to Class D amplifier ClassD to drive the motor, which realizes the solution of audio-driven motor and reduces the driving cost. Moreover, through the audio-driven motor, it is beneficial to improve the variety of vibration effects of the motor. sex.
  • the determining the DAC channel configuration policy of the digital-to-analog converter in the codec chip according to the headphone plugging and unplugging message includes: when the When the headphone plugging and unplugging message is a headphone plugging message, it is determined that the digital-to-analog converter DAC path configuration policy in the codec chip is the first DAC path configuration policy; when the headphone plugging and unplugging message is a headphone plugging message, it is determined that The digital-to-analog converter DAC channel configuration strategy in the codec chip is the second DAC channel configuration strategy.
  • the first DAC channel configuration strategy includes: the DAC left DAC L channel transmits earpiece data, the DAC right DAC R channel transmits motor data, and the DAC ultrasound DAC
  • the UL channel transmits ultrasound data; or, the DAC L channel transmits motor data, the DAC R channel transmits earpiece data, and the DAC UL channel transmits ultrasound data.
  • the first DAC channel configuration strategy includes: the DAC left channel DAC L and/or the DAC right channel DAC R transmits earpiece data, the DAC ultrasound channel DAC UL Transfer motor data.
  • the second DAC channel configuration strategy includes: the DAC left channel DAC L transmits the first earphone data, and the DAC right channel DAC R transmits the second earphone data,
  • the DAC Ultrasonic Path DAC UL transmits motor data.
  • the DAC UL path also transmits ultrasound data, and the priority of the motor data is different from the priority of the ultrasound data.
  • the motor vibration path for transmitting motor data when the display screen of the electronic device is in a bright screen state, the motor vibration path for transmitting motor data is in a connected state; When the screen is in a screen-off state, the motor vibration path is in a disconnected state, and the motor vibration path includes a DAC path for transmitting motor data.
  • the audio drive motor system further includes a first application program, a motor service module, a motor abstraction module, a motor drive, a motor, and a digital signal processing module DSP
  • the DSP includes shared memory and direct memory access DMA
  • the first application program is connected in communication with the motor service module
  • the motor service module is in communication connection with the motor abstraction module and the audio service module
  • the motor abstraction The module is communicatively connected to the motor drive
  • the motor drive and the audio abstraction module are communicatively connected to the DSP
  • the shared memory is communicatively connected to the DMA
  • the DSP is communicatively connected to the codec chip
  • the The codec chip is connected to the motor in communication
  • the first application program is arranged in the application layer of the Android system
  • the motor service module is arranged in the application architecture layer of the Android system
  • the motor abstraction module is arranged in the The hardware abstraction layer of the Android system, the motor driver and the DSP are arranged at the kernel layer of the
  • Parse the motor vibration message by the motor abstraction module determine the motor vibration type corresponding to the motor vibration message, and send the motor vibration type to the motor driver;
  • the target motor data is received through the target DAC path in the codec chip, and the target motor data is transmitted to the ClassD according to the configured target DAC path to drive the motor.
  • the display screen of the electronic device is in a screen-off state, and after the motor vibration message is sent to the motor abstraction module and the audio service module , the method further includes: receiving the motor vibration message through the audio service module, and sending a motor start message to the audio abstraction module according to the motor vibration message; receiving and delivering the motor vibration through the audio abstraction module Motor start message to open the motor vibration path.
  • the motor vibration message is received by the audio service module, and a motor start message is sent to the audio abstraction module according to the motor vibration message Afterwards, the method further includes: within a first preset time period, receiving the motor vibration message through the audio service module.
  • the method further includes: Within the second preset period, if the audio service module does not receive the motor vibration message, it sends a motor shutdown message to the audio abstraction module; receives and delivers the motor shutdown message through the audio abstraction module , so that the motor vibration path is closed.
  • the DAC channel configuration policy is received by the codec driver, and the codec chip is controlled by the codec driver
  • Reconfiguring the DAC path according to the DAC path configuration policy includes: driving the codec to receive the DAC path configuration policy, and determining whether there is an audio output service; when detecting an audio output service, The decoder driver closes the audio channel, and controls the codec chip to reconfigure the DAC channel according to the DAC channel configuration policy.
  • the headphone plug-in message is the headphone plug-in message
  • the DAC path is reconfigured according to the DAC path configuration policy
  • the The method further includes: driving through the codec to open an earpiece channel for transmitting earpiece data; after a third preset period of time, enabling the ClassD channel for transmitting motor data through the motor drive.
  • the present application provides a path configuration device for an audio drive motor, which is applied to an electronic device, where the electronic device is provided with an Android system, and the audio drive motor system of the electronic device includes an audio service module, an audio abstraction module, A codec driver and a codec chip, the audio service module is communicatively connected to the audio abstraction module, the audio abstraction module is communicatively connected to the codec driver, and the codec driver is connected to the codec
  • the audio service module is set in the application architecture layer of the Android system, the audio abstraction module is set in the hardware abstraction layer of the Android system, and the codec driver is set in the Android system.
  • the kernel layer, the codec chip is arranged on the hardware layer of the Android system, and the path configuration of the audio drive motor includes:
  • processing module used to call the audio service module to receive a headset plug-in message through the transceiver module, and send the headset plug-in message to the audio abstraction module through the transceiver module;
  • the audio abstraction module to receive the headphone plug-in message through the transceiver module, determine a digital-to-analog converter DAC path configuration strategy in the codec chip according to the headphone plug-in message, and configure the DAC path
  • the strategy is sent to the codec driver through the transceiver module, and the DAC channel is used to transmit the earpiece or earphone data, and to transmit the motor data to the Class D amplifier ClassD to drive the motor;
  • the codec driver is invoked to receive the DAC channel configuration strategy through the transceiver module, and the codec driver is used to control the codec chip to reconfigure the DAC channel according to the DAC channel configuration strategy.
  • the electronic device re-determines the configuration strategy of the DAC path in the codec chip when detecting the action of plugging and unplugging the earphone through the audio drive motor system, and reconfigures the DAC path according to the configuration strategy of the DAC path, so that the DAC path not only It can transmit earpiece or earphone data, and can also transmit motor data to Class D amplifier ClassD to drive the motor, which realizes the solution of audio-driven motor and reduces the driving cost. Moreover, through the audio-driven motor, it is beneficial to improve the variety of vibration effects of the motor. sex.
  • the processing The module is specifically used for: when the headphone plugging and unplugging message is a headphone unplugging message, determining that the digital-to-analog converter DAC path configuration strategy in the codec chip is the first DAC path configuration policy; when the headset plugging and unplugging message is the first DAC path configuration policy; When the message is an earphone insertion message, it is determined that the digital-to-analog converter DAC channel configuration strategy in the codec chip is the second DAC channel configuration strategy.
  • the first DAC channel configuration strategy includes: the DAC left DAC L channel transmits earpiece data, the DAC right DAC R channel transmits motor data, and the DAC ultrasound DAC
  • the UL channel transmits ultrasound data; or, the DAC L channel transmits motor data, the DAC R channel transmits earpiece data, and the DAC UL channel transmits ultrasound data.
  • the first DAC channel configuration strategy includes: the DAC left channel DAC L and/or the DAC right channel DAC R transmits earpiece data, the DAC ultrasound channel DAC UL Transfer motor data.
  • the second DAC channel configuration strategy includes: the DAC left channel DAC L transmits the first earphone data, and the DAC right channel DAC R transmits the second earphone data,
  • the DAC Ultrasonic Path DAC UL transmits motor data.
  • the DAC UL path also transmits ultrasound data, and the priority of the motor data is different from the priority of the ultrasound data.
  • the motor vibration path for transmitting motor data when the display screen of the electronic device is in a bright screen state, the motor vibration path for transmitting motor data is in a connected state; When the screen is in a screen-off state, the motor vibration path is in a disconnected state, and the motor vibration path includes a DAC path for transmitting motor data.
  • the audio drive motor system further includes a first application program, a motor service module, a motor abstraction module, a motor drive, a motor, and a digital signal processing module DSP
  • the DSP includes shared memory and direct memory access DMA
  • the first application program is connected in communication with the motor service module
  • the motor service module is in communication connection with the motor abstraction module and the audio service module
  • the motor abstraction The module is communicatively connected to the motor drive
  • the motor drive and the audio abstraction module are communicatively connected to the DSP
  • the shared memory is communicatively connected to the DMA
  • the DSP is communicatively connected to the codec chip
  • the The codec chip is connected to the motor in communication
  • the first application program is arranged in the application layer of the Android system
  • the motor service module is arranged in the application architecture layer of the Android system
  • the motor abstraction module is arranged in the The hardware abstraction layer of the Android system, the motor driver and the DSP are arranged at the kernel layer of the
  • the motor service module to receive the motor vibration command from the first application program through the transceiver module, convert the motor vibration command into a motor vibration message, and send the motor vibration message to the a motor abstraction module and the audio service module;
  • the motor driver to receive the motor vibration type through the transceiver module, determine target motor data according to the motor vibration type, and transmit the target motor data to the DSP through the shared memory through the transceiver module; as well as,
  • the target DAC channel in the codec chip to receive the target motor data through the transceiver module, and transmit the target motor data to the target motor data through the transceiver module according to the configured target DAC channel ClassD to drive the motor.
  • the display screen of the electronic device is in a screen-off state
  • the processing module sends the motor vibration message to the motor abstraction module through the transceiver module
  • the audio service module is further used to: call the audio service module to receive the motor vibration message through the transceiver module, and send the motor vibration message to the audio abstraction module through the transceiver module according to the motor vibration message. and calling the audio abstraction module to receive and deliver the motor start message through the transceiver module, so as to enable the motor vibration path.
  • the processing module invokes the audio service module to receive the motor vibration message through the transceiver module, and transmits the motor vibration message through the motor vibration message according to the motor vibration message.
  • the transceiver module sends the motor start message to the audio abstraction module, it is further configured to: within a first preset time period, call the audio service module to receive the motor vibration message through the transceiver module.
  • the processing module invokes the audio abstraction module to receive and deliver the motor start message through the transceiver module, so that after the motor vibration path is opened , and is also used for: within the second preset period, if the audio service module does not receive the motor vibration message, invoking the audio service module to send a motor shutdown message to the audio abstraction module through the transceiver module and, calling the audio abstraction module to receive and deliver the motor shutdown message through the transceiver module, so as to close the motor vibration path.
  • the processing module is configured to: call the codec driver to receive the DAC path configuration policy through the transceiver module, and determine whether to There is an audio output service; and when an audio output service is detected, the codec driver is called to close the audio path, and the codec chip is controlled to reconfigure the DAC path according to the DAC path configuration policy.
  • the headphone plug-in message is the headphone plug-in message, and after the processing module reconfigures the DAC path according to the DAC path configuration policy,
  • the method is also used for: calling the codec driver to open the earpiece channel for transmitting the earpiece data; after the third preset time period, calling the motor driver to open the ClassD channel for transmitting the motor data.
  • the present application provides an electronic device, the electronic device includes a processor and a memory, the memory is used for storing a program code, and the processor is used for calling the program code in the memory to execute any one of the first aspect. one of the methods described.
  • the present application provides an electronic device, the electronic device includes a processor; the processor is coupled to a memory, and the processor is configured to call program code in the memory to execute any one of the first aspects. method described.
  • the present application provides a readable storage medium, where instructions are stored in the readable storage medium, and when the instructions are executed on an electronic device, the electronic device is made to execute any one of the first aspects. method described.
  • the present application provides a computer program product that, when running on an electronic device, causes the electronic device to execute the method according to any one of the first aspects.
  • FIG. 1 is a schematic diagram of an audio drive motor system provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a signal flow of an audio driving motor system according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a channel configuration method for an audio drive motor provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a hardware circuit of an audio digital-to-analog converter DAC path provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of another channel configuration method for an audio drive motor provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a channel configuration device for an audio drive motor provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • Class D amplifier is an amplifier that drives speakers by controlling the on and off of the switch unit.
  • Linear motor generally refers to a linear motor
  • a linear motor is a transmission device that directly converts electrical energy into linear motion mechanical energy without any intermediate conversion mechanism. It can be regarded as a rotating electrical machine which is cut radially and developed into a plane.
  • a digital-to-analog converter refers to a device that converts discrete digital signals into analog signals of continuous variables.
  • Codec refers to a device or program that can transform a signal or a data stream.
  • the transformation referred to here includes the operation of encoding a signal or data stream (usually for transmission, storage or encryption) or extracting an encoded stream.
  • Embodiments of the present application provide a method and device for configuring a channel of an audio drive motor.
  • the audio drive motor system adapted by the embodiments of the present application will be described in detail below.
  • FIG. 1 is an audio driving motor system provided by an embodiment of the present application.
  • the illustrated system includes a first application program 101 , a motor service module 111 , an audio service module 112 , a motor abstraction module 121 , and an audio abstraction module 122 , a digital signal processing module (digital signal processing, DSP) 130 (the DSP 130 includes a shared memory 133 and a direct memory access (DMA) 134), a motor drive 131, a codec drive 132, and a codec chip 141 , and the motor 142, wherein the first application 101 is in communication connection with the motor service module 111, the motor service module 111 is in communication connection with the motor abstraction module 121 and the audio service module 112, and the motor abstraction module 121 is connected with The motor driver 131 is in communication connection, the audio service module 112 is in communication connection with the audio abstraction module 122, the audio abstraction module 122 is in communication connection with the codec driver 132 and the DSP 130, and the codec driver 132
  • DSP digital
  • the signal flow of each module in the audio-driven motor system is shown in FIG. 2 , the first application 101 is used to send a motor vibration command to the motor service module 111 , and the motor service module 111 is used to receive data from The motor vibration command of the first application 101 converts the motor vibration command into a motor vibration message, and sends the motor vibration message to the motor abstraction module 121 and the audio service module 112; the motor The abstraction module 121 is used to parse the motor vibration message, determine the motor vibration type corresponding to the motor vibration message, and send the motor vibration type to the motor driver 131; the motor driver 131 is used to receive the motor vibration type, determine the target motor data according to the motor vibration type, transfer the target motor data to the DSP 130 and/or the DMA 134 through the shared memory 133, and the motor driver 131 is also used to control the codec chip 141.
  • the class D amplifier ClassD module is turned on, and used to control the power supply, and to control the motor data transfer strategy, which can include DSP channel selection strategy, transfer start time, transfer end time, etc.; among them, the DSP module also includes The additionally developed motor module is used to control the transfer of the target motor data by DMA through the motor data transfer strategy; the audio service module 112 is used to receive the broadcast message of earphone plugging and unplugging, and transfer the headset plugging and unplugging message and the motor The vibration message is sent to the audio abstraction module 122; the audio abstraction module 122 is used to receive the headphone plugging and unplugging message and distribute the message, and determine the digital analog in the codec chip 141 according to the headphone plugging and unplugging message.
  • the converter DAC channel configuration strategy, the audio abstraction module 122 is further configured to receive the motor vibration message and the display screen state, and determine whether to send the motor on message or the motor off message according to the display screen state, and send the message when necessary When the motor is turned on, a motor start message is sent according to the motor vibration message, which is used to turn on the motor vibration path.
  • the audio abstraction module 122 also sends the target DAC path of the target motor data to the motor module in the DSP, and sends all the data to the motor module.
  • the DAC path configuration policy is sent to the codec driver 132, the DAC path is used to transmit earpiece or headphone data, and motor data to the class D amplifier ClassD to drive the motor, the codec driver 132 receives the DAC channel configuration strategy, and control the codec chip 141 to configure the DAC channel according to the DAC channel configuration strategy through the motor control and audio control, and the DMA 134 is used to transmit the target motor data to the codec
  • the target DAC path of the encoder chip 141; the codec chip 141 is used to receive the target motor data, and transmit the target motor data to the ClassD according to the configured target DAC path to drive the motor 142 .
  • the electronic device needs to calibrate the ClassD in the audio drive motor system, and the acceleration calibration method can be used. For example, by playing audio sources of different frequencies to see the maximum Z-direction acceleration value to determine its resonant frequency method for calibration. .
  • the electronic device needs motor vibration experience when starting up, it needs to support motor operation in the fastboot stage, that is, the X-axis motor vibration can be started in the fastboot stage, and the motor driver needs to support the configuration of the motor microelectronic device IC module in the fastboot stage, and start up.
  • the vibration is realized by the naked write register.
  • the motor waveform needs to be directly written into the register (first input first output, FIFO), and the register of the bare write codec chip is configured to configure the motor vibration.
  • system and “network” in the embodiments of the present application may be used interchangeably.
  • “Plurality” refers to two or more than two, and in view of this, “plurality” may also be understood as “at least two” in the embodiments of the present application.
  • “And/or”, which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone.
  • the character “/” unless otherwise specified, generally indicates that the related objects are an "or" relationship.
  • FIG. 3 is a schematic diagram of a channel configuration method for an audio driving motor provided by an embodiment of the present application. Taking the system shown in FIG. 1 as an example, as shown in FIG. 3 , the path configuration method of the audio drive motor executed on the system includes:
  • An electronic device receives an earphone plugging and unplugging message through the audio service module, and sends the headset plugging and unplugging message to the audio abstraction module;
  • the earphone plugging and unplugging message includes a headset plugging in message and a headset unplugging message
  • the headset plugging and unplugging message is a message received by the audio service module through broadcasting.
  • the electronic device receives the headphone plugging and unplugging message through the audio abstraction module, determines a digital-to-analog converter DAC path configuration policy in the codec chip according to the headphone plugging and unplugging message, and assigns the DAC path
  • the configuration strategy is sent to the codec driver, and the DAC channel is used to transmit the earpiece or earphone data, and to transmit the motor data to the Class D amplifier ClassD to drive the motor;
  • the DAC path includes at least three paths.
  • they can be the DAC left DAC L path, the DAC right DAC R path, and the DAC ultrasound DAC UL path.
  • the DAC L path The channel can be used to transmit the earpiece data or the earphone left channel data
  • the DAC right DAC R channel can be used to transmit the earpiece data or the earphone right channel data
  • the DAC ultrasound DAC UL channel can be used to transmit the ultrasound data
  • the ultrasound data can be used with For anti-mistouch detection, etc.
  • the determining, according to the headphone plugging and unplugging message, a digital-to-analog converter DAC channel configuration policy in the codec chip includes:
  • the headphone plug-in message is the headphone plug-out message
  • the headphone plug-in message is the headphone plug-in message
  • the digital-to-analog converter DAC channel configuration strategy in the codec chip is the second DAC channel configuration strategy.
  • the first DAC channel configuration strategy is different from the second DAC channel configuration strategy, the first DAC channel configuration strategy and the second DAC channel configuration strategy may be various, and the first DAC channel configuration strategy and the second DAC channel configuration strategy
  • the configuration strategies all include DAC channel configuration strategies for transmitting motor data, which are not limited here.
  • the electronic device determines different DAC channel configuration strategies by using different earphone plugging and unplugging messages, which is beneficial to the rationality and diversity of the time slot DAC channel configuration, thereby realizing the audio drive motor.
  • the first DAC channel configuration strategy includes: the DAC left DAC L channel transmits earpiece data, the DAC right DAC R channel transmits motor data, and the DAC ultrasound DAC UL channel transmits ultrasound data; or, the DAC The L channel transmits motor data, the DAC R channel transmits earpiece data, and the DAC UL channel transmits ultrasound data.
  • the DAC left DAC L channel transmits earpiece data
  • the DAC right DAC R channel transmits motor data
  • the DAC ultrasound DAC UL channel transmits ultrasound data.
  • the channel configuration is shown in Figure 4, or the DAC left DAC L channel can also be used to transmit motor data Data, DAC right DAC R channel transmits earpiece data, which will not be repeated here.
  • the first DAC channel configuration strategy includes: the DAC left channel DAC L and/or the DAC right channel DAC R transmits earpiece data, and the DAC ultrasonic channel DAC UL transmits motor data.
  • the second DAC channel configuration strategy includes: DAC left channel DAC L transmits first earphone data, DAC right channel DAC R transmits second earphone data, and DAC ultrasonic channel DAC UL transmits motor data.
  • the anti-mistouch function of ultrasonic can be realized through other solutions, for example, through optical detection or image detection and other solutions Realize the anti-mistouch function of electronic equipment, which is not limited here.
  • the ultrasonic channel function that can be replaced by other solutions is changed to the function of transmitting motor data to drive the motor, and other solutions are used to realize the ultrasonic channel function.
  • the decline in the functionality of electronic equipment has increased the flexibility of audio drive motors.
  • the DAC UL path also transmits ultrasound data, and the priority of the motor data is different from the priority of the ultrasound data.
  • the multiplexing of the DAC UL channel is not only used to transmit ultrasonic data, but also used to transmit motor data.
  • you can set the priority of the motor data and the ultrasonic data for example, set the motor data and ultrasonic data.
  • the priority of the data is higher than the priority of the ultrasound data, or the priority of the ultrasound data may be set higher than the priority of the motor data, which is not limited herein.
  • the multiplexing of the DAC UL channel by the ultrasonic data and the motor data is realized by setting different priorities, which is beneficial to improve the utilization rate of the DAC in the case of realizing the audio-driven motor.
  • the electronic device receives the DAC path configuration policy through the codec driver, and controls the codec chip to reconfigure the DAC path according to the DAC path configuration policy through the codec driver.
  • the electronic device after receiving the DAC path configuration policy through the codec driver, the electronic device first closes all audio channels, and then controls the codec chip to reconfigure the DAC according to the DAC path configuration policy
  • the channel can effectively avoid the POP sound during the configuration process.
  • the audio channel is closed and the DAC channel is reconfigured according to the DAC channel configuration strategy, it is possible to first detect whether there is a motor vibration message. If there is no vibration message, it can be configured according to the general configuration strategy. If there is a motor vibration message , Since the motor requires vibration within 30ms, otherwise there will be vibration loss during continuous vibration such as input method typing; in order to prevent vibration loss, it is necessary to optimize the path configuration, that is, optimize the motor path configuration time. During the path configuration process, you can The initialization configuration of the channel-independent speakers is placed after the motor channel configuration, so that the motor channel is established in advance, and the motor vibration time can be optimized.
  • the DAC channel configuration policy is received by the codec driver, and the codec chip is controlled by the codec driver to be reconfigured according to the DAC channel configuration policy
  • the DAC pathway includes:
  • the audio channel is closed by the codec driver, and the codec chip is controlled to reconfigure the DAC channel according to the DAC channel configuration policy.
  • the DAC path configuration policy determines whether there is no audio output service. If there is no audio output service, the DAC path may not be reconfigured immediately, but only when the audio output service is detected, the DAC path is reconfigured , for example, when the headphone plug-in message is the headphone plug-in message, there is no audio output service at this time, so do not immediately reconfigure the DAC channel, that is to say, if there is audio, or output audio through the earpiece, when it is detected that there is audio When the audio service is output, reconfigure the channel so that the audio is output from the headphone.
  • the DAC path is not configured immediately, but the DAC path is reconfigured only when audio output is detected, which is beneficial to reduce resource occupation , to improve the necessity of channel configuration.
  • the electronic device re-determines the configuration strategy of the DAC channel in the codec chip when detecting the action of plugging and unplugging the earphone through the audio drive motor system, and reconfigures the DAC channel according to the configuration strategy of the DAC channel, so that the DAC channel not only It can transmit earpiece or earphone data, and can also transmit motor data to Class D amplifier ClassD to drive the motor, which realizes the solution of audio-driven motor and reduces the driving cost. Moreover, through the audio-driven motor, it is beneficial to improve the variety of vibration effects of the motor. sex.
  • the motor vibration path for transmitting motor data when the display screen of the electronic device is in a bright-screen state, the motor vibration path for transmitting motor data is in a connected state; when the display screen of the electronic device is in a screen-off state, the The motor shock path is in an open state, and the motor shock path includes a DAC path that transmits motor data.
  • the motor channel in the bright screen state, the motor channel is always open, and when there is a motor vibration demand or no motor vibration demand, only the ClassD module with large power consumption is controlled to be turned on and off, and it will not exist under normal use. Vibration is lost, and power consumption is reduced.
  • the screen when the screen is off, the channel is closed, and the channel is opened when there is a need for motor vibration. At the same time, there are fewer motor vibration events during the transition from the off-screen state to the bright-screen state. Therefore, this method can effectively reduce the loss of motor vibration.
  • the audio abstraction module does not send a motor on message or a motor off message according to the state of the display screen.
  • the motor vibration channel in the bright screen state, the motor vibration channel is normally open, and in the screen off state, the motor vibration channel is closed, and it is opened on demand, which is beneficial to reduce the loss of motor vibration and reduce the loss of electronic equipment. power consumption.
  • the method further includes:
  • Parse the motor vibration message by the motor abstraction module determine the motor vibration type corresponding to the motor vibration message, and send the motor vibration type to the motor driver;
  • the target motor data is received through the target DAC path in the codec chip, and the target motor data is transmitted to the ClassD according to the configured target DAC path to drive the motor.
  • the motor abstraction module after receiving the motor vibration message sent by the motor service module, parses the motor vibration message, and uses the extensible markup language (XML) started by the system EMUI11 to correspond to determine the vibration type of the motor vibration.
  • XML extensible markup language
  • the motor vibration type may include special effects type, sound follow type, Google long vibration type, etc., which is not limited here, wherein the special effect type directly sends the motor vibration message, and the sound follow type circulates the motor vibration message.
  • the Google long-shock class continuously sends motor vibration messages for the total time.
  • the motor service module sends the motor vibration message to the audio service module, so that the audio service module notifies the audio abstraction module to open the motor vibration channel.
  • the motor drive stores the motor vibration waveform, and when the motor vibrates, the special effect data is transmitted to the DMA through the shared memory, and transferred to the DSP.
  • the data needs to be moved during vibration, and the ClassD module needs to be opened at the same time.
  • the special effect waveform of the motor adopts the sampling rate of 1k, one special effect is 20ms, about 40 bytes, and at least 6 special effects, about 240 bytes of data.
  • the target DAC path may be the DAC L path, or the DAC R path, or the DAC UL path.
  • the audio service module may receive the headphone plugging and unplugging message synchronously, that is, this embodiment and the above-mentioned S201, S202, and S203 may be executed synchronously in parallel.
  • the electronic device realizes the audio-driven motor through the audio-driven motor system and through the data transmission between various levels, and at the same time can improve the richness of the motor vibration special effects.
  • the display screen of the electronic device is in a screen-off state, and after the motor vibration message is sent to the motor abstraction module and the audio service module, the method further includes:
  • the motor startup message is received and delivered by the audio abstraction module, so as to enable the motor vibration path.
  • the audio service module when the display screen of the electronic device is in a screen-off state, the audio service module is connected to communicate with the motor service module, and the audio service module can receive the motor vibration message sent by the motor service module, so that the audio drive motor
  • the motor vibration channel can be opened on demand, which is beneficial to reduce the power consumption of electronic equipment and improve the convenience of motor driving.
  • the method further includes:
  • the motor vibration message is received by the audio service module within a first preset time period.
  • the first preset time period may be, for example, 3s, 4s, etc., which is not limited herein.
  • the audio service module After receiving the motor vibration message through the audio service module, and sending a motor start message to the audio abstraction module according to the motor vibration message, within a first preset period of time, the audio service module is used again. When the module receives the motor vibration message, it does not issue a motor start message.
  • the message distribution of the motor startup message and the motor shutdown message can be realized through the setParameter interface of the audio abstraction module.
  • the audio driver receives the audio route configuration command transmitted by the audio abstraction module, establishes a motor vibration path according to the route map, and agrees with the motor driver that the motor data sampling rate is 96k, and the left channel SRC2 is a 48k*2 module. to close.
  • the motor start message is only sent once, so as to avoid the negative impact caused by the frequent switching of motor channels caused by sending the motor start message multiple times. , while reducing the power consumption of electronic equipment.
  • the method further includes:
  • the audio service module does not receive the motor vibration message, send a motor shutdown message to the audio abstraction module;
  • the motor shutdown message is received and delivered by the audio abstraction module, so that the motor vibration channel is closed.
  • the second preset time period may be the same as the first preset time period, or may be different from the first preset time period, which is not limited herein.
  • the motor off message is sent to close the motor passage.
  • the headphone plug-in message is the headphone plug-in message
  • the method further includes:
  • the ClassD path for transmitting motor data is opened through the motor drive.
  • the third preset time period may be, for example, 20ms, 25ms, etc., which is not limited herein.
  • the earpiece channel is opened first, and then the ClassD channel is opened after the third preset time period, which is beneficial to avoid the occurrence of POP sound in the earphone due to the incomplete release of the audio data stream.
  • FIG. 5 is a schematic diagram of another channel configuration method for an audio driving motor provided by an embodiment of the present application.
  • the path configuration method of the audio driving motor executed on the system includes:
  • the electronic device receives the motor vibration command from the first application through the motor service module, converts the motor vibration command into a motor vibration message, and sends the motor vibration message to the motor abstraction module and the audio service module.
  • the electronic device parses the motor vibration message through the motor abstraction module, determines the motor vibration type corresponding to the motor vibration message, and sends the motor vibration type to the motor driver.
  • the electronic device receives the motor vibration type through the motor drive, determines target motor data according to the motor vibration type, and transmits the target motor data to the DSP through the shared memory.
  • the electronic device receives the earphone plugging and unplugging message through the audio service module, and sends the headset plugging and unplugging message to the audio abstraction module.
  • the electronic device receives the headphone plugging and unplugging message through the audio abstraction module, determines a DAC path configuration policy of the digital-to-analog converter in the codec chip according to the headphone plugging and unplugging message, and configures the DAC path configuration policy Sent to the codec driver, the DAC path is used to transmit the earpiece or headphone data, and the motor data to the Class D amplifier ClassD to drive the motor.
  • the electronic device receives the DAC path configuration policy through the codec driver, and controls the codec chip to reconfigure the DAC path according to the DAC path configuration policy through the codec driver.
  • the electronic device receives, through the DSP, the target DAC path for transmitting motor data sent from the audio abstraction module, and controls the DMA to transmit the target motor data to the codec chip through the DSP. target DAC pathway.
  • the electronic device receives the target motor data through the target DAC path in the codec chip, and transmits the target motor data to ClassD according to the configured target DAC path to drive the motor.
  • the electronic device re-determines the configuration strategy of the DAC channel in the codec chip when detecting the action of plugging and unplugging the earphone through the audio drive motor system, and reconfigures the DAC channel according to the configuration strategy of the DAC channel, so that the DAC channel not only It can transmit earpiece or earphone data, and can also transmit motor data to Class D amplifier ClassD to drive the motor, which realizes the solution of audio-driven motor and reduces the driving cost. Moreover, through the audio-driven motor, it is beneficial to improve the variety of vibration effects of the motor. sex.
  • FIG. 6 is a schematic diagram of a path configuration device for an audio drive motor provided by an embodiment of the application.
  • the path configuration of the audio drive motor is applied to an electronic device, and the electronic device is provided with an Android system, and the electronic device
  • the audio drive motor system of the device includes an audio service module, an audio abstraction module, a codec driver, and a codec chip, the audio service module is communicatively connected to the audio abstraction module, and the audio abstraction module is connected to the codec
  • the driver is connected in communication
  • the codec driver is connected in communication with the codec chip
  • the audio service module is set in the application architecture layer of the Android system
  • the audio abstraction module is set in the hardware abstraction of the Android system.
  • the codec driver is arranged at the kernel layer of the Android system
  • the codec chip is arranged at the hardware layer of the Android system
  • the channel configuration device 400 of the audio drive motor includes: a processing module 401 and a Transceiver module 402 .
  • the processing module 401 used to call the audio service module to receive a headset plug-in message through the transceiver module 402, and send the headset plug-in message to the audio abstraction module through the transceiver module 402; and,
  • the audio abstraction module to receive the headphone plug-in message through the transceiver module 402, determine the digital-to-analog converter DAC path configuration policy in the codec chip according to the headphone plug-in message, and configure the DAC path
  • the configuration strategy is sent to the codec driver through the transceiver module 402, and the DAC path is used to transmit earpiece or earphone data, and to transmit motor data to the Class D amplifier ClassD to drive the motor;
  • the codec driver is called to receive the DAC path configuration policy through the transceiver module 402, and the codec driver is used to control the codec chip to reconfigure the DAC path according to the DAC path configuration policy.
  • the first device determines the second device to cooperate from among multiple candidate devices according to the sent cooperation request information and the received cooperation response information, and sends the cooperation confirmation information to the second device.
  • the first device The device or the second device can determine the time domain configuration information of the physical downlink control channel PDCCH search space set between the two, and perform cooperative transmission when the time domain configuration information of the physical downlink control channel PDCCH search space set meets the conditions, which is beneficial to Reduce cooperative transmission delay.
  • the processing module 401 is specifically configured to: when the When the headphone plugging and unplugging message is a headphone plugging message, it is determined that the digital-to-analog converter DAC path configuration policy in the codec chip is the first DAC path configuration policy; when the headphone plugging and unplugging message is a headphone plugging message, it is determined that The digital-to-analog converter DAC channel configuration strategy in the codec chip is the second DAC channel configuration strategy.
  • the first DAC channel configuration strategy includes: the DAC left DAC L channel transmits earpiece data, the DAC right DAC R channel transmits motor data, and the DAC ultrasound DAC UL channel transmits ultrasound data; or, the DAC The L channel transmits motor data, the DAC R channel transmits earpiece data, and the DAC UL channel transmits ultrasound data.
  • the first DAC channel configuration strategy includes: the DAC left channel DAC L and/or the DAC right channel DAC R transmits earpiece data, and the DAC ultrasonic channel DAC UL transmits motor data.
  • the second DAC channel configuration strategy includes: DAC left channel DAC L transmits first earphone data, DAC right channel DAC R transmits second earphone data, and DAC ultrasonic channel DAC UL transmits motor data.
  • the DAC UL path also transmits ultrasound data, and the priority of the motor data is different from the priority of the ultrasound data.
  • the motor vibration path for transmitting motor data when the display screen of the electronic device is in a bright-screen state, the motor vibration path for transmitting motor data is in a connected state; when the display screen of the electronic device is in a screen-off state, the The motor shock path is in an open state, and the motor shock path includes a DAC path that transmits motor data.
  • the audio drive motor system further includes a first application program, a motor service module, a motor abstraction module, a motor drive, a motor, and a digital signal processing module DSP, where the DSP includes a shared memory and a direct memory access DMA, the first application is communicatively connected to the motor service module, the motor service module is communicatively connected to the motor abstraction module and the audio service module, the motor abstraction module is communicatively connected to the motor drive, the The motor drive, the audio abstraction module is in communication with the DSP, the shared memory is in communication with the DMA, the DSP is in communication with the codec chip, and the codec chip is in communication with the motor connection, the first application program is set at the application layer of the Android system, the motor service module is set at the application architecture layer of the Android system, and the motor abstraction module is set at the hardware abstraction layer of the Android system, The motor driver and the DSP are arranged at the kernel layer of the Android system, the motor is arranged at the hardware layer of the Android system, and the
  • the motor service module to receive the motor vibration command from the first application through the transceiver module 402 , convert the motor vibration command into a motor vibration message, and send the motor vibration message through the transceiver module 402 sent to the motor abstraction module and the audio service module;
  • the motor driver to receive the motor vibration type through the transceiver module 402, determine target motor data according to the motor vibration type, and transmit the target motor data to the shared memory through the transceiver module 402. DSP; and,
  • the ClassD to drive the motor.
  • the display screen of the electronic device is in a screen-off state, and after the processing module 401 sends the motor vibration message to the motor abstraction module and the audio service module through the transceiver module 402 , also used for:
  • the audio abstraction module is called to receive and deliver the motor start message through the transceiver module 402, so as to enable the motor vibration path.
  • the processing module 401 calls the audio service module to receive the motor vibration message through the transceiver module 402, and sends the audio message to the audio through the transceiver module 402 according to the motor vibration message.
  • the abstract module sends the motor start message, it is further configured to: call the audio service module to receive the motor vibration message through the transceiver module 402 within a first preset time period.
  • the processing module 401 calls the audio abstraction module to receive and deliver the motor start message through the transceiver module 402, so that after the motor vibration path is opened, the processing module 401 is further used for: in the first Within two preset time periods, if the audio service module does not receive the motor vibration message, call the audio service module to send a motor shutdown message to the audio abstraction module through the transceiver module 402; and,
  • the audio abstraction module is called to receive and deliver the motor shutdown message through the transceiver module 402, so as to close the motor vibration path.
  • the codec driver is called to receive the DAC channel configuration policy through the transceiver module 402, and the codec driver is used to control the codec chip according to the
  • the processing module 401 is configured to: call the codec driver to receive the DAC path configuration strategy through the transceiver module 402, and determine whether there is an audio output service; and , when the audio output service is detected, the codec driver is called to close the audio path, and the codec chip is controlled to reconfigure the DAC path according to the DAC path configuration policy.
  • the headphone plug-in message is the headphone plug-in message
  • the processing module 401 reconfigures the DAC path according to the DAC path configuration policy
  • the processing module 401 is further configured to: call the encoder The decoder driver opens the earpiece channel for transmitting the earpiece data; after the third preset period, the motor driver is invoked to open the ClassD channel for transmitting the motor data.
  • the path configuration device of the audio drive motor shown in FIG. 6 in this implementation manner is applied to the electronic equipment in the path configuration method of the audio drive motor of the embodiment of the present application, and can realize the configuration of the audio drive motor of the embodiment of the present application.
  • the corresponding flow of the path configuration method is not repeated here for brevity.
  • FIG. 7 is a schematic diagram of an electronic device 500 according to an embodiment of the present application.
  • the electronic device 500 includes a processor 510 , a communication interface 520 and a memory 530 , and the processor 510 , the communication interface 520 and the memory 530 are connected to each other through an internal bus 540 .
  • the processor 510 may be constituted by one or more general-purpose processors, such as a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the bus 540 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 540 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one line is shown in FIG. 6, but it does not mean that there is only one bus or one type of bus.
  • the memory 530 may include volatile memory (volatile memory), such as random access memory (RAM); the memory 530 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 530 may also include a combination of the above types.
  • volatile memory such as random access memory (RAM)
  • the memory 530 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 530 may also include a combination of the above types.
  • the memory 530 can be used to store programs and data, so that the processor 510 can call the program codes and data stored in the memory 530 to realize the functions of the above-mentioned processing module 401 .
  • the electronic device shown in FIG. 7 can correspond to the electronic device in the path configuration method of the audio drive motor of the embodiment of the present application, and can realize the corresponding flow of the path configuration method of the audio drive motor of the embodiment of the present application, in order to It is concise and will not be repeated here.
  • the embodiment of the application further provides a readable storage medium, where an instruction is stored in the readable storage medium, when the instruction is executed on the electronic device, the electronic device is made to execute the relevant processes in the above method embodiments.
  • Embodiments of the present application further provide a computer program product, which, when running on an electronic device, enables the electronic device to execute the relevant processes in the foregoing method embodiments.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be implemented in the present application.
  • the implementation of the examples constitutes no limitation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Telephone Function (AREA)

Abstract

本申请公开了一种音频驱动马达的通路配置方法及设备,包括:音频服务模块与音频抽象模块通信连接,音频抽象模块与编解码器驱动通信连接,编解码器驱动与编解码器芯片通信连接,音频服务模块接收耳机插拔消息发送给音频抽象模块;音频抽象模块根据耳机插拔消息确定编解码器芯片中数字模拟转换器DAC通路配置策略,并发送给编译码器驱动,DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器以驱动马达;编译码器驱动控制编解码器芯片按照DAC通路配置策略重新配置DAC通路,本申请实施例实现音频驱动马达,降低成本,提升马达特效的丰富性。

Description

音频驱动马达的通路配置方法及设备
本申请要求于2020年8月31日提交中国专利局、申请号为202010902838.5、申请名称为“音频驱动马达的通路配置方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种音频驱动马达的通路配置方法及设备。
背景技术
马达在电子设备(例如,智能手机)上的应用很广泛,目前,电子设备只能通过独立的马达驱动来驱动马达,该马达驱动只用于驱动马达,成本较高,而且,只有几种固定的马达震动效果,震动效果不可编辑。
目前,电子设备还可以通过编解码器芯片驱动马达,但编解码器芯片一共有三个数字模拟转换器DAC,其中DAC左通路DAC L和DAC右通路给听筒和耳机使用,DAC超声通路DAC UL给超声使用,没有多余的DAC可以提供给马达使用。
发明内容
本申请提供一种音频驱动马达的通路配置方法及设备,能够实现音频驱动马达,降低成本,提升马达特效的丰富性。
第一方面,本申请提供了一种音频驱动马达的通路配置方法,应用于电子设备,所述电子设备设置有安卓系统,所述电子设备的音频驱动马达系统包括音频服务模块、音频抽象模块、编解码器驱动、编解码器芯片,所述音频服务模块与所述音频抽象模块通信连接,所述音频抽象模块与所述编解码器驱动通信连接,所述编解码器驱动与所述编解码器芯片通信连接,所述音频服务模块设置于所述安卓系统的应用架构层,所述音频抽象模块设置于所述安卓系统的硬件抽象层,所述编解码器驱动设置于所述安卓系统的内核层,所述编解码器芯片设置于所述安卓系统的硬件层,所述方法包括:
通过所述音频服务模块接收耳机插拔消息,并将所述耳机插拔消息发送给所述音频抽象模块;
通过所述音频抽象模块接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;
通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
上述方法中,电子设备通过音频驱动马达系统在检测到耳机插拔的动作时,重新确定编解码器芯片中DAC通路的配置策略,并根据DAC通路的配置策略重新配置DAC通路,使DAC通路不仅可以传输听筒或者耳机数据,还可以传输马达数据至D类放大器ClassD以驱动马达,实现了音频驱动马达的方案,降低了驱动成本,而且,通过音频驱动马达,有利于提升马达的震动效果的多样性。
结合第一方面,在第一方面的一种可能的实施方式中,所述根据所述耳机插拔消息确定 所述编解码器芯片中的数字模拟转换器DAC通路配置策略,包括:当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
结合第一方面,在第一方面的一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
结合第一方面,在第一方面的一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
结合第一方面,在第一方面的一种可能的实施方式中,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
结合第一方面,在第一方面的一种可能的实施方式中,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
结合第一方面,在第一方面的一种可能的实施方式中,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
结合第一方面,在第一方面的一种可能的实施方式中,所述音频驱动马达系统还包括第一应用程序、马达服务模块、马达抽象模块、马达驱动、马达,以及数字信号处理模块DSP,所述DSP包括共享内存和直接存储器访问DMA,所述第一应用程序与所述马达服务模块通信连接,所述马达服务模块与马达抽象模块、所述音频服务模块通信连接,所述马达抽象模块与马达驱动通信连接,所述马达驱动、所述音频抽象模块与所述DSP通信连接,所述共享内存与所述DMA通信连接,所述DSP与所述编解码器芯片通信连接,所述编译码器芯片与所述马达通信连接,所述第一应用程序设置于所述安卓系统的应用层,所述马达服务模块设置于所述安卓系统的应用架构层,所述马达抽象模块设置于所述安卓系统的硬件抽象层,所述马达驱动、所述DSP设置于所述安卓系统的内核层,所述马达设置于所述安卓系统的硬件层,所述方法还包括:
通过所述马达服务模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
通过所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型发送给所述马达驱动;
通过所述马达驱动接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,将所述目标马达数据通过所述共享内存传递给所述DSP;
通过所述DSP接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据传递给所述编解码器芯片中的所述目标DAC通路;
通过所述编解码器芯片中的所述目标DAC通路接收所述目标马达数据,并按照配置完成的所述目标DAC通路传输所述目标马达数据至所述ClassD以驱动所述马达。
结合第一方面,在第一方面的一种可能的实施方式中,所述电子设备的显示屏处于熄屏 状态,所述将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,所述方法还包括:通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息;通过所述音频抽象模块接收并下发所述马达启动消息,以使马达震动通路开启。
结合第一方面,在第一方面的一种可能的实施方式中,所述通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息之后,所述方法还包括:在第一预设时段内,通过所述音频服务模块接收所述马达震动消息。
结合第一方面,在第一方面的一种可能的实施方式中,所述通过所述音频抽象模块接收并下发所述马达启动消息,以使马达震动通路开启之后,所述方法还包括:在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则向所述音频抽象模块发送马达关闭消息;通过所述音频抽象模块接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
结合第一方面,在第一方面的一种可能的实施方式中,所述通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路,包括:通过所述编解码器驱动接收所述DAC通路配置策略,确定是否有音频输出业务;当检测到音频输出业务时,通过所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
结合第一方面,在第一方面的一种可能的实施方式中,所述耳机插拔消息为所述耳机插入消息,所述按照所述DAC通路配置策略重新配置所述DAC通路之后,所述方法还包括:通过所述编解码器驱动开启传输听筒数据的听筒通路;在第三预设时段后,通过所述马达驱动开启传输马达数据的ClassD通路。
第二方面,本申请提供了一种音频驱动马达的通路配置装置,应用于电子设备,所述电子设备设置有安卓系统,所述电子设备的音频驱动马达系统包括音频服务模块、音频抽象模块、编解码器驱动、编解码器芯片,所述音频服务模块与所述音频抽象模块通信连接,所述音频抽象模块与所述编解码器驱动通信连接,所述编解码器驱动与所述编解码器芯片通信连接,所述音频服务模块设置于所述安卓系统的应用架构层,所述音频抽象模块设置于所述安卓系统的硬件抽象层,所述编解码器驱动设置于所述安卓系统的内核层,所述编解码器芯片设置于所述安卓系统的硬件层,所述音频驱动马达的通路配置包括:
处理模块:用于调用所述音频服务模块通过收发模块接收耳机插拔消息,并通过所述收发模块将所述耳机插拔消息发送给所述音频抽象模块;以及,
调用所述音频抽象模块通过所述收发模块接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略通过所述收发模块发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;
调用所述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
上述装置中,电子设备通过音频驱动马达系统在检测到耳机插拔的动作时,重新确定编解码器芯片中DAC通路的配置策略,并根据DAC通路的配置策略重新配置DAC通路,使DAC通路不仅可以传输听筒或者耳机数据,还可以传输马达数据至D类放大器ClassD以驱动马达,实现了音频驱动马达的方案,降低了驱动成本,而且,通过音频驱动马达,有利于提升马达的震动效果的多样性。
结合第二方面,在第二方面的一种可能的实施方式中,在所述根据所述耳机插拔消息确 定所述编解码器芯片中的数字模拟转换器DAC通路配置策略方面,所述处理模块具体用于:当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
结合第二方面,在第二方面的一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
结合第二方面,在第二方面的一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
结合第二方面,在第二方面的一种可能的实施方式中,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
结合第二方面,在第二方面的一种可能的实施方式中,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
结合第二方面,在第二方面的一种可能的实施方式中,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
结合第二方面,在第二方面的一种可能的实施方式中,所述音频驱动马达系统还包括第一应用程序、马达服务模块、马达抽象模块、马达驱动、马达,以及数字信号处理模块DSP,所述DSP包括共享内存和直接存储器访问DMA,所述第一应用程序与所述马达服务模块通信连接,所述马达服务模块与马达抽象模块、所述音频服务模块通信连接,所述马达抽象模块与马达驱动通信连接,所述马达驱动、所述音频抽象模块与所述DSP通信连接,所述共享内存与所述DMA通信连接,所述DSP与所述编解码器芯片通信连接,所述编译码器芯片与所述马达通信连接,所述第一应用程序设置于所述安卓系统的应用层,所述马达服务模块设置于所述安卓系统的应用架构层,所述马达抽象模块设置于所述安卓系统的硬件抽象层,所述马达驱动、所述DSP设置于所述安卓系统的内核层,所述马达设置于所述安卓系统的硬件层,所述处理模块还用于:
调用所述马达服务模块通过所述收发模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并通过所述收发模块将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
调用所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型通过所述收发模块发送给所述马达驱动;以及,
调用所述马达驱动通过所述收发模块接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,通过所述收发模块将所述目标马达数据通过所述共享内存传递给所述DSP;以及,
调用所述DSP通过所述收发模块接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据通过所述收发模块传递给所述编解码器芯片中的所述目标DAC通路;以及,
调用所述编解码器芯片中的所述目标DAC通路通过所述收发模块接收所述目标马达数 据,并按照配置完成的所述目标DAC通路通过所述收发模块传输所述目标马达数据至所述ClassD以驱动所述马达。
结合第二方面,在第二方面的一种可能的实施方式中,所述电子设备的显示屏处于熄屏状态,所述处理模块通过所述收发模块将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,还用于:调用所述音频服务模块通过所述收发模块接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块向所述音频抽象模块发送马达启动消息;以及,调用所述音频抽象模块通过所述收发模块接收并下发所述马达启动消息,以使马达震动通路开启。
结合第二方面,在第二方面的一种可能的实施方式中,所述处理模块调用所述音频服务模块通过所述收发模块接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块向所述音频抽象模块发送马达启动消息之后,还用于:在第一预设时段内,调用所述音频服务模块通过所述收发模块接收到所述马达震动消息。
结合第二方面,在第二方面的一种可能的实施方式中,所述处理模块调用所述音频抽象模块通过所述收发模块接收并下发所述马达启动消息,以使马达震动通路开启之后,还用于:在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则调用所述音频服务模块通过所述收发模块向所述音频抽象模块发送马达关闭消息;以及,调用所述音频抽象模块通过所述收发模块接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
结合第二方面,在第二方面的一种可能的实施方式中,在所述调用所述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路方面,所述处理模块用于:调用所述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,确定是否有音频输出业务;以及,当检测到音频输出业务时,调用所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
结合第二方面,在第二方面的一种可能的实施方式中,所述耳机插拔消息为所述耳机插入消息,所述处理模块按照所述DAC通路配置策略重新配置所述DAC通路之后,还用于:调用所述编解码器驱动开启传输听筒数据的听筒通路;在第三预设时段后,调用所述马达驱动开启传输马达数据的ClassD通路。
第三方面,本申请提供了一种电子设备,所述电子设备包括处理器和存储器,所述存储器用于存储程序代码,所述处理器用于调用所述存储器中的程序代码执行第一方面任一项所述的方法。
第四方面,本申请提供了一种电子设备,所述电子设备包括处理器;所述处理器与存储器耦合,所述处理器用于调用所述存储器中的程序代码执行第一方面任一项所述的方法。
第五方面,本申请提供了一种可读存储介质,所述可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行第一方面任一项所述的方法。
第六方面,本申请提供了一种计算机程序产品,所述计算机程序产品在电子设备上运行时,使得所述电子设备执行第一方面任一项所述的方法。
附图说明
图1为本申请实施例提供的一种音频驱动马达系统的示意图;
图2为本申请实施例提供的一种音频驱动马达系统的信号流示意图;
图3为本申请实施例提供的一种音频驱动马达的通路配置方法的示意图;
图4为本申请实施例提供的一种音频数字模拟转换器DAC通路的硬件电路示意图;
图5为本申请实施例提供的另一种音频驱动马达的通路配置方法的示意图;
图6为本申请实施例提供的一种音频驱动马达的通路配置装置的示意图;
图7为本申请实施例提供的一种电子设备的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
为了便于理解本申请,首先对本申请涉及的概念进行解释:
D类放大器(ClassD),是通过控制开关单元的开和关,驱动扬声器的放大器。
线性马达,一般指线性电机,直线电机是一种将电能直接转换成直线运动机械能,而不需要任何中间转换机构的传动装置。它可以看成是一台旋转电机按径向剖开,并展成平面而成。
数字模拟转换器(digital-to-analog converter,DAC),是指将离散的数字信号转换为连续变量的模拟信号的器件。
编解码器(codec),指的是一个能够对一个信号或者一个数据流进行变换的设备或者程序。这里指的变换包括将信号或者数据流进行编码(通常是为了传输、存储或者加密)或者提取得到一个编码流的操作。
本申请实施例提供一种音频驱动马达的通路配置方法及设备,下面先对本申请实施例所适配的音频驱动马达系统进行详细说明。
请参见图1,图1为本申请实施例提供的一种音频驱动马达系统,所示系统包括第一应用程序101、马达服务模块111、音频服务模块112、马达抽象模块121、音频抽象模块122、数字信号处理模块(digital signal processing,DSP)130(所述DSP130包括共享内存133和直接存储器访问(direct memory access,DMA)134)、马达驱动131、编解码器驱动132、编解码器芯片141,以及马达142,其中,所述第一应用程序101与所述马达服务模块111通信连接,所述马达服务模块111与马达抽象模块121、音频服务模块112通信连接,所述马达抽象模块121与马达驱动131通信连接,所述音频服务模块112与所述音频抽象模块122通信连接,所述音频抽象模块122与所述编解码器驱动132、所述DSP130通信连接,所述编解码器驱动132与所述编解码器芯片141通信连接,所述马达驱动131与所述DSP130通信连接,所述共享内存133与所述DMA134通信连接,所述DSP130与所述编译码器芯片141通信连接,所述编译码器芯片141与所述马达142通信连接,所述第一应用程序101设置于所述安卓系统的应用层,所述马达服务模块111和所述音频服务模块112设置于所述安卓系统的应用架构层,所述马达抽象模块121和所述音频抽象模块122设置于所述安卓系统的硬件抽象层,所述DSP130、所述马达驱动131和所述编解码器驱动132设置于所述安卓系统的内核层,所述编解码器芯片141和所述马达142设置于所述安卓系统的硬件层。
具体的,音频驱动马达系统中各个模块的信号流如图2所示,所述第一应用程序101用于向所述马达服务模块111发送马达震动指令,所述马达服务模块111用于接收来自所述第一应用程序101的马达震动指令,将所述马达震动指令转化为马达震动消息,并将所述马达震动消息发送给所述马达抽象模块121和所述音频服务模块112;所述马达抽象模块121用于解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型发送给所述马达驱动131;所述马达驱动131用于接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,将所述目标马达数据通过所述共享内存133传递给所述DSP130 和/或DMA134,所述马达驱动131还用于控制编解码器芯片141上的D类放大器ClassD模块打开,以及用于控制电源,以及用于控制马达数据搬运策略,该搬运策略可以包括DSP通道选择策略,搬运开始时间、搬运结束时间等;其中,在DSP模块上还包括额外开发的马达模块,用于通过马达数据搬运策略控制DMA对目标马达数据的搬运;所述音频服务模块112用于接收耳机插拔的广播消息,并将所述耳机插拔消息和所述马达震动消息发送给所述音频抽象模块122;所述音频抽象模块122用于接收所述耳机插拔消息并进行消息的分发,根据所述耳机插拔消息确定所述编解码器芯片141中数字模拟转换器DAC通路配置策略,所述音频抽象模块122还用于接收所述马达震动消息和显示屏状态,并根据显示屏状态确定是否要下发马达开启消息或者马达关闭消息,以及在需要下发马达开启消息时,根据所述马达震动消息下发马达启动消息,用于开启马达震动通路,所述音频抽象模块122还将目标马达数据的目标DAC通路发送给DSP中的马达模块,以及将所述DAC通路配置策略发送给所述编解码器驱动132,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达,所述编解码器驱动132接收所述DAC通路配置策略,并通过马达控件和音频控件控制所述编解码器芯片141按照所述DAC通路配置策略配置所述DAC通路,所述DMA134用于将所述目标马达数据传递给所述编解码器芯片141的所述目标DAC通路;所述编解码器芯片141用于接收所述目标马达数据,并按照配置完成的所述目标DAC通路传输所述目标马达数据至所述ClassD以驱动所述马达142。
具体的,电子设备需要对音频驱动马达系统中的ClassD进行校准,可以采用加速度的校准方法,例如,通过播放不同频率的音源来看最大的Z向加速度值来判断他的谐振频率的方法进行校准。
另外,由于电子设备开机需要马达振动体验,需要在快速启动fastboot阶段支持马达操作,即在fastboot阶段能够启动X轴马达振动,马达驱动需要在fastboot阶段支持对马达微型电子器件IC模块的配置,开机震动采用裸写寄存器方式实现,在fastboot阶段,由于DMA没有启动,需要将马达波形直接写入寄存器(first input first output,FIFO)中,并配置裸写编译码器芯片的寄存器,配置马达震动。
需要说明的是,本申请实施例中的术语“系统”和“网络”可被互换使用。“多个”是指两个或两个以上,鉴于此,本申请实施例中也可以将“多个”理解为“至少两个”。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。
参见图3,图3为本申请实施例提供的一种音频驱动马达的通路配置方法的示意图。以图1所示的系统为例,如图3所示,在该系统上执行的音频驱动马达的通路配置方法包括:
S201、电子设备通过所述音频服务模块接收耳机插拔消息,并将所述耳机插拔消息发送给所述音频抽象模块;
其中,所述耳机插拔消息包括耳机插入消息和耳机拔出消息,所述耳机插拔消息为所述音频服务模块通过广播接收到消息。
S202、所述电子设备通过所述音频抽象模块接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;
其中,所述DAC通路包括至少三个通路,举例而言,当DAC通路包括三个通路,分别 可以是DAC左DAC L通路、DAC右DAC R通路、DAC超声DAC UL通路,具体的,DAC L通路可以用来传输听筒数据或耳机左声道数据,DAC右DAC R通路可以用来传输听筒数据或耳机右声道数据,DAC超声DAC UL通路可以用来传输超声数据,所述超声数据可以用于防误触检测等。
在一种可能的实施方式中,所述根据所述耳机插拔消息确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略,包括:
当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;
当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
其中,第一DAC通路配置策略与第二DAC通路配置策略不同,第一DAC通路配置策略和第二DAC通路配置策略可以是多种多样的,且在第一DAC通路配置策略和第二DAC通路配置策略中均包括传输马达数据的DAC通路配置策略,在此不做限定。
在本实施方式中,电子设备通过耳机插拔消息的不同,确定不同的DAC通路配置策略,有利于时隙DAC通路配置的合理性和多样性,进而实现音频驱动马达。
在这种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
具体的,DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据的通路配置如图4所示,或者也可以使用DAC左DAC L通路传输马达数据、DAC右DAC R通路传输听筒数据,在此不做赘述。
可见,在本实施方式中,在听筒模式下,由于听筒本身是单声道音源,因此,仅需要一个DAC通路,故而,通过另一个通路传输马达数据以实现音频驱动马达的效果,有利于降低马达驱动成本,提升硬件的利用率。
在一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
在一种可能的实施方式中,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
其中,由于DAC超声通路DAC UL传输马达数据,使没有多余的通路传输超声数据,在该种实施方式中可以通过其他的方案实现超声的防误触功能,例如,通过光学检测或者影像检测等方案实现电子设备的防误触功能,在此不做限定。
可见,在上述两种实施方式中,将可以用其他方案代替的超声通道功能,改用为传输马达数据驱动马达的功能,用其他方案实现超声通道功能,在降低马达驱动成本的同时,避免了电子设备功能的下降,提升了音频驱动马达的灵活性。
在一种可能的实施方式中,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
其中,对DAC UL通路进行复用,不仅用于传输超声数据,还用于传输马达数据,在复用DAC UL通路的情况下,可以通过设置马达数据和超声数据的优先级,例如,设置马达数据的优先级高于超声数据的优先级,或者可以设置超声数据的优先级高于马达数据的优先级, 在此不做限定。
可见,在本实施方式中,通过设置不同的优先级实现超声数据和马达数据对DAC UL通路的复用,有利于在实现音频驱动马达的情况下,提升DAC的利用率。
S203、所述电子设备通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
其中,所述电子设备在通过所述编解码器驱动接收所述DAC通路配置策略之后,先关闭所有音频通道,之后再控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路,可以有效避免配置过程中的POP音。
其中,在关闭音频通路,按照所述DAC通路配置策略重新配置所述DAC通路时,可以优先检测是否有马达震动消息,若没有震动消息,可以按照一般的配置策略进行配置,若有马达震动消息,由于马达要求在30ms内需要震动,否则在连续震动如输入法打字的时候会有震动丢失;为防止震动丢失,需要优化通路配置,即优化马达通路配置时间,在通路配置过程中,可以将通路无关的扬声器的初始化配置等放在马达通路配置之后,这样马达通路提前建立,可以优化马达震动时间。
在一种可能的实施方式中,所述通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路,包括:
通过所述编解码器驱动接收所述DAC通路配置策略,确定是否有音频输出业务;
当检测到音频输出业务时,通过所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
具体的,在获取到耳机插拔消息之后,确定了DAC通路配置策略时,如果没有音频输出业务,可以不立即重新配置DAC通路,而是,当检测到音频输出业务时,才重新配置DAC通路,例如,当耳机插拔消息为耳机插入消息时,这个时候并没有音频输出业务,那么先不立即重新配置DAC通路,也就是说如果这个是有音频,还是通过听筒输出音频,当检测到有音频业务输出时,再重新配置通路,使音频从耳机输出。
可见,在本实施方式中,在获取耳机插拔消息,确定了DAC通路配置策略之后,不立即配置DAC通路,而是在检测到有音频输出时,才重新配置DAC通路,有利于降低资源占用,提升通路配置的必要性。
上述方法中,电子设备通过音频驱动马达系统在检测到耳机插拔的动作时,重新确定编解码器芯片中DAC通路的配置策略,并根据DAC通路的配置策略重新配置DAC通路,使DAC通路不仅可以传输听筒或者耳机数据,还可以传输马达数据至D类放大器ClassD以驱动马达,实现了音频驱动马达的方案,降低了驱动成本,而且,通过音频驱动马达,有利于提升马达的震动效果的多样性。
在一种可能的实施方式中,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
其中,在亮屏状态下,将马达通路常开,在有马达震动需求和无马达震动需求的时候只控制功耗较大的ClassD模块的开和关,在正常使用的情况下就不会存在震动丢失,而且降低功耗,另外,在熄屏状态下,进行通路关闭,在有马达震动需求的时候开启通路,同时,由熄屏状态到亮屏状态转变的过程中马达震动事件较少,因此,该种方法可以有效降低马达震动的丢失。
其中,在亮屏状态下,由于马达通路处于常开状态,音频抽象模块则根据显示屏状态不下发马达开启消息或者马达关闭消息。
可见,在本实施方式中,在亮屏状态下,常开马达震动通路,在熄屏状态下,关闭马达震动通路,并且,按需开启,有利于降低马达震动的丢失,同时降低电子设备的功耗。
在一种可能的实施方式中,所述方法还包括:
通过所述马达服务模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
通过所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型发送给所述马达驱动;
通过所述马达驱动接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,将所述目标马达数据通过所述共享内存传递给所述DSP;
通过所述DSP接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据传递给所述编解码器芯片中的所述目标DAC通路;
通过所述编解码器芯片中的所述目标DAC通路接收所述目标马达数据,并按照配置完成的所述目标DAC通路传输所述目标马达数据至所述ClassD以驱动所述马达。
其中,马达抽象模块收到马达服务模块发送的马达震动消息之后,解析马达震动消息,并通过系统EMUI11开始的可扩展性标记语言(extensible markup language,XML)进行对应,确定马达震动的震动类型。
其中,所述马达震动类型可以包括特效类、音随类,以及谷歌长震类等,在此不做限定,其中,特效类直接下发马达震动消息,音随类对马达震动消息进行循环消息下发,谷歌长震类进行总时间连续的下发马达震动消息。
其中,所述马达服务模块将马达震动消息发送给音频服务模块,用于音频服务模块通知音频抽象模块开启马达震动通路。
其中,马达驱动存储马达震动波形,在马达震动的时候,将特效数据通过共享内存的方式传输给DMA,以及搬运到DSP中。另外在震动的时候需要搬移数据,同时需要打开ClassD模块。
具体的,马达的特效波形采用1k的采样率,一个特效20ms,约40个字节,最少6个特效,大概240个字节数据。
其中,目标DAC通路可以是DAC L通路,或者DAC R通路,或者DAC UL通路。
具体的,在该实施方式执行的过程中,音频服务模块可能同步接收到耳机插拔消息,也就是本实施方式与上述S201、S202,以及S203可以并行同步执行。
可见,在本实施方式中,电子设备通过音频驱动马达系统,通过各层级之间的数据传输,实现了音频驱动马达,同时可以提升马达震动特效的丰富性。
在一种可能的实施方式中,所述电子设备的显示屏处于熄屏状态,所述将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,所述方法还包括:
通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息;
通过所述音频抽象模块接收并下发所述马达启动消息,以使马达震动通路开启。
可见,在本实施方式中,在电子设备的显示屏处于熄屏状态下,使音频服务模块与马达服务模块通信连接,音频服务模块可以接收马达服务模块发送的马达震动消息,使音频驱动 马达的马达震动通路可以按需开启,有利于降低电子设备的功耗,提升马达驱动的便捷性。
在一种可能的实施方式中,所述通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息之后,所述方法还包括:
在第一预设时段内,通过所述音频服务模块接收所述马达震动消息。
其中,所述第一预设时段,例如可以是3s、4s等,在此不做限定。
具体的,在通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息之后,在第一预设时段内,再次通过所述音频服务模块接收到所述马达震动消息,则不下发马达启动消息。
其中,可以通过音频抽象模块的setParameter接口实现马达启动消息和马达关闭消息的消息分发,具体的,消息下发时马达启动消息和马达关闭消息的关键字分别为vibrator_state=on或vibrator_state=off。
具体的,音频驱动接收到音频抽象模块传输下来的音频路由audio route配置命令,根据路由地图route map建立马达震动通路,与马达驱动约定马达数据采样率为96k,左声道SRC2的48k*2模块要关闭。
可见,在本实施方式中,在第一预设时段内,多次接收到马达震动消息时,只下发一次马达启动消息,避免多次发送马达启动消息使马达通路频繁切换带来的负面影响,同时降低电子设备功耗。
在一种可能的实施方式中,所述通过所述音频抽象模块接收并下发所述马达启动消息,并以使马达震动通路开启之后,所述方法还包括:
在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则向所述音频抽象模块发送马达关闭消息;
通过所述音频抽象模块接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
其中,所述第二预设时段可以和第一预设时段相同,也可以与第一预设时段不同,在此不做限定。
具体的,在第二预设时段内,若没有再次接收到马达开启消息,则通下发马达关闭消息,使马达通路关闭。
可见,在本实施方式中,在第二预设时段内,没有接收到马达震动消息,则下发马达关闭消息,以关闭马达通路,有利于降低电子设备功耗。
在一种可能的实施方式中,所述耳机插拔消息为所述耳机插入消息,所述按照所述DAC通路配置策略重新配置所述DAC通路之后,所述方法还包括:
通过所述编解码器驱动开启传输听筒数据的听筒通路;
在第三预设时段后,通过所述马达驱动开启传输马达数据的ClassD通路。
其中,所述第三预设时段例如可以是20ms、25ms等,在此不做限定。
可见,在本实施方式中,在耳机插入之后,先开启听筒通路,然后,再第三预设时段后,再开启ClassD通路,有利于避免音频数据流没有释放完全导致耳机中出现POP音。
参见图5,图5为本申请实施例提供的另一种音频驱动马达的通路配置方法的示意图。以图1所示的系统为例,如图5所示,在该系统上执行的音频驱动马达的通路配置方法包括:
S301、电子设备通过马达服务模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并将所述马达震动消息发送给马达抽象模块和音频服务模块。
S302、所述电子设备通过所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型发送给马达驱动。
S303、所述电子设备通过所述马达驱动接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,将所述目标马达数据通过共享内存传递给DSP。
S304、所述电子设备通过所述音频服务模块接收耳机插拔消息,并将所述耳机插拔消息发送给音频抽象模块。
S305、所述电子设备通过所述音频抽象模块接收所述耳机插拔消息,根据所述耳机插拔消息确定编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略发送给编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达。
S306、所述电子设备通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
S307、所述电子设备通过所述DSP接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制DMA将所述目标马达数据传递给所述编解码器芯片中的所述目标DAC通路。
S308、所述电子设备通过所述编解码器芯片中的所述目标DAC通路接收所述目标马达数据,并按照配置完成的所述目标DAC通路传输所述目标马达数据至ClassD以驱动马达。
上述方法中,电子设备通过音频驱动马达系统在检测到耳机插拔的动作时,重新确定编解码器芯片中DAC通路的配置策略,并根据DAC通路的配置策略重新配置DAC通路,使DAC通路不仅可以传输听筒或者耳机数据,还可以传输马达数据至D类放大器ClassD以驱动马达,实现了音频驱动马达的方案,降低了驱动成本,而且,通过音频驱动马达,有利于提升马达的震动效果的多样性。
参见图6,图6为本申请实施例提供的一种音频驱动马达的通路配置装置的示意图,所述音频驱动马达的通路配置应用于电子设备,所述电子设备设置有安卓系统,所述电子设备的音频驱动马达系统包括音频服务模块、音频抽象模块、编解码器驱动、编解码器芯片,所述音频服务模块与所述音频抽象模块通信连接,所述音频抽象模块与所述编解码器驱动通信连接,所述编解码器驱动与所述编解码器芯片通信连接,所述音频服务模块设置于所述安卓系统的应用架构层,所述音频抽象模块设置于所述安卓系统的硬件抽象层,所述编解码器驱动设置于所述安卓系统的内核层,所述编解码器芯片设置于所述安卓系统的硬件层,所述音频驱动马达的通路配置装置400包括:处理模块401和收发模块402。
所述处理模块401:用于调用所述音频服务模块通过收发模块402接收耳机插拔消息,并通过所述收发模块402将所述耳机插拔消息发送给所述音频抽象模块;以及,
调用所述音频抽象模块通过所述收发模块402接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略通过所述收发模块402发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;以及,
调用所述编解码器驱动通过所述收发模块402接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
本申请实施例中,第一设备根据发送的协作请求信息和接收的协作响应信息从多个候选设备中确定协作的第二设备,并向第二设备发送协作确认信息,在交互过程中第一设备或者 第二设备可以确定两种之间的物理下行控制信道PDCCH搜索空间集合的时域配置信息,当在物理下行控制信道PDCCH搜索空间集合的时域配置信息满足条件时进行协作传输,有利于减少协作传输时延。
在一种可能的实施方式中,在所述根据所述耳机插拔消息确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略方面,所述处理模块401具体用于:当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
在一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
在一种可能的实施方式中,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
在一种可能的实施方式中,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
在一种可能的实施方式中,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
在一种可能的实施方式中,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
在一种可能的实施方式中,所述音频驱动马达系统还包括第一应用程序、马达服务模块、马达抽象模块、马达驱动、马达,以及数字信号处理模块DSP,所述DSP包括共享内存和直接存储器访问DMA,所述第一应用程序与所述马达服务模块通信连接,所述马达服务模块与马达抽象模块、所述音频服务模块通信连接,所述马达抽象模块与马达驱动通信连接,所述马达驱动、所述音频抽象模块与所述DSP通信连接,所述共享内存与所述DMA通信连接,所述DSP与所述编解码器芯片通信连接,所述编译码器芯片与所述马达通信连接,所述第一应用程序设置于所述安卓系统的应用层,所述马达服务模块设置于所述安卓系统的应用架构层,所述马达抽象模块设置于所述安卓系统的硬件抽象层,所述马达驱动、所述DSP设置于所述安卓系统的内核层,所述马达设置于所述安卓系统的硬件层,所述处理模块401还用于:
调用所述马达服务模块通过所述收发模块402接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并通过所述收发模块402将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
调用所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型通过所述收发模块402发送给所述马达驱动;以及,
调用所述马达驱动通过所述收发模块402接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,通过所述收发模块402将所述目标马达数据通过所述共享内存传递给所述DSP;以及,
调用所述DSP通过所述收发模块402接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据通过所述收发模块402传递 给所述编解码器芯片中的所述目标DAC通路;以及,
调用所述编解码器芯片中的所述目标DAC通路通过所述收发模块402接收所述目标马达数据,并按照配置完成的所述目标DAC通路通过所述收发模块402传输所述目标马达数据至所述ClassD以驱动所述马达。
在一种可能的实施方式中,所述电子设备的显示屏处于熄屏状态,所述处理模块401通过所述收发模块402将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,还用于:
调用所述音频服务模块通过所述收发模块402接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块402向所述音频抽象模块发送马达启动消息;以及,
调用所述音频抽象模块通过所述收发模块402接收并下发所述马达启动消息,以使马达震动通路开启。
在一种可能的实施方式中,所述处理模块401调用所述音频服务模块通过所述收发模块402接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块402向所述音频抽象模块发送马达启动消息之后,还用于:在第一预设时段内,调用所述音频服务模块通过所述收发模块402接收到所述马达震动消息。
在一种可能的实施方式中,所述处理模块401调用所述音频抽象模块通过所述收发模块402接收并下发所述马达启动消息,以使马达震动通路开启之后,还用于:在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则调用所述音频服务模块通过所述收发模块402向所述音频抽象模块发送马达关闭消息;以及,
调用所述音频抽象模块通过所述收发模块402接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
在一种可能的实施方式中,在所述调用所述编解码器驱动通过所述收发模块402接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路方面,所述处理模块401用于:调用所述编解码器驱动通过所述收发模块402接收所述DAC通路配置策略,确定是否有音频输出业务;以及,当检测到音频输出业务时,调用所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
在一种可能的实施方式中,所述耳机插拔消息为所述耳机插入消息,所述处理模块401按照所述DAC通路配置策略重新配置所述DAC通路之后,还用于:调用所述编解码器驱动开启传输听筒数据的听筒通路;在第三预设时段后,调用所述马达驱动开启传输马达数据的ClassD通路。
可以理解,本实现方式中图6所示的音频驱动马达的通路配置装置应用于本申请实施例的音频驱动马达的通路配置方法中的电子设备,并且可以实现本申请实施例的音频驱动马达的通路配置方法的相应流程,为了简洁,在此不再赘述。
参见图7,图7为本申请实施例提供的一种电子设备500的示意图。如图7所示,该电子设备500包括:处理器510、通信接口520以及存储器530,所述处理器510、通信接口520以及存储器530通过内部总线540相互连接。
所述处理器510可以由一个或者多个通用处理器构成,例如中央处理器(central processing unit,CPU),或者CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC)、可编程逻辑器件(programmable logic device,PLD) 或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。
总线540可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线540可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条线表示,但不表示仅有一根总线或一种类型的总线。
存储器530可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM);存储器530也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM)、快闪存储器(flash memory)、硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器530还可以包括上述种类的组合。存储器530可用于存储程序和数据,以便于处理器510调用存储器530中存储的程序代码和数据以实现上述处理模块401的功能。
可以理解,图7所示的电子设备可对应于本申请实施例的音频驱动马达的通路配置方法中的电子设备,并且可以实现本申请实施例的音频驱动马达的通路配置方法的相应流程,为了简洁,在此不再赘述。
申请实施例还提供一种可读存储介质,该可读存储介质中存储有指令,当该指令在电子设备上运行时,使得该电子设备执行上述方法实施例中相关的流程。
本申请实施例还提供一种计算机程序产品,该计算机程序产品在电子设备上运行时,使得该电子设备执行上述方法实施例中相关的流程。
在上述实施例中,对各个实施例的描述各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
应理解,本文中涉及的第一、第二、第三、第四以及各种数字编号仅为描述方便进行的区分,并不用来限制本申请的范围。
还应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (28)

  1. 一种音频驱动马达的通路配置方法,其特征在于,应用于电子设备,所述电子设备设置有安卓系统,所述电子设备的音频驱动马达系统包括音频服务模块、音频抽象模块、编解码器驱动、编解码器芯片,所述音频服务模块与所述音频抽象模块通信连接,所述音频抽象模块与所述编解码器驱动通信连接,所述编解码器驱动与所述编解码器芯片通信连接,所述音频服务模块设置于所述安卓系统的应用架构层,所述音频抽象模块设置于所述安卓系统的硬件抽象层,所述编解码器驱动设置于所述安卓系统的内核层,所述编解码器芯片设置于所述安卓系统的硬件层,所述方法包括:
    通过所述音频服务模块接收耳机插拔消息,并将所述耳机插拔消息发送给所述音频抽象模块;
    通过所述音频抽象模块接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;
    通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述耳机插拔消息确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略,包括:
    当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;
    当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
  3. 根据权利要求2所述的方法,其特征在于,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
  4. 根据权利要求2所述的方法,其特征在于,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
  5. 根据权利要求2所述的方法,其特征在于,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
  6. 根据权利要求4或5所述的方法,其特征在于,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述音频驱动马达系统还包括第一应用程序、马达服务模块、马达抽象模块、马达驱动、马达,以及数字信号处理模块DSP,所述DSP包括共享内存和直接存储器访问DMA,所述第一应用程序与所述马达服务模块通 信连接,所述马达服务模块与马达抽象模块、所述音频服务模块通信连接,所述马达抽象模块与马达驱动通信连接,所述马达驱动、所述音频抽象模块与所述DSP通信连接,所述共享内存与所述DMA通信连接,所述DSP与所述编解码器芯片通信连接,所述编译码器芯片与所述马达通信连接,所述第一应用程序设置于所述安卓系统的应用层,所述马达服务模块设置于所述安卓系统的应用架构层,所述马达抽象模块设置于所述安卓系统的硬件抽象层,所述马达驱动、所述DSP设置于所述安卓系统的内核层,所述马达设置于所述安卓系统的硬件层,所述方法还包括:
    通过所述马达服务模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
    通过所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型发送给所述马达驱动;
    通过所述马达驱动接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,将所述目标马达数据通过所述共享内存传递给所述DSP;
    通过所述DSP接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据传递给所述编解码器芯片中的所述目标DAC通路;
    通过所述编解码器芯片中的所述目标DAC通路接收所述目标马达数据,并按照配置完成的所述目标DAC通路传输所述目标马达数据至所述ClassD以驱动所述马达。
  9. 根据权利要求7或8所述的方法,其特征在于,所述电子设备的显示屏处于熄屏状态,所述将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,所述方法还包括:
    通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息;
    通过所述音频抽象模块接收并下发所述马达启动消息,以使马达震动通路开启。
  10. 根据权利要求9所述的方法,其特征在于,所述通过所述音频服务模块接收所述马达震动消息,并根据所述马达震动消息向所述音频抽象模块发送马达启动消息之后,所述方法还包括:
    在第一预设时段内,通过所述音频服务模块接收所述马达震动消息。
  11. 根据权利要求9所述的方法,其特征在于,所述通过所述音频抽象模块接收并下发所述马达启动消息,以使马达震动通路开启之后,所述方法还包括:
    在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则向所述音频抽象模块发送马达关闭消息;
    通过所述音频抽象模块接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述通过所述编解码器驱动接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路,包括:
    通过所述编解码器驱动接收所述DAC通路配置策略,确定是否有音频输出业务;
    当检测到音频输出业务时,通过所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
  13. 根据权利要求1-12任一项所述的方法,其特征在于,所述耳机插拔消息为所述耳机插入消息,所述按照所述DAC通路配置策略重新配置所述DAC通路之后,所述方法还包括:
    通过所述编解码器驱动开启传输听筒数据的听筒通路;
    在第三预设时段后,通过所述马达驱动开启传输马达数据的ClassD通路。
  14. 一种音频驱动马达的通路配置装置,其特征在于,应用于电子设备,所述电子设备设置有安卓系统,所述电子设备的音频驱动马达系统包括音频服务模块、音频抽象模块、编解码器驱动、编解码器芯片,所述音频服务模块与所述音频抽象模块通信连接,所述音频抽象模块与所述编解码器驱动通信连接,所述编解码器驱动与所述编解码器芯片通信连接,所述音频服务模块设置于所述安卓系统的应用架构层,所述音频抽象模块设置于所述安卓系统的硬件抽象层,所述编解码器驱动设置于所述安卓系统的内核层,所述编解码器芯片设置于所述安卓系统的硬件层,所述音频驱动马达的通路配置包括:
    处理模块:用于调用所述音频服务模块通过收发模块接收耳机插拔消息,并通过所述收发模块将所述耳机插拔消息发送给所述音频抽象模块;以及,
    调用所述音频抽象模块通过所述收发模块接收所述耳机插拔消息,根据所述耳机插拔消息确定所述编解码器芯片中数字模拟转换器DAC通路配置策略,并将所述DAC通路配置策略通过所述收发模块发送给所述编解码器驱动,所述DAC通路用于传输听筒或耳机数据,以及传输马达数据至D类放大器ClassD以驱动马达;
    调用所述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
  15. 根据权利要求14所述的装置,其特征在于,在所述根据所述耳机插拔消息确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略方面,所述处理模块具体用于:当所述耳机插拔消息为耳机拔出消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第一DAC通路配置策略;当所述耳机插拔消息为耳机插入消息时,确定所述编解码器芯片中的数字模拟转换器DAC通路配置策略为第二DAC通路配置策略。
  16. 根据权利要求15所述的装置,其特征在于,所述第一DAC通路配置策略包括:DAC左DAC L通路传输听筒数据、DAC右DAC R通路传输马达数据,以及DAC超声DAC UL通路传输超声数据;或,DAC L通路传输马达数据、DAC R通路传输听筒数据,以及DAC UL通路传输超声数据。
  17. 根据权利要求15所述的装置,其特征在于,所述第一DAC通路配置策略包括:DAC左通路DAC L和/或DAC右通路DAC R传输听筒数据,DAC超声通路DAC UL传输马达数据。
  18. 根据权利要求15所述的装置,其特征在于,所述第二DAC通路配置策略包括:DAC左通路DAC L传输第一耳机数据、DAC右通路DAC R传输第二耳机数据,DAC超声通路DAC UL传输马达数据。
  19. 根据权利要求17或18所述的装置,其特征在于,所述DAC UL通路还传输超声数据,所述马达数据的优先级与所述超声数据的优先级不同。
  20. 根据权利要求14-19任一项所述的装置,其特征在于,当所述电子设备的显示屏处于亮屏状态时,传输马达数据的马达震动通路处于连通状态;当所述电子设备的显示屏处于熄屏状态时,所述马达震动通路处于断开状态,所述马达震动通路包括传输马达数据的DAC通路。
  21. 根据权利要求14-20任一项所述的装置,其特征在于,所述音频驱动马达系统还包括第一应用程序、马达服务模块、马达抽象模块、马达驱动、马达,以及数字信号处理模块DSP,所述DSP包括共享内存和直接存储器访问DMA,所述第一应用程序与所述马达服务模块通 信连接,所述马达服务模块与马达抽象模块、所述音频服务模块通信连接,所述马达抽象模块与马达驱动通信连接,所述马达驱动、所述音频抽象模块与所述DSP通信连接,所述共享内存与所述DMA通信连接,所述DSP与所述编解码器芯片通信连接,所述编译码器芯片与所述马达通信连接,所述第一应用程序设置于所述安卓系统的应用层,所述马达服务模块设置于所述安卓系统的应用架构层,所述马达抽象模块设置于所述安卓系统的硬件抽象层,所述马达驱动、所述DSP设置于所述安卓系统的内核层,所述马达设置于所述安卓系统的硬件层,所述处理模块还用于:
    调用所述马达服务模块通过所述收发模块接收来自所述第一应用程序的马达震动指令,将所述马达震动指令转化为马达震动消息,并通过所述收发模块将所述马达震动消息发送给马达抽象模块和所述音频服务模块;
    调用所述马达抽象模块解析所述马达震动消息,确定所述马达震动消息对应的马达震动类型,将所述马达震动类型通过所述收发模块发送给所述马达驱动;以及,
    调用所述马达驱动通过所述收发模块接收所述马达震动类型,根据所述马达震动类型确定目标马达数据,通过所述收发模块将所述目标马达数据通过所述共享内存传递给所述DSP;以及,
    调用所述DSP通过所述收发模块接收来自音频抽象模块发送的传输马达数据的目标DAC通路,并通过所述DSP控制所述DMA将所述目标马达数据通过所述收发模块传递给所述编解码器芯片中的所述目标DAC通路;以及,
    调用所述编解码器芯片中的所述目标DAC通路通过所述收发模块接收所述目标马达数据,并按照配置完成的所述目标DAC通路通过所述收发模块传输所述目标马达数据至所述ClassD以驱动所述马达。
  22. 根据权利要求20或21所述的装置,其特征在于,所述电子设备的显示屏处于熄屏状态,所述处理模块通过所述收发模块将所述马达震动消息发送给马达抽象模块和所述音频服务模块之后,还用于:
    调用所述音频服务模块通过所述收发模块接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块向所述音频抽象模块发送马达启动消息;以及,
    调用所述音频抽象模块通过所述收发模块接收并下发所述马达启动消息,以使马达震动通路开启。
  23. 根据权利要求22所述的装置,其特征在于,所述处理模块调用所述音频服务模块通过所述收发模块接收所述马达震动消息,并根据所述马达震动消息通过所述收发模块向所述音频抽象模块发送马达启动消息之后,还用于:在第一预设时段内,调用所述音频服务模块通过所述收发模块接收到所述马达震动消息。
  24. 根据权利要求22所述的装置,其特征在于,所述处理模块调用所述音频抽象模块通过所述收发模块接收并下发所述马达启动消息,以使马达震动通路开启之后,还用于:在第二预设时段内,若所述音频服务模块未接收到所述马达震动消息,则调用所述音频服务模块通过所述收发模块向所述音频抽象模块发送马达关闭消息;以及,
    调用所述音频抽象模块通过所述收发模块接收并下发所述马达关闭消息,以使所述马达震动通路关闭。
  25. 根据权利要求14-24任一项所述的装置,其特征在于,在所述调用所述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,并通过所述编解码器驱动控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路方面,所述处理模块用于:调用所 述编解码器驱动通过所述收发模块接收所述DAC通路配置策略,确定是否有音频输出业务;以及,当检测到音频输出业务时,调用所述编解码器驱动关闭音频通路,控制所述编解码器芯片按照所述DAC通路配置策略重新配置所述DAC通路。
  26. 根据权利要求14-25任一项所述的装置,其特征在于,所述耳机插拔消息为所述耳机插入消息,所述处理模块按照所述DAC通路配置策略重新配置所述DAC通路之后,还用于:调用所述编解码器驱动开启传输听筒数据的听筒通路;在第三预设时段后,调用所述马达驱动开启传输马达数据的ClassD通路。
  27. 一种电子设备,其特征在于,所述电子设备包括存储器和处理器,所述处理器执行所述存储器存储的计算机指令,使得所述电子设备执行权利要求1-13任一项所述的方法。
  28. 一种可读存储介质,其特征在于,所述可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行权利要求1-13任一项所述的方法。
PCT/CN2021/112366 2020-08-31 2021-08-12 音频驱动马达的通路配置方法及设备 WO2022042327A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/042,942 US20230319477A1 (en) 2020-08-31 2021-08-12 Channel configuration method of driving motor by using audio and device
EP21860166.4A EP4195637A4 (en) 2020-08-31 2021-08-12 CHANNEL CONFIGURATION METHOD AND APPARATUS FOR AN AUDIO DRIVE MOTOR

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010902838.5 2020-08-31
CN202010902838.5A CN114125131B (zh) 2020-08-31 2020-08-31 音频驱动马达的通路配置方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022042327A1 true WO2022042327A1 (zh) 2022-03-03

Family

ID=80354563

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/112366 WO2022042327A1 (zh) 2020-08-31 2021-08-12 音频驱动马达的通路配置方法及设备

Country Status (4)

Country Link
US (1) US20230319477A1 (zh)
EP (1) EP4195637A4 (zh)
CN (1) CN114125131B (zh)
WO (1) WO2022042327A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115767372A (zh) * 2022-10-20 2023-03-07 瑞声光电科技(常州)有限公司 一种音频功率放大器的驱动电路和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729625A (zh) * 2010-01-05 2010-06-09 青岛海信移动通信技术股份有限公司 一种手机马达的驱动方法及移动设备
US20130073295A1 (en) * 2011-09-21 2013-03-21 Apple Inc. Audio codec with vibrator support
CN108989791A (zh) * 2018-07-11 2018-12-11 昆山丘钛微电子科技有限公司 一种马达线性检测方法、装置及计算机可读存储介质
CN109308114A (zh) * 2017-07-26 2019-02-05 华为技术有限公司 驱动线性马达的装置及方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110267165A (zh) * 2019-05-27 2019-09-20 努比亚技术有限公司 音频信号输出控制方法、装置、设备及可读存储介质
CN110350935B (zh) * 2019-05-27 2022-01-25 努比亚技术有限公司 音频信号输出控制方法、可穿戴设备及可读存储介质
CN110769096A (zh) * 2019-10-21 2020-02-07 Oppo(重庆)智能科技有限公司 一种马达振动方法、终端及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729625A (zh) * 2010-01-05 2010-06-09 青岛海信移动通信技术股份有限公司 一种手机马达的驱动方法及移动设备
US20130073295A1 (en) * 2011-09-21 2013-03-21 Apple Inc. Audio codec with vibrator support
CN109308114A (zh) * 2017-07-26 2019-02-05 华为技术有限公司 驱动线性马达的装置及方法
CN108989791A (zh) * 2018-07-11 2018-12-11 昆山丘钛微电子科技有限公司 一种马达线性检测方法、装置及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4195637A4

Also Published As

Publication number Publication date
US20230319477A1 (en) 2023-10-05
EP4195637A1 (en) 2023-06-14
EP4195637A4 (en) 2024-02-14
CN114125131A (zh) 2022-03-01
CN114125131B (zh) 2022-12-30

Similar Documents

Publication Publication Date Title
US9378176B2 (en) Data interface with variable bit clock for changing the number of time slots in a frame
US10528507B2 (en) Systems and methods for digital data transfer between an electronic device and an accessory apparatus removably connected to the electronic device
JP6742465B2 (ja) ブルートゥーススピーカーにおける連続ウェイクアップ遅延低減の方法、装置及びブルートゥーススピーカー
US10366017B2 (en) Methods and apparatus to offload media streams in host devices
TW201841530A (zh) 經由匯流排上的額外副資料線來發送資料的系統和方法
US10205672B2 (en) Multi-device synchronization of devices
CN103548007B (zh) 用户装置和外部装置的连接系统和方法
CN107343237B (zh) 耳机适配器和耳机系统、耳机麦克风传送的方法
CN109660894B (zh) 终端外设及音频信号的传输方法
CN112579038A (zh) 一种内置录音方法、装置、电子设备和存储介质
WO2022042327A1 (zh) 音频驱动马达的通路配置方法及设备
CN110830970A (zh) 蓝牙设备间的音频传输方法、装置、设备及存储介质
US20120290823A1 (en) Core abstraction layer interface
US10635619B2 (en) Encoding for multi-device synchronization of devices
US20230370774A1 (en) Bluetooth speaker control method and system, storage medium, and mobile terminal
KR101402869B1 (ko) 중앙 오디오 허브에서 오디오 신호들을 처리하기 위한 방법 및 시스템
US20130085763A1 (en) Codec devices and operating and driving method thereof
WO2023165246A1 (zh) 蓝牙协议的通信方法、电子设备、装置、存储介质及产品
EP4354747A1 (en) Audio control method, electronic device, audio device, and storage medium
CN110035346A (zh) 蓝牙耳机的通信方法、装置、蓝牙耳机及存储介质
CN114503529B (zh) 音频系统和方法的向后兼容性
WO2023050128A1 (zh) 数据传输方法和装置
CN109976694B (zh) 数据传输的设备、终端、方法和处理器系统
EP3131332B1 (en) Communication module and data division transmission method using same
CN103402149A (zh) 机顶盒虚拟成蓝牙音箱的方法、机顶盒、主机

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21860166

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021860166

Country of ref document: EP

Effective date: 20230307

NENP Non-entry into the national phase

Ref country code: DE