CN115373759A - Method for making audio equipment compatible with Openharmony and Android - Google Patents
Method for making audio equipment compatible with Openharmony and Android Download PDFInfo
- Publication number
- CN115373759A CN115373759A CN202211004333.2A CN202211004333A CN115373759A CN 115373759 A CN115373759 A CN 115373759A CN 202211004333 A CN202211004333 A CN 202211004333A CN 115373759 A CN115373759 A CN 115373759A
- Authority
- CN
- China
- Prior art keywords
- audio
- virtual audio
- virtual
- android
- openharmony
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/63—Querying
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
- G11B2020/10537—Audio or video recording
- G11B2020/10546—Audio or video recording specifically adapted for audio data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Multimedia (AREA)
- Computer Hardware Design (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a method for enabling audio equipment to be compatible with Openharmony and Android, wherein an Openharmony system starts an Android system container and loads an Android audio frame and each virtual audio equipment unit in a virtual audio Hardware Abstraction Layer (HAL), the virtual audio equipment units are connected with a virtual audio service module through a network programming interface and inquire a request, and audio data applied by the Android are transmitted to the virtual audio equipment units through the Android audio frame; connecting the virtual audio equipment unit with a virtual audio service module; and the virtual audio service module creates a local audio stream, and finally, the local audio is played in openharmony. The audio equipment can be compatible with Openharmony and Android, and is widely used.
Description
Technical Field
The invention relates to an embedded system technology, in particular to a method for enabling audio equipment to be compatible with Openharmony and Android.
Background
A virtual audio Hardware Abstraction Layer (HAL) is realized at the Android container side, and Android application calls an interface provided by the virtual audio hardware abstraction layer through an Android audio middleware to complete audio related services; the method comprises the steps of realizing a virtual audio service module on an audio service program PulseAudio of an Openharmony side of a host, establishing a channel penetrating through a container on a virtual audio hardware abstract layer of an Android side of the container to communicate with the Openharmony virtual audio service module of the host, and realizing bidirectional transmission of audio data of two systems.
The prior art scheme has the following problems: the openharmony system and the Android system cannot access audio resources at the same time, only one system can access at the same time, and the security problem is caused by the non-authentication security.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art and provides a method for enabling audio equipment to be compatible with Openharmony and Android.
The technical scheme is as follows: the invention discloses a method for enabling audio equipment to be compatible with Openharmony and Android, which comprises the following steps:
the method comprises the steps that (1) an Android system container is started in an Openharmony system; in the starting process of the Android system container, loading the Android audio frame and each virtual audio equipment unit in the virtual audio hardware abstraction layer HAL at the same time, and acquiring the related capability of the audio equipment through the virtual audio equipment units;
step (2), because the Android system container runs on the Openharmony system as a client system, physical audio equipment is not directly operated, the virtual audio equipment unit is connected with a virtual audio service module running in the Openharmony system through a network programming interface socket to initiate an inquiry request, the virtual audio service module inquires the capability (including the sampling frequency, the number of channels, the sampling depth, the buffer size and the like) of the audio equipment through an ADM interface (function call) of the Openharmony after receiving the inquiry request, and returns the capability to the virtual audio equipment unit and the Android system container through the network programming interface socket to finish the registration and capability set report of the audio equipment;
step (3), android applications are clicked in the Android system container to perform audio related operation; then, transmitting the audio data of the Android application to a virtual audio equipment unit through an Android audio frame;
step (4), the virtual audio equipment unit is connected with a virtual audio service module running in the Openharmony system through a network programming interface socket;
and (5) the virtual audio service module locally creates an open harmony local audio stream according to the service scene and the audio attribute transmitted by the virtual audio equipment unit, and the local audio stream is written into physical audio equipment for playing through an audio IO interface of ADM after audio mixing is completed through the Openharmony audio service.
Further, the virtual audio hardware abstraction layer HAL runs in an Android operating environment, and includes the following three types of interfaces:
the client interface of the virtual audio service module realizes connection, authentication and disconnection of the link through the client interface, and the specific method comprises the following steps:
1) The client is connected with a virtual audio service module positioned in openharmomy through a default service address and a port;
2) The client sends the process name, pid, uid and gid of the client to the server, and the server judges whether authentication is successful according to the security configuration of the system;
3) The disconnection comprises normal disconnection and abnormal disconnection; the normal disconnection refers to closing the connected handle, and the abnormal disconnection refers to performing abnormal processing and closing the connected handle after the IO failure condition meets a certain condition;
opening a configuration query and closing an interface of the virtual audio device;
the transmission interface of the virtual audio data realizes the reading and writing of the audio data.
Further, the virtual audio service module is located in the audio service PulseAudio of the Openharmony system, and the virtual audio service module makes a remote call to the virtual audio hardware abstraction layer: the method specifically comprises the following steps:
1) Connecting the virtual audio hardware abstraction layer serving as a client to the Openharmony system, and authenticating the virtual audio hardware abstraction layer to be connected in a waiting mode;
2) Managing the virtual audio hardware abstraction layer which is successfully authenticated and serves as the client, wherein the virtual audio hardware abstraction layer comprises opening, configuring, inquiring and closing requests, and the operation of the physical equipment is completed by using the corresponding ADM interface and is returned to the virtual audio hardware abstraction layer;
3) For the opened virtual audio hardware abstraction layer, in a playing scene, the virtual audio hardware abstraction layer transmits the data segments of audio playing to a virtual audio service module through a socket, and the virtual audio service module uses a corresponding ADM interface to write the data segments into physical audio equipment;
4) And for the opened virtual audio hardware abstraction layer, in a recording scene, the virtual audio service module reads sampled audio data from physical audio equipment through an ADM interface and transmits recorded data fragments to the virtual audio hardware abstraction layer through a socket interface.
Further, the method for registering and reporting the capability set of the audio device in the step (2) includes:
(A) The actual hardware audio equipment capability inquired through the ADM interface is used as input, and virtual audio equipment is established in the virtual audio unit;
(B) And the Android acquires the capability of the audio equipment through the interface defined by the HAL, realizes the related HAL interface in the virtual audio unit, and returns the capability of the equipment of the virtual audio to the Android system.
Has the beneficial effects that: compared with the prior art, the invention has the following advantages:
(1) The invention solves the problem of audio hardware equipment on application access equipment in an Android container running on an Openharmony system, and realizes related functions such as sound playing, sound recording and the like.
(2) The host side Audio of the invention uses ADM framework and can run on openharmony.
Drawings
FIG. 1 is a schematic diagram of the overall system of the present invention;
FIG. 2 is a diagram illustrating a connection process between a virtual audio device unit and a virtual audio service module according to an embodiment;
fig. 3 is a schematic diagram illustrating a process of playing Android audio in openharmony according to the embodiment.
Detailed Description
The technical solution of the present invention is described in detail below, but the scope of the present invention is not limited to the embodiments.
To facilitate further understanding of the technical solutions of the present invention, the following technical terms are explained.
As shown in fig. 1 to fig. 3, a method for making an audio device compatible with Openharmony and Android of the present invention includes the following steps:
the method comprises the following steps that (1) an Android system container is started in an Openharmony system; in the starting process of the Android system container, loading the Android audio frame and each virtual audio equipment unit at the same time, and acquiring the related capability of the audio equipment through the virtual audio equipment unit;
step (2), the Android system container is operated on an Openharmony system as a client system, physical audio equipment is not directly operated, a virtual audio equipment unit is connected with a virtual audio service module operated in the Openharmony system through a network programming interface socket to initiate an inquiry request, the virtual audio service module inquires the capacity of the audio equipment through an ADM interface of the Openharmony after receiving the inquiry request and returns the capacity to the virtual audio equipment unit and the Android system container through the network programming interface socket to finish registration and capacity set report of the equipment;
step (3), android applications are clicked in the Android system container to perform audio related operation; then, transmitting the audio data of the Android application to a virtual audio equipment unit through an Android audio frame;
step (4), the virtual audio equipment unit is connected with a virtual audio service module running in the Openharmony system through a network programming interface socket;
and (5) the virtual audio service module locally creates an open common local audio stream according to the service scene and the audio attribute transmitted by the virtual audio equipment unit, and finally writes the local audio stream into physical audio equipment for playing through an audio IO (input/output) interface of the ADM after the local audio stream is mixed through the audio service of the Opencommon.
Claims (4)
1. A method for enabling audio equipment to be compatible with Openharmony and Android is characterized in that: the method comprises the following steps:
the method comprises the following steps that (1) an Android system container is started in an Openharmony system; loading the Android audio frame and each virtual audio equipment unit in the virtual audio hardware abstraction layer HAL simultaneously in the starting process of the Android system container, and acquiring the related capability of the audio equipment through the virtual audio equipment units;
step (2), the virtual audio equipment unit is connected with a virtual audio service module running in an Openharmony system through a network programming interface socket to initiate an inquiry request, the virtual audio service module inquires the capacity of the audio equipment through an ADM (advanced media management) interface of the Openharmony after receiving the inquiry request, and returns the capacity to the virtual audio equipment unit and an Android system container through the network programming interface socket to finish registration and capacity set report of the audio equipment;
clicking the Android application in the Android system container to perform audio related operation; then, transmitting the audio data of the Android application to a virtual audio equipment unit through an Android audio frame;
step (4), the virtual audio equipment unit is connected with a virtual audio service module running in the Openharmony system through a network programming interface socket;
and (5) the virtual audio service module locally creates an open harmony local audio stream according to the service scene and the audio attribute transmitted by the virtual audio equipment unit, and the local audio stream is written into physical audio equipment for playing through an audio IO interface of ADM after audio mixing is completed through the Openharmony audio service.
2. The method of claim 1, wherein the audio device is compatible with Openharmony and Android, and wherein: the virtual audio hardware abstraction layer HAL runs in an Android running environment, and comprises the following three interfaces:
the client interface of the virtual audio service module realizes connection, authentication and disconnection of links through the client interface, and the specific method comprises the following steps:
1) The client is connected with a virtual audio service module located in openharmomy through an appointed service address and a port;
2) The client sends the process name, pid, uid and gid of the client to the server, and the server judges whether authentication is successful according to the security configuration of the system;
3) The disconnection comprises normal disconnection and abnormal disconnection; the normal disconnection refers to closing the connected handle, and the abnormal disconnection refers to performing abnormal processing and closing the connected handle after the IO failure condition meets a certain condition;
opening a configuration query and closing an interface of the virtual audio device unit;
the transmission interface of the virtual audio data realizes the reading and writing of the audio data.
3. The method of claim 1, wherein the audio device is compatible with Openharmony and Android, and the method further comprises: the virtual audio service module is positioned in the audio service PulseAudio of the Openharmony system, and the virtual audio service module is used for remotely calling the virtual audio hardware abstraction layer: the method specifically comprises the following steps:
1) Connecting the virtual audio hardware abstraction layer serving as a client to the Openharmony system, and authenticating the virtual audio hardware abstraction layer to be connected in a waiting mode;
2) Managing the virtual audio hardware abstraction layer which is successfully authenticated and serves as the client, wherein the virtual audio hardware abstraction layer comprises opening, configuring, inquiring and closing requests, and the virtual audio hardware abstraction layer is returned to the virtual audio hardware abstraction layer after the operation of the physical equipment is completed by using the corresponding ADM interface;
3) For the opened virtual audio hardware abstraction layer, in a playing scene, the virtual audio hardware abstraction layer transmits the data segments played by the audio to a virtual audio service module through a socket, and the virtual audio service module uses a corresponding ADM interface to write the data segments into physical audio equipment;
4) And for the opened virtual audio hardware abstraction layer, under the recording scene, the virtual audio service module reads sampled audio data from physical audio equipment through an ADM interface and transmits the recorded data segments to the virtual audio hardware abstraction layer through a socket interface.
4. The method of claim 1, wherein the audio device is compatible with Openharmony and Android, and wherein: the method for registering and reporting the capability set to the audio equipment in the step (2) comprises the following steps:
(A) The real hardware audio equipment capability inquired out through the ADM interface is used as input, and virtual audio equipment is established in a virtual audio unit;
(B) And the Android acquires the capability of the audio equipment through the interface defined by the HAL, realizes the related HAL interface in the virtual audio unit, and returns the capability of the equipment of the virtual audio to the Android system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211004333.2A CN115373759A (en) | 2022-08-22 | 2022-08-22 | Method for making audio equipment compatible with Openharmony and Android |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211004333.2A CN115373759A (en) | 2022-08-22 | 2022-08-22 | Method for making audio equipment compatible with Openharmony and Android |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115373759A true CN115373759A (en) | 2022-11-22 |
Family
ID=84065076
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211004333.2A Pending CN115373759A (en) | 2022-08-22 | 2022-08-22 | Method for making audio equipment compatible with Openharmony and Android |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115373759A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116339870A (en) * | 2023-05-22 | 2023-06-27 | 南京美乐威电子科技有限公司 | Method for scheduling hardware interface of equipment by third-party application and audio/video processing equipment |
-
2022
- 2022-08-22 CN CN202211004333.2A patent/CN115373759A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116339870A (en) * | 2023-05-22 | 2023-06-27 | 南京美乐威电子科技有限公司 | Method for scheduling hardware interface of equipment by third-party application and audio/video processing equipment |
CN116339870B (en) * | 2023-05-22 | 2023-08-01 | 南京美乐威电子科技有限公司 | Method for scheduling hardware interface of equipment by third-party application and audio/video processing equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110166432B (en) | Method for accessing intranet target service and method for providing intranet target service | |
US6457040B1 (en) | Method and system for a distributed network computing system for providing application services | |
US8214534B2 (en) | Method and apparatus for outputting event of third party device in home network supporting UPnP remote protocol | |
WO2022127118A1 (en) | File transmission method and apparatus, and electronic device and storage medium | |
CN110335498B (en) | Parking lot barrier gate system based on block chain and information interaction method | |
CN115373759A (en) | Method for making audio equipment compatible with Openharmony and Android | |
CN111158865A (en) | Method for realizing multiplexing virtual serial port | |
JP4700204B2 (en) | Storage management data control system | |
CN102118399B (en) | Noninvasive network service remote realization method and system | |
CN116566994A (en) | Cross-chain data transmission method between blockchains, blockchain system, electronic equipment and storage medium | |
WO2021139099A1 (en) | Virtual can port multiplexing technology implementation method based on edge cloud environment | |
CN100547969C (en) | The method and data handling system and the resource management system that are used for instantaneous message communicating | |
CN103533535B (en) | A kind of remote handset card writing system and card writing method | |
CN112083914A (en) | Method and system for realizing soft bus of object model embedded operating system | |
CN114803750A (en) | UDP (user Datagram protocol) and FTP (File transfer protocol) based offline updating method and medium for elevator car display screen resources | |
KR100586046B1 (en) | Negotiation method between/of system for multimedia service | |
CN116913284B (en) | Intelligent voice interaction equipment capable of accessing internal and external networks and multiple services and interaction method | |
KR100317930B1 (en) | Apparatus and Method for constructing the CTI Telephony Driver based on TAPI/TSPI Standard | |
CN115442206B (en) | Method and system for remote deployment of GO micro-services in cloud environment | |
CN109284077A (en) | Interconnecting device and switching display methods | |
EP1246427B1 (en) | Method for managing isochronous files in a havi environment | |
CN115373927B (en) | Product testing method, device, electronic equipment and computer readable medium | |
CN115297066B (en) | Resource dynamic cooperation method, device, server and medium | |
KR101039419B1 (en) | Method for Processing Plural Call Messages | |
US20070268890A1 (en) | Integrated Telecommunication Service System |
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 |