• Home
Name Date Size #Lines LOC

..--

.github/workflows/12-May-2024-167159

alsa-info/12-May-2024-1,054905

alsaconf/12-May-2024-2,9162,479

alsactl/12-May-2024-8,4017,173

alsaloop/12-May-2024-4,1453,710

alsamixer/12-May-2024-5,9224,769

alsaucm/12-May-2024-1,4781,203

amidi/12-May-2024-947815

amixer/12-May-2024-2,3322,043

aplay/12-May-2024-3,9483,450

axfer/12-May-2024-10,9658,598

bat/12-May-2024-5,9774,620

iecset/12-May-2024-808685

include/12-May-2024-27782

m4/12-May-2024-21

po/12-May-2024-8,6256,984

seq/12-May-2024-3,9193,133

speaker-test/12-May-2024-1,6101,282

topology/12-May-2024-4,0603,000

utils/12-May-2024-12793

.gitignoreD12-May-20241,010 7370

.travis.ymlD12-May-2024679 1918

BUILD.gnD12-May-20244.2 KiB181149

COPYINGD12-May-202417.6 KiB341281

ChangeLogD12-May-20241 KiB4428

INSTALLD12-May-20241.6 KiB5739

Makefile.amD12-May-20241 KiB5548

OAT.xmlD12-May-20249.4 KiB11961

README.OpenSourceD12-May-2024382 1111

README.mdD12-May-20241.3 KiB2924

README_zh.mdD12-May-20243 KiB8674

TODOD12-May-2024187 54

acinclude.m4D12-May-2024440 1312

bundle.jsonD12-May-20241 KiB3635

configure.acD12-May-202415.8 KiB453403

gitcompileD12-May-2024705 2622

README.OpenSource

1[
2    {
3        "Name": "alsa-utils",
4        "License": "GNU GENERAL PUBLIC LICENSE",
5        "License File": "COPYING",
6        "Version Number": "1.2.6",
7        "Owner": "zhangyunhu@huawei.com",
8        "Upstream URL": "https://github.com/alsa-project/alsa-utils",
9        "Description": "This package contains the command line utilities for the ALSA project."
10    }
11]

README.md

1# alsa-utils
2## Advanced Linux Sound Architecture - Utilities
3
4![Build alsa-utils](https://github.com/alsa-project/alsa-utils/workflows/Build%20alsa-utils/badge.svg?branch=master)
5
6This package contains the command line utilities for the ALSA project.
7The package can be compiled only with the installed ALSA driver and
8the ALSA C library (alsa-lib).
9
10Utility         | Description
11----------------|----------------------------------------------------
12alsaconf	| the ALSA driver configurator script
13alsa-info       | a script to gather information about ALSA subsystem
14alsactl		| an utility for soundcard settings management
15aplay/arecord	| an utility for the playback / capture of .wav,.voc,.au files
16axfer		| an utility to transfer audio data frame (enhancement of aplay)
17amixer		| a command line mixer
18alsamixer	| a ncurses mixer
19amidi		| a utility to send/receive sysex dumps or other MIDI data
20iecset		| a utility to show/set the IEC958 status bits
21speaker-test    | a speaker test utility
22alsaloop        | a software loopback for PCM devices
23alsaucm         | Use Case Manager utility
24alsabat         | a sound tester for ALSA sound card driver
25alsatplg        | ALSA topology compiler
26
27You may give a look for more information about the ALSA project to URL
28http://www.alsa-project.org.
29

README_zh.md

1- [三方开源软件alsa-utils](#三方开源软件alsa-utils)
2  - [1. alsa-utils简介](#1-alsa-utils简介)
3  - [2. 组件引入背景简述](#2-组件引入背景简述)
4  - [3. 使用场景](#3-使用场景)
5  - [4. 为OpenHarmony带来的价值](#4-为openharmony带来的价值)
6  - [5. 如何使用](#5-如何使用)
7    - [5.1 添加编译](#51-添加编译)
8  - [5.2 常用命令的使用](#52-常用命令的使用)
9
10## 三方开源软件alsa-utils
11### 1. alsa-utils简介
12alsa-utils作为一种HDI之外的定位工具,便于问题定界、方便对HDI不熟悉的驱动移植生态伙伴使用,包含用于ALSA的命令行实用程序。
13您可以通过[ALSA官网](http://www.alsa-project.org)了解更多关于ALSA项目的信息。
14
15### 2. 组件引入背景简述
16为满足OEM生态伙伴已经支持ALSA的产品采用"ALSA兼容方案"接入OpenHarmony,而提供的命令行定位调试工具。
17
18### 3. 使用场景
19只能用于已安装ALSA驱动程序和ALSA C库(ALSA -lib)的系统中使用,且只能作为独立工具使用。
20
21### 4. 为OpenHarmony带来的价值
221. 满足OEM生态伙伴中已支持的ALSA的产品快速接入OpenHarmony诉求。
232. 降低开发者学习成本加速南向生态发展。
24
25### 5. 如何使用
26#### 5.1 添加编译
27由于alsa-utils作为调试工具默认不编译打包,您可以采用以下两种方式进行编译:
281. 如果采用Openharmony主线源码
29您可采用以下命令进行编译:
30```bash
31./build.sh --product-name [PRODUCT_NAME] --ccache --build-target third_party/alsa-utils:alsa-utils
32```
332. 如已拉出分支需要编译打包
34在现有的OpenHarmony的文档或者子系统中有如下添加方法
35方法:在您的 bundle.json 文件 添加
36```json
37"build": {
38  "sub_component": [
39  	"//third_party/alsa-utils:alsa-utils"
40  ]
41}
42```
43注意:此三方件编译需要先编译ALSA-lib
44
45### 5.2 常用命令的使用
46
47aplay放音XXX.wav音频文件,详细参数及使用请用“ -h” 查看
48
49```bash
50aplay  /data/XXX.wav
51```
52
53arecord录音test.wav,其中 -d 30表示录制30s时间, -r 44100表示rate 为44100Hz, -c 2表示为双声道立体声, -t wav表示录制的音频文件是wav格式
54
55```bash
56arecord -d 30 -f cd -r 44100 -c 2 -t wav test.wav
57```
58
59amixer命令打开录放音通路,contents用来查看各个元素(以dayu_200开发板举例),cset来设置录放音通路:
60
61```bash
62# amixer contents
63numid=2,iface=MIXER,name='Capture MIC Path'
64  ; type=ENUMERATED,access=rw------,values=1,items=4
65  ; Item #0 'MIC OFF'
66  ; Item #1 'Main Mic'
67  ; Item #2 'Hands Free Mic'
68  ; Item #3 'BT Sco Mic'
69  : values=1
70numid=1,iface=MIXER,name='Playback Path'
71  ; type=ENUMERATED,access=rw------,values=1,items=11
72  ; Item #0 'OFF'
73  ; Item #1 'RCV'
74  ; Item #2 'SPK'
75  ; Item #3 'HP'
76  ; Item #4 'HP_NO_MIC'
77  ; Item #5 'BT'
78  ; Item #6 'SPK_HP'
79  ; Item #7 'RING_SPK'
80  ; Item #8 'RING_HP'
81  ; Item #9 'RING_HP_NO_MIC'
82  ; Item #10 'RING_SPK_HP'
83  : values=6
84#amixer cset numid=1  6
85#amixer cset numid=2  1
86```