CN113515258A - Control method and device of audio device - Google Patents
Control method and device of audio device Download PDFInfo
- Publication number
- CN113515258A CN113515258A CN202110700862.5A CN202110700862A CN113515258A CN 113515258 A CN113515258 A CN 113515258A CN 202110700862 A CN202110700862 A CN 202110700862A CN 113515258 A CN113515258 A CN 113515258A
- Authority
- CN
- China
- Prior art keywords
- audio device
- audio
- configuration information
- playing
- information corresponding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/16—Sound input; Sound output
- G06F3/162—Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Reverberation, Karaoke And Other Acoustics (AREA)
Abstract
The embodiment of the application provides a control method and a control device of an audio device, wherein the method comprises the following steps: acquiring configuration information corresponding to a first audio device; determining a target register of the first audio device and a processing algorithm of the first audio device from configuration information corresponding to the first audio device according to an audio playing mode and audio playing equipment; and playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device. By the method, the register and the processing algorithm are quickly determined from the configuration information corresponding to the audio device according to different audio devices and different scenes, so that the audio device is quickly debugged.
Description
Technical Field
The present invention relates to the field of audio technologies, and in particular, to a method and an apparatus for controlling an audio device.
Background
Currently, audio devices such as audio chips of various manufacturers or models, for example, an audio codec (codec) chip, an intelligent Power Amplifier (smartpa) chip, and an analog Power Amplifier (pa) chip, are generally used in a terminal device.
In the related art, manufacturers of audio chips generally provide technical solutions to control audio devices. The processor in the terminal device can identify the type of the audio chip attached to a Printed Circuit Board (PCB) of the terminal device, and then call a sound effect debugging tool provided by a manufacturer of the audio chip of the type to determine a driver and an algorithm so as to control the audio chip.
However, in the debugging process of the terminal device, since the types of the audio chips are numerous and the drivers and algorithms provided by different manufacturers are different, the audio device debugging time is too long when the audio chips of different manufacturers or different types are debugged by using the sound effect debugging tools of different manufacturers one by one.
Disclosure of Invention
The embodiment of the application provides a control method and a control device of an audio device, and aims to solve the technical problem that the debugging time of the audio device is too long in the prior art.
In a first aspect, an embodiment of the present application provides a method for controlling an audio device, where the method includes:
acquiring configuration information corresponding to a first audio device;
determining a target register of the first audio device and a processing algorithm of the first audio device from configuration information corresponding to the first audio device according to an audio playing mode and audio playing equipment;
and playing target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
In an optional implementation manner, the obtaining configuration information corresponding to the first audio device includes:
determining the model of the first audio device by identifying the identification pin of the first audio device;
and acquiring configuration information corresponding to the first audio device according to the type of the first audio device.
In an alternative embodiment, the determining the model number of the first audio device by identifying the identification pin of the first audio device includes:
acquiring difference configuration information of a preset audio device;
and polling and loading the difference configuration information in driving, identifying the identification line pin of the first audio device, and determining the model of the first audio device.
In an optional embodiment, the differential configuration information includes: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
In an optional implementation manner, after the obtaining of the configuration information corresponding to the first audio device, the method further includes:
and initializing the first audio device according to the configuration information corresponding to the first audio device.
In an alternative embodiment, the initializing the first audio device includes:
determining a register configuration file of the first audio device and an algorithm parameter file of the first audio device from configuration information corresponding to the first audio device;
and loading the register configuration file of the first audio device and the algorithm parameter file of the first audio device, and initializing the first audio device.
In an optional implementation manner, the determining, according to the audio playing mode and the audio playing device, the target register of the first audio device and the processing algorithm of the first audio device from the configuration information corresponding to the first audio device includes:
determining an audio playing scene according to the audio playing mode and the audio playing equipment;
and according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
In an optional implementation manner, the determining, from the configuration information corresponding to the first audio device, the target register of the first audio device and the processing algorithm of the first audio device includes:
and determining a target register of the first audio device and a processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
In an optional implementation manner, the mapping table includes a mapping relationship between a combination of an audio playing mode and an audio playing device and a target register of the first audio device, and a mapping relationship between a combination of the audio playing mode and the audio playing device and a processing algorithm of the first audio device.
In an alternative embodiment, the playing target audio using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device includes:
processing the audio data transmitted by the application by using the processing algorithm of the first audio device to generate data to be decoded;
controlling a coder-decoder in the audio device to decode the data to be decoded by using a target register of the first audio device to generate data to be played;
and sending the data to be played to the audio playing equipment for playing.
In a second aspect, an embodiment of the present application provides a control unit for controlling loading of an audio device, the loading including:
the acquisition module is used for acquiring configuration information corresponding to the first audio device;
the determining module is used for determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device according to an audio playing mode and audio playing equipment;
and the playing module is used for playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
In an optional implementation manner, the obtaining module is specifically configured to determine a model of the first audio device by identifying an identification pin of the first audio device; and acquiring configuration information corresponding to the first audio device according to the type of the first audio device.
In an optional implementation manner, the obtaining module is specifically configured to obtain difference configuration information of a preset audio device; and polling and loading the difference configuration information in driving, identifying the identification line pin of the first audio device, and determining the model of the first audio device.
In an optional embodiment, the differential configuration information includes: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
In an alternative embodiment, the apparatus further comprises:
and the initialization module is used for initializing the first audio device according to the configuration information corresponding to the first audio device.
In an optional implementation manner, the initialization module is specifically configured to determine a register configuration file of the first audio device and an algorithm parameter file of the first audio device from configuration information corresponding to the first audio device; and loading the register configuration file of the first audio device and the algorithm parameter file of the first audio device, and initializing the first audio device.
In an optional implementation manner, the determining module is specifically configured to determine an audio playing scene according to the audio playing mode and the audio playing device; and according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
In an optional implementation manner, the determining module is specifically configured to determine the target register of the first audio device and the processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
In an optional implementation manner, the mapping table includes a mapping relationship between a combination of an audio playing mode and an audio playing device and a target register of the first audio device, and a mapping relationship between a combination of the audio playing mode and the audio playing device and a processing algorithm of the first audio device.
In an optional implementation manner, the playing module is specifically configured to process audio data transmitted by an application using a processing algorithm of the first audio device, and generate data to be decoded; controlling a coder-decoder in the audio device to decode the data to be decoded by using a target register of the first audio device to generate data to be played; and sending the data to be played to the audio playing equipment for playing.
In a third aspect, the present application further provides an electronic device, including:
a processor; and
a memory for storing a computer program for the processor;
wherein the processor is configured to implement any one of the possible methods of the first aspect by executing the computer program.
In a fourth aspect, the present application also provides a computer program product comprising a computer program that, when executed by a processor, performs the method of any of the first aspects.
In a fifth aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program of instructions for implementing any one of the possible methods of the first aspect when executed by a processor.
According to the control method and the control device for the audio device, the configuration information corresponding to the first audio device is obtained at first. And then, according to the audio playing mode and the audio playing equipment, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device. And finally, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device. By the method, the register and the processing algorithm are quickly determined from the configuration information corresponding to the audio device according to different audio devices and different scenes, so that the audio device is quickly debugged.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the following briefly introduces the drawings needed to be used in the description of the embodiments or the prior art, and obviously, the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings according to the drawings without inventive labor.
Fig. 1 is a schematic diagram of a control method of a conventional audio device;
fig. 2 is a schematic view of an application scenario of a control method of an audio device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a control method of an audio device according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating a method for controlling an audio device according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of another control method for an audio device according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a control method of an audio device according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a control method for an audio device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a control apparatus of an audio device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, audio devices such as audio chips of various manufacturers or models, for example, an audio codec (codec) chip, an intelligent Power Amplifier (smartpa) chip, and an analog Power Amplifier (pa) chip, are generally used in a terminal device.
In the related art, manufacturers of audio chips generally provide technical solutions to control audio devices. The processor in the terminal device can identify the type of the audio chip attached to a Printed Circuit Board (PCB) of the terminal device, and then call a sound effect debugging tool provided by a manufacturer of the audio chip of the type to determine a driver and an algorithm so as to control the audio chip.
Fig. 1 is a schematic diagram illustrating a control method of an existing audio device. As shown in fig. 1, manufacturer a, manufacturer B, and manufacturer C all provide Smartpa chips, and since the audio chips are all Inter-Integrated Circuit (I2C) devices, the processor in the terminal device can obtain the manufacturer of the currently used audio chip by obtaining the identification pin of the Smartpa chip attached to the PCB board. The processor may then call a sound effect debugging tool provided by the manufacturer of the model audio chip to determine the drivers and algorithms to control the audio chip.
However, in the debugging process of the terminal device, since the types of the audio chips are numerous and the drivers and algorithms provided by different manufacturers are different, the audio device debugging time is too long when the audio chips of different manufacturers or different types are debugged by using the sound effect debugging tools of different manufacturers one by one.
In order to solve the above problem, embodiments of the present application provide a method and an apparatus for controlling an audio device, which pre-configure configuration information of audio devices of different models, and then quickly determine a register and a processing algorithm from the configuration information corresponding to the audio device according to different audio devices and different scenes, so as to implement quick debugging of the audio device.
An application scenario of the data processing method according to the present application will be described below.
Fig. 2 is a schematic view of an application scenario of a control method of an audio device according to an embodiment of the present application. As shown in fig. 2, the processor 101 in the terminal device may identify the audio device 102 in the terminal device, and obtain configuration information corresponding to the audio device 102. Subsequently, the processor 101 may determine a target register of the audio device 102 and a processing algorithm of the audio device 102 from the configuration information corresponding to the audio device 102 according to the audio playback mode and the audio playback apparatus. Finally, the processor 101 may process the audio data using the audio device 102 based on the target register of the audio device 102 and the processing algorithm of the audio device 102, thereby driving the audio playing device 103 to play the audio.
The terminal device may be a mobile phone (mobile phone), a tablet computer (pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in self driving (self driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in smart home (smart home), and the like. In the embodiment of the present application, the apparatus for implementing the function of the terminal may be the terminal, or may be an apparatus capable of supporting the terminal to implement the function, such as a chip system, and the apparatus may be installed in the terminal. In the embodiment of the present application, the chip system may be composed of a chip, and may also include a chip and other discrete devices.
It should be understood that the embodiments of the present application do not limit the models of the processor, the audio device, and the audio playing device, and may be specifically configured according to actual situations.
It should be understood that the application scenario of the present technical solution may be the audio playing scenario in fig. 1, but is not limited thereto, and may also be applied to other scenarios that require debugging of an audio device.
It is understood that the control method of the audio device may be implemented by the control apparatus of the audio device provided in the embodiments of the present application, and the control apparatus of the audio device may be a part or all of a certain device, such as the processor.
The following takes a processor integrated or installed with relevant execution codes as an example, and details the technical solution of the embodiments of the present application with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 3 is a schematic flowchart of a control method of an audio device according to an embodiment of the present disclosure, and fig. 4 is a schematic diagram of a principle of the control method of the audio device according to the embodiment of the present disclosure, which relates to a process of controlling the audio device to complete debugging. As shown in fig. 3 and 4, the method includes:
s201, obtaining configuration information corresponding to the first audio device.
In the application, the processor of the terminal device may obtain the configuration information corresponding to the first audio device in the debugging process.
The first audio device may be an audio device to which a current PCB of the terminal device is attached, and the first audio device is not limited in this embodiment of the application. Such as codec chips, smartpa chips, pa chips, etc.
It should be understood that, how to obtain the configuration information corresponding to the first audio device is not limited in this embodiment, in some embodiments, the processor may first determine the model of the first audio device by identifying the identification pin of the first audio device, and then obtain the configuration information corresponding to the first audio device according to the model of the first audio device.
In some embodiments, determining the model of the first audio device may first obtain difference configuration information of a preset audio device, and then poll and load the difference configuration information in the driving, so as to identify the identification line pin of the first audio device and determine the model of the first audio device.
It should be understood that the differential configuration information may include differential information between different models of audio devices. It should be noted that the configuration information of the audio device may include control bus, audio data bus, register, processing algorithm, and chip miscellaneous items. For the control bus, the control buses of the audio devices on the market are I2C buses at present, and because the I2C bus is a standard protocol, the codes of the control parts of the audio devices can be unified; for an audio data bus, the audio data bus is used to receive or send data, and currently, audio data buses used by an audio device are all Inter-IC Sound (I2S) or Time Division Multiplexing (TDM) buses built in an integrated circuit, which may be unified; for the register, the address and the content of the register of the audio device of each manufacturer are different, and the part cannot be unified and standardized and is configured in a differentiated way; aiming at the processing algorithm, the coupling degree of the processing algorithm and specific hardware is not high, only the requirement on the operation resource of the processing algorithm is met, and the standard can be unified; for the chip miscellaneous items, the chip miscellaneous items can comprise a power supply, a reset, an interrupt, a clock, a mark line pin and the like, and due to different hardware designs, the power supply, the reset, the interrupt, the clock and the mark line pin can be different, and the part cannot be normalized.
Thus, based on the above description, the differential configuration information may include: clock information, power information, reset pin information, interrupt trigger patterns, identification line pins, and the like. In some embodiments, each audio device may have a separate equipment tree node for recording in the differential configuration information.
In some embodiments, after determining the model of the first audio device, the processor may further perform operations such as power-up, clock configuration, reset pin configuration, interrupt pin configuration, and the like according to the differential configuration information.
Optionally, after the configuration information corresponding to the first audio device is obtained, the processor may further initialize the first audio device according to the configuration information corresponding to the first audio device.
It should be understood that, in this embodiment of the present application, how to initialize the first audio device is not limited, in some embodiments, the processor may determine the register configuration file of the first audio device and the algorithm parameter file of the first audio device from the configuration information corresponding to the first audio device, and then load the register configuration file of the first audio device and the algorithm parameter file of the first audio device to initialize the first audio device.
For example, the register operation information of each model of audio device may be extracted separately as a register configuration file, and the parameter of the processing algorithm of each model of audio device may also be extracted separately as an algorithm parameter file. The processor can load the register configuration file and the algorithm parameter file of the first audio device through the configuration information corresponding to the first audio device. The initialization scenario in the register configuration file and the algorithm parameter file is then executed to place the audio device in a ready state, ready for operation at any time.
S202, according to the audio playing mode and the audio playing equipment, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
In this step, after the processor obtains the configuration information corresponding to the first audio device, the target register of the first audio device and the processing algorithm of the first audio device may be determined from the configuration information corresponding to the first audio device according to the audio playing mode and the audio playing device.
In the embodiments of the present application, how to determine the target register of the first audio device and the processing algorithm of the first audio device from the configuration information corresponding to the first audio device is not limited, and in some embodiments, the processor may determine an audio playing scene according to an audio playing mode and an audio playing device. And then, the processor determines a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device according to the audio playing scene.
The processor may determine a current usage scenario, for example, an earphone call scenario, a normal call scenario, an alarm clock alert scenario, an audio play scenario, and the like, by combining the audio play mode and the audio play device.
It should be understood that in some embodiments, the processor may determine the target register of the first audio device and the processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device. The mapping table may include a mapping relationship between a combination of the audio playback mode and the audio playback apparatus and a target register of the first audio device, and a mapping relationship between a combination of the audio playback mode and the audio playback apparatus and a processing algorithm of the first audio device.
For example, combining the audio playing mode and the audio playing device may establish a set of mapping tables, where the mapping table identifies a keyword XX _ YY, XX represents the currently-used audio playing mode, and YY represents the currently-used audio playing device. (if the call scene uses a speaker device, the corresponding keyword is voice _ speaker). Correspondingly, the target register and the processing algorithm also make the same keyword XX _ YY to represent the register and the processing algorithm which are required to be configured in the current scene, so that the target register of the first audio device and the processing algorithm of the first audio device are determined from the mapping table in the configuration information corresponding to the first audio device based on the audio playing scene.
S203, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
In this step, after the processor determines the target register of the first audio device and the processing algorithm of the first audio device from the configuration information corresponding to the first audio device according to the audio playing mode and the audio playing device, the target audio may be played using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
It should be understood that, in the embodiments of the present application, how to play the target audio using the audio device is not limited, in some embodiments, the audio data transmitted by the application may be processed using the processing algorithm of the first audio device first to generate the data to be decoded. And then controlling a coder-decoder in the audio device to decode the data to be decoded by using the target register of the first audio device to generate the data to be played. And finally, sending the data to be played to the audio playing equipment for playing.
It should be understood that the embodiment of the present application is not limited to the type of audio data, and may be, for example, a Pulse Code Modulation (PCM) data stream.
In the application, the audio device management scheme is customized uniformly, so that the effect of 'one for many' can be realized through the configuration information of each pre-configured audio device, and the stability of subsequent use is improved. Because the sound effect debugging tools of all manufacturers are not required to be used one by one, the time cost during debugging is saved, and the debugging time is shortened.
Meanwhile, the Processing method of the audio device provided by the embodiment of the application is a set of normalization standard solution, the algorithm and hardware coupling degree is reduced, different algorithm parameter methods can be distinguished through the Processing method of the audio device to meet the use requirements of various types of audio devices, so that the Processing method of the audio devices of multiple different manufacturers is not required to be used in limited Digital Signal Processing (DSP) resources, and the problem of insufficient DSP resources is solved.
The method for controlling the audio device, provided by the embodiment of the application, includes the steps of firstly obtaining configuration information corresponding to a first audio device. And then, according to the audio playing mode and the audio playing equipment, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device. And finally, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device. By the method, the register and the processing algorithm are quickly determined from the configuration information corresponding to the audio device according to different audio devices and different scenes, so that the audio device is quickly debugged.
On the basis of the above embodiments, how to obtain the configuration information corresponding to the first audio device is described below. Fig. 5 is a schematic flowchart of another control method for an audio device according to an embodiment of the present application, where as shown in fig. 5, the method includes:
s301, the type of the first audio device is determined by identifying the identification pin of the first audio device.
In some embodiments, the processor may first obtain the preset differential configuration information of the audio device, then poll and load the differential configuration information in the driver, identify the identification line pin of the first audio device, and determine the model of the first audio device.
Wherein the differential configuration information comprises: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
S302, acquiring configuration information corresponding to the first audio device according to the model of the first audio device.
S303, according to the audio playing mode and the audio playing device, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
S304, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
The technical terms, technical effects, technical features, and alternative embodiments of S301 to S304 can be understood with reference to S201 to S203 shown in fig. 3, and repeated descriptions thereof will not be repeated here.
On the basis of the above-described embodiment, how to determine the target register of the first audio device and the processing algorithm of the first audio device is explained below. Fig. 6 is a schematic flowchart of a control method of an audio device according to an embodiment of the present application, where as shown in fig. 6, the method includes:
s401, obtaining configuration information corresponding to the first audio device.
S402, determining an audio playing scene according to the audio playing mode and the audio playing equipment.
S403, according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
In some embodiments, the processor may determine the target register of the first audio device and the processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
The mapping table comprises a mapping relation between a combination of the audio playing mode and the audio playing equipment and a target register of the first audio device, and a mapping relation between a combination of the audio playing mode and the audio playing equipment and a processing algorithm of the first audio device.
S404, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
The technical terms, technical effects, technical features, and alternative embodiments of S401 to S404 can be understood with reference to S201 to S203 shown in fig. 3, and repeated descriptions thereof will not be repeated here.
On the basis of the above embodiments, the following provides a complete audio device processing method. Fig. 7 is a schematic flowchart of a control method of an audio device according to an embodiment of the present application, where as shown in fig. 7, the method includes:
s501, identifying the identification pin of the first audio device to determine the model of the first audio device.
S502, acquiring configuration information corresponding to the first audio device according to the model of the first audio device.
S503, initializing the first audio device according to the configuration information corresponding to the first audio device.
S504, determining an audio playing scene according to the audio playing mode and the audio playing equipment.
And S505, according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
S506, processing the audio data transmitted by the application by using the processing algorithm of the first audio device to generate data to be decoded.
And S507, controlling a coder-decoder in the audio device to decode the data to be decoded by using the target register of the first audio device to generate the data to be played.
And S508, sending the data to be played to the audio playing equipment for playing.
The technical terms, technical effects, technical features, and alternative embodiments of S501-S508 can be understood with reference to S201-S203 shown in fig. 3, and repeated descriptions will not be repeated here.
The method for controlling the audio device, provided by the embodiment of the application, includes the steps of firstly obtaining configuration information corresponding to a first audio device. And then, according to the audio playing mode and the audio playing equipment, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device. And finally, playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device. By the method, the register and the processing algorithm are quickly determined from the configuration information corresponding to the audio device according to different audio devices and different scenes, so that the audio device is quickly debugged.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Fig. 8 is a schematic structural diagram of a control apparatus of an audio device according to an embodiment of the present application. The control device of the audio device may be implemented by software, hardware or a combination of both, and may be, for example, a processor in the above-described embodiment, to execute the control method of the audio device in the above-described embodiment. As shown in fig. 8, the control apparatus 600 of the audio device includes:
an obtaining module 601, configured to obtain configuration information corresponding to a first audio device;
a determining module 602, configured to determine, according to an audio playing mode and an audio playing device, a target register of a first audio device and a processing algorithm of the first audio device from configuration information corresponding to the first audio device;
the playing module 603 is configured to play the target audio using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
In an optional implementation manner, the obtaining module 601 is specifically configured to determine a model of the first audio device by identifying an identification pin of the first audio device; and acquiring configuration information corresponding to the first audio device according to the type of the first audio device.
In an optional implementation manner, the obtaining module 601 is specifically configured to obtain difference configuration information of a preset audio device; and polling and loading the difference configuration information in the driving process, identifying a pin of an identification line of the first audio device, and determining the model of the first audio device.
In an optional embodiment, the differential configuration information includes: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
In an alternative embodiment, the apparatus further comprises:
the initializing module 604 is configured to initialize the first audio device according to the configuration information corresponding to the first audio device.
In an optional implementation manner, the initialization module 604 is specifically configured to determine a register configuration file of the first audio device and an algorithm parameter file of the first audio device from configuration information corresponding to the first audio device; and loading the register configuration file of the first audio device and the algorithm parameter file of the first audio device, and initializing the first audio device.
In an optional implementation manner, the determining module 602 is specifically configured to determine an audio playing scene according to an audio playing mode and an audio playing device; and according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
In an optional implementation manner, the determining module 602 is specifically configured to determine a target register of the first audio device and a processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
In an optional implementation, the mapping table includes a mapping relationship between a combination of the audio playback mode and the audio playback device and a target register of the first audio device, and a mapping relationship between a combination of the audio playback mode and the audio playback device and a processing algorithm of the first audio device.
In an optional implementation manner, the playing module 603 is specifically configured to process the audio data transmitted by the application by using a processing algorithm of the first audio device, and generate data to be decoded; controlling a coder-decoder in the audio device to decode the data to be decoded by using a target register of the first audio device to generate the data to be played; and sending the data to be played to the audio playing equipment for playing.
It should be noted that the control apparatus of the audio device provided in the embodiment shown in fig. 8 may be used to execute the method provided in any of the above embodiments, and the specific implementation manner and the technical effect are similar, and are not described again here.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device may include: at least one processor 701 and a memory 702. Fig. 9 shows an electronic device as an example of a processor.
And a memory 702 for storing programs. In particular, the program may include program code including computer operating instructions.
The memory 702 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 701 is used for executing computer execution instructions stored in the memory 702 to realize the control method of the audio device;
the processor 701 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application.
Optionally, in a specific implementation, if the communication interface, the memory 702 and the processor 701 are implemented independently, the communication interface, the memory 702 and the processor 701 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. Buses may be classified as address buses, data buses, control buses, etc., but do not represent only one bus or type of bus.
Alternatively, in a specific implementation, if the communication interface, the memory 702 and the processor 701 are integrated into a chip, the communication interface, the memory 702 and the processor 701 may complete communication through an internal interface.
The embodiment of the application also provides a chip which comprises a processor and an interface. Wherein the interface is used for inputting and outputting data or instructions processed by the processor. The processor is configured to perform the methods provided in the above method embodiments. The chip can be applied to a control device of an audio device.
The present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, are used, and specifically, the computer-readable storage medium stores program information, and the program information is used for the control method of the audio device.
Embodiments of the present application also provide a program, which is configured to execute the control method of the audio device provided in the above method embodiments when executed by a processor.
Embodiments of the present application further provide a program product, such as a computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to execute the method for controlling an audio device provided in the above method embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (23)
1. A method of controlling an audio device, the method comprising:
acquiring configuration information corresponding to a first audio device;
determining a target register of the first audio device and a processing algorithm of the first audio device from configuration information corresponding to the first audio device according to an audio playing mode and audio playing equipment;
and playing target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
2. The method of claim 1, wherein the obtaining configuration information corresponding to the first audio device comprises:
determining the model of the first audio device by identifying the identification pin of the first audio device;
and acquiring configuration information corresponding to the first audio device according to the type of the first audio device.
3. The method of claim 2, wherein determining the model number of the first audio device by identifying an identification pin of the first audio device comprises:
acquiring difference configuration information of a preset audio device;
and polling and loading the difference configuration information in driving, identifying the identification line pin of the first audio device, and determining the model of the first audio device.
4. The method of claim 3, wherein the differential configuration information comprises: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
5. The method of claim 1, wherein after the obtaining the configuration information corresponding to the first audio device, the method further comprises:
and initializing the first audio device according to the configuration information corresponding to the first audio device.
6. The method of claim 5, wherein initializing the first audio device comprises:
determining a register configuration file of the first audio device and an algorithm parameter file of the first audio device from configuration information corresponding to the first audio device;
and loading the register configuration file of the first audio device and the algorithm parameter file of the first audio device, and initializing the first audio device.
7. The method of claim 1, wherein determining the target register of the first audio device and the processing algorithm of the first audio device from the configuration information corresponding to the first audio device according to the audio playback mode and the audio playback apparatus comprises:
determining an audio playing scene according to the audio playing mode and the audio playing equipment;
and according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
8. The method of claim 7, wherein determining the target register of the first audio device and the processing algorithm of the first audio device from the configuration information corresponding to the first audio device comprises:
and determining a target register of the first audio device and a processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
9. The method of claim 8, wherein the mapping table comprises a mapping relationship between a combination of an audio playback mode and an audio playback device and a target register of the first audio device, and a mapping relationship between a combination of the audio playback mode and the audio playback device and a processing algorithm of the first audio device.
10. The method of any of claims 1-9, wherein the playing target audio using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device comprises:
processing the audio data transmitted by the application by using the processing algorithm of the first audio device to generate data to be decoded;
controlling a coder-decoder in the audio device to decode the data to be decoded by using a target register of the first audio device to generate data to be played;
and sending the data to be played to the audio playing equipment for playing.
11. An apparatus for controlling an audio device, the apparatus comprising:
the acquisition module is used for acquiring configuration information corresponding to the first audio device;
the determining module is used for determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device according to an audio playing mode and audio playing equipment;
and the playing module is used for playing the target audio by using the audio device according to the target register of the first audio device and the processing algorithm of the first audio device.
12. The apparatus according to claim 11, wherein the obtaining module is specifically configured to determine the model of the first audio device by identifying an identification pin of the first audio device; and acquiring configuration information corresponding to the first audio device according to the type of the first audio device.
13. The apparatus according to claim 12, wherein the obtaining module is specifically configured to obtain differential configuration information of preset audio devices; and polling and loading the difference configuration information in driving, identifying the identification line pin of the first audio device, and determining the model of the first audio device.
14. The apparatus of claim 13, wherein the differential configuration information comprises: clock information, power supply information, reset pin information, interrupt trigger mode, and identification line pin.
15. The apparatus of claim 11, further comprising:
and the initialization module is used for initializing the first audio device according to the configuration information corresponding to the first audio device.
16. The apparatus according to claim 15, wherein the initialization module is specifically configured to determine a register configuration file of the first audio device and an algorithm parameter file of the first audio device from configuration information corresponding to the first audio device; and loading the register configuration file of the first audio device and the algorithm parameter file of the first audio device, and initializing the first audio device.
17. The apparatus according to claim 11, wherein the determining module is specifically configured to determine an audio playing scene according to the audio playing mode and the audio playing device; and according to the audio playing scene, determining a target register of the first audio device and a processing algorithm of the first audio device from the configuration information corresponding to the first audio device.
18. The apparatus of claim 17, wherein the determining module is specifically configured to determine the target register of the first audio device and the processing algorithm of the first audio device from a mapping table in the configuration information corresponding to the first audio device.
19. The apparatus of claim 18, wherein the mapping table comprises a mapping relationship between a combination of an audio playback mode and an audio playback device and a target register of the first audio device, and a mapping relationship between a combination of the audio playback mode and the audio playback device and a processing algorithm of the first audio device.
20. The apparatus according to claim 11, wherein the playing module is specifically configured to process audio data transmitted by an application using a processing algorithm of the first audio device, and generate data to be decoded; controlling a coder-decoder in the audio device to decode the data to be decoded by using a target register of the first audio device to generate data to be played; and sending the data to be played to the audio playing equipment for playing.
21. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1-10 when executed by a processor.
22. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any of claims 1-10.
23. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method according to any of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110700862.5A CN113515258B (en) | 2021-06-24 | 2021-06-24 | Control method and device of audio device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110700862.5A CN113515258B (en) | 2021-06-24 | 2021-06-24 | Control method and device of audio device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113515258A true CN113515258A (en) | 2021-10-19 |
CN113515258B CN113515258B (en) | 2021-12-21 |
Family
ID=78066164
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110700862.5A Active CN113515258B (en) | 2021-06-24 | 2021-06-24 | Control method and device of audio device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113515258B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110002471A1 (en) * | 2009-07-02 | 2011-01-06 | Conexant Systems, Inc. | Systems and methods for transducer calibration and tuning |
CN106648531A (en) * | 2016-12-21 | 2017-05-10 | 惠州Tcl移动通信有限公司 | Method and system for automatically matching different audio parameters based on mobile terminal |
CN106648521A (en) * | 2016-09-27 | 2017-05-10 | 北京小米移动软件有限公司 | Terminal device operation method and apparatus |
CN106775562A (en) * | 2016-12-09 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | The method and device of audio frequency parameter treatment |
CN108810685A (en) * | 2018-06-06 | 2018-11-13 | 广州麦芮声电子有限公司 | A kind of digital microphone |
-
2021
- 2021-06-24 CN CN202110700862.5A patent/CN113515258B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110002471A1 (en) * | 2009-07-02 | 2011-01-06 | Conexant Systems, Inc. | Systems and methods for transducer calibration and tuning |
CN106648521A (en) * | 2016-09-27 | 2017-05-10 | 北京小米移动软件有限公司 | Terminal device operation method and apparatus |
CN106775562A (en) * | 2016-12-09 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | The method and device of audio frequency parameter treatment |
CN106648531A (en) * | 2016-12-21 | 2017-05-10 | 惠州Tcl移动通信有限公司 | Method and system for automatically matching different audio parameters based on mobile terminal |
CN108810685A (en) * | 2018-06-06 | 2018-11-13 | 广州麦芮声电子有限公司 | A kind of digital microphone |
Non-Patent Citations (2)
Title |
---|
T.SAIDANI: "Hardware Co-Simiulation For Video Processing Using Xilinx System Generator", 《PROCEEDING OF WORLD CONGRESS ON ENGINEERING》 * |
王海时: "小功率型音频子系统噪声抑制技术的研究", 《中国博士学位论文全文数据库》 * |
Also Published As
Publication number | Publication date |
---|---|
CN113515258B (en) | 2021-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9961465B2 (en) | Method for improving speaker performance and terminal device | |
EP3148225A1 (en) | Bluetooth connection-based audio playback method and apparatus | |
CN108347719B (en) | Bluetooth device connection method, device, storage medium, mobile terminal and server | |
CN108664429B (en) | Master-slave configuration communication protocol, method for improving compatibility and electronic equipment | |
US11403245B2 (en) | Terminal, terminal peripheral, signal transmission system and signal sending and receiving method | |
CN105872897A (en) | Tone quality adjusting method and terminal | |
CN104267924A (en) | Mobile terminal and audio processing method thereof | |
US7814275B2 (en) | Apparatus and method for performing a plurality of storage devices | |
CN109819108B (en) | Method and device for adjusting driving parameters, electronic equipment and storage medium | |
CN109901664B (en) | Method, apparatus, system, device and readable storage medium for providing clock signal | |
KR20210101553A (en) | Electronic device and method for recognizing audio output device connected to usb type-c connector using the same | |
CN113515258B (en) | Control method and device of audio device | |
CN106604204B (en) | Method and system for remotely controlling terminal application through Bluetooth | |
TWI689819B (en) | Audio playback device | |
US7721015B2 (en) | Dynamic audio jack colors | |
CN107451067B (en) | Processing method for downloading test and related product | |
CN110726924B (en) | Chip operation method and device | |
KR20200143985A (en) | Electronic device and method for identifying an inserted object in ear jack | |
CN114116544B (en) | Slot information acquisition method, device, equipment and storage medium | |
CN104980564A (en) | Recharge socket and mobile terminal processing method based on recharge socket | |
CN113377418A (en) | File loading method, storage medium and equipment | |
CN104007969A (en) | Booting sound playing method and device | |
CN114691568A (en) | Protocol adaptation method, storage medium, device and system for interconnection between devices | |
CN113038326A (en) | Data interaction method, device and equipment based on TWS earphone and readable storage medium | |
CN111045632B (en) | Audio playing device and operation method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |