[ 移植 ] ___ Utils : Alsa
生活随笔
收集整理的這篇文章主要介紹了
[ 移植 ] ___ Utils : Alsa
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
[ 移植 ] ___ Utils : Alsa
- 簡介
- 下載
- 配置
- 安裝
- 查看
- 移植
- 測試
- 資料
簡介
- 包含ALSA項目的命令行實用程序;
- 只能使用已安裝的Alsa驅動程序和Alsa C庫(alsa-lib)進行編譯。
| alsaconf | ALSA驅動程序配置腳本 |
| alsa-info | 用于收集有關ALSA子系統信息的腳本 |
| alsactl | 聲卡設置管理實用程序 |
| aplay/arecord | 播放/捕獲.wav,.voc,.au文件的實用程序 |
| axfer | 傳輸音頻數據幀的實用程序(aplay的增強) |
| amixer | 命令行混合器 |
| alsamixer | 界面混合器 |
| amidi | 用于發送/接收sysex轉儲或其他MIDI數據的實用程序 |
| iecset | 顯示/設置IEC958狀態位的實用程序 |
| speaker-test | 揚聲器測試實用程序 |
| alsaloop | PCM設備的軟件環回 |
| alsaucm | 用例管理器實用程序 |
| alsabat | ·ALSA聲卡驅動的聲音測試器 |
| alsatplg | ALSA拓撲編譯器 |
下載
Alsa Utils最新源碼包可以從官網提供的鏈接下載
配置
注意:我們從當前源碼包的自述文件得知,我們在移植前,需要把Alsa C 庫做為依賴環境,才能編譯當前命令行實用程序源碼包,So,準備工作如下:
- ___ Library : Alsa
- --with-alsa-inc-prefix指定了交叉編譯util應用所需要的alsa-lib的頭文件
- --with-alsa-prefix指定了交叉編譯util應用所需要的alsa-lib的庫文件;
- --disable-alsamixer表示不編譯生成alsamixer這個應用程序,因為該程序依賴于ncurses這個圖形界面庫,目前我們使用的是命令行級別的。
安裝
linux@localhost:~/alsa-utils-1.2.6$ make linux@localhost:~/alsa-utils-1.2.6$ sudo make install
查看
linux@localhost:~/alsa2arm$ ls -la total 0 drwxr-xr-x 1 linux linux 4096 Jan 13 23:41 . drwxr-xr-x 1 linux linux 4096 Jan 13 22:13 .. drwxr-xr-x 1 root root 4096 Jan 13 23:41 bin drwxr-xr-x 1 root root 4096 Jan 13 23:39 include drwxr-xr-x 1 root root 4096 Jan 13 23:39 lib drwxr-xr-x 1 root root 4096 Jan 13 23:41 sbin drwxr-xr-x 1 root root 4096 Jan 13 23:41 share linux@localhost:~/alsa2arm$ tree . ├── bin │ ├── aconnect │ ├── alsabat │ ├── alsaloop │ ├── alsatplg │ ├── alsaucm │ ├── amidi │ ├── amixer │ ├── aplay │ ├── aplaymidi │ ├── arecord -> aplay │ ├── arecordmidi │ ├── aseqdump │ ├── aseqnet │ ├── aserver │ ├── axfer │ ├── iecset │ └── speaker-test ├── include │ ├── alsa │ │ ├── asoundef.h │ │ ├── asoundlib.h │ │ ├── conf.h │ │ ├── control.h │ │ ├── control_external.h │ │ ├── control_plugin.h │ │ ├── error.h │ │ ├── global.h │ │ ├── hwdep.h │ │ ├── input.h │ │ ├── mixer.h │ │ ├── mixer_abst.h │ │ ├── output.h │ │ ├── pcm.h │ │ ├── pcm_external.h │ │ ├── pcm_extplug.h │ │ ├── pcm_ioplug.h │ │ ├── pcm_old.h │ │ ├── pcm_plugin.h │ │ ├── pcm_rate.h │ │ ├── rawmidi.h │ │ ├── seq.h │ │ ├── seq_event.h │ │ ├── seq_midi_event.h │ │ ├── seqmid.h │ │ ├── sound │ │ │ ├── asoc.h │ │ │ ├── asound_fm.h │ │ │ ├── emu10k1.h │ │ │ ├── hdsp.h │ │ │ ├── hdspm.h │ │ │ ├── sb16_csp.h │ │ │ ├── sscape_ioctl.h │ │ │ ├── tlv.h │ │ │ ├── type_compat.h │ │ │ └── uapi │ │ │ ├── asoc.h │ │ │ ├── asound_fm.h │ │ │ ├── emu10k1.h │ │ │ ├── hdsp.h │ │ │ ├── hdspm.h │ │ │ ├── sb16_csp.h │ │ │ ├── sscape_ioctl.h │ │ │ └── tlv.h │ │ ├── timer.h │ │ ├── topology.h │ │ ├── use-case.h │ │ └── version.h │ ├── asoundlib.h │ └── sys │ └── asoundlib.h ├── lib │ ├── libasound.la │ ├── libasound.so -> libasound.so.2.0.0 │ ├── libasound.so.2 -> libasound.so.2.0.0 │ ├── libasound.so.2.0.0 │ ├── libatopology.la │ ├── libatopology.so -> libatopology.so.2.0.0 │ ├── libatopology.so.2 -> libatopology.so.2.0.0 │ ├── libatopology.so.2.0.0 │ └── pkgconfig │ ├── alsa-topology.pc │ └── alsa.pc ├── sbin │ ├── alsa-info.sh │ ├── alsabat-test.sh │ ├── alsaconf │ └── alsactl ├── share │ ├── aclocal │ │ └── alsa.m4 │ ├── alsa │ │ ├── init │ │ │ ├── 00main │ │ │ ├── ca0106 │ │ │ ├── default │ │ │ ├── hda │ │ │ ├── help │ │ │ ├── info │ │ │ └── test │ │ └── speaker-test │ │ └── sample_map.csv │ ├── locale │ │ ├── de │ │ │ └── LC_MESSAGES │ │ │ └── alsa-utils.mo │ │ ├── eu │ │ │ └── LC_MESSAGES │ │ │ └── alsa-utils.mo │ │ ├── fr │ │ │ └── LC_MESSAGES │ │ │ └── alsa-utils.mo │ │ ├── ja │ │ │ └── LC_MESSAGES │ │ │ ├── alsa-utils.mo │ │ │ └── alsaconf.mo │ │ ├── ru │ │ │ └── LC_MESSAGES │ │ │ └── alsaconf.mo │ │ └── sk │ │ └── LC_MESSAGES │ │ └── alsa-utils.mo │ ├── man │ │ ├── fr │ │ │ └── man8 │ │ │ └── alsaconf.8 │ │ ├── man1 │ │ │ ├── aconnect.1 │ │ │ ├── alsa-info.sh.1 │ │ │ ├── alsabat.1 │ │ │ ├── alsactl.1 │ │ │ ├── alsaloop.1 │ │ │ ├── amidi.1 │ │ │ ├── amixer.1 │ │ │ ├── aplay.1 │ │ │ ├── aplaymidi.1 │ │ │ ├── arecord.1 -> aplay.1 │ │ │ ├── arecordmidi.1 │ │ │ ├── aseqdump.1 │ │ │ ├── aseqnet.1 │ │ │ ├── axfer-list.1 │ │ │ ├── axfer-transfer.1 │ │ │ ├── axfer.1 │ │ │ ├── iecset.1 │ │ │ └── speaker-test.1 │ │ ├── man7 │ │ └── man8 │ │ └── alsaconf.8 │ └── sounds │ └── alsa │ ├── Front_Center.wav │ ├── Front_Left.wav │ ├── Front_Right.wav │ ├── Noise.wav │ ├── Rear_Center.wav │ ├── Rear_Left.wav │ ├── Rear_Right.wav │ ├── Side_Left.wav │ └── Side_Right.wav └── usr└── local└── share├── alsa.conf├── cards│ ├── AACI.conf│ ├── ATIIXP-MODEM.conf│ ├── ATIIXP-SPDMA.conf│ ├── ATIIXP.conf│ ├── AU8810.conf│ ├── AU8820.conf│ ├── AU8830.conf│ ├── Audigy.conf│ ├── Audigy2.conf│ ├── Aureon51.conf│ ├── Aureon71.conf│ ├── CA0106.conf│ ├── CMI8338-SWIEC.conf│ ├── CMI8338.conf│ ├── CMI8738-MC6.conf│ ├── CMI8738-MC8.conf│ ├── CMI8788.conf│ ├── CS46xx.conf│ ├── EMU10K1.conf│ ├── EMU10K1X.conf│ ├── ENS1370.conf│ ├── ENS1371.conf│ ├── ES1968.conf│ ├── Echo_Echo3G.conf│ ├── FM801.conf│ ├── FWSpeakers.conf│ ├── FireWave.conf│ ├── GUS.conf│ ├── HDA-Intel.conf│ ├── HdmiLpeAudio.conf│ ├── ICE1712.conf│ ├── ICE1724.conf│ ├── ICH-MODEM.conf│ ├── ICH.conf│ ├── ICH4.conf│ ├── Loopback.conf│ ├── Maestro3.conf│ ├── NFORCE.conf│ ├── PC-Speaker.conf│ ├── PMac.conf│ ├── PMacToonie.conf│ ├── PS3.conf│ ├── RME9636.conf│ ├── RME9652.conf│ ├── SB-XFi.conf│ ├── SI7018.conf│ ├── TRID4DWAVENX.conf│ ├── USB-Audio.conf│ ├── VIA686A.conf│ ├── VIA8233.conf│ ├── VIA8233A.conf│ ├── VIA8237.conf│ ├── VX222.conf│ ├── VXPocket.conf│ ├── VXPocket440.conf│ ├── YMF744.conf│ ├── aliases.conf│ ├── pistachio-card.conf│ └── vc4-hdmi.conf├── ctl│ └── default.conf└── pcm├── center_lfe.conf├── default.conf├── dmix.conf├── dpl.conf├── dsnoop.conf├── front.conf├── hdmi.conf├── iec958.conf├── modem.conf├── rear.conf├── side.conf├── surround21.conf├── surround40.conf├── surround41.conf├── surround50.conf├── surround51.conf└── surround71.conf41 directories, 202 files linux@localhost:~/alsa2arm$ cd bin linux@localhost:~/alsa2arm/bin$ file aplay aplay: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
移植
將所需要的文件打包
linux@localhost:~/alsa2arm$ tar zcvf alsa2arm.tar.gz bin lib sbin usr在開發板當中將壓縮包解壓至指定位置并賦予實用程序執行權限
root@arm:~# tar zxvf alsalib2arm.tar.gz -C / root@arm:~# chmod +x /bin/*測試
- 錄制;
- arecord是命令行ALSA聲卡驅動的錄音程序,支持多種文件格式和多個聲卡,常用參數講解:
-d,–duration=# interrupt after # seconds —> 錄音的秒數
-c,–channels=# channels —> 音軌
-r,–rate=# sample rate —> 采樣頻率
-t,–file-type TYPE file type (voc, wav, raw or au) —> 封裝的格式
-f,–format=FORMAT sample format (case insensitive) —> 量化位數
-M,–mmap mmap流 —> 以內存映射的方式進行錄音
- 播放;
aplay是命令行播放工具,支持多種文件格式,當然,我們還可以通過arecord --help和aplay --help查看詳細參數講解。
資料
AlsaProjectGitHub
總結
以上是生活随笔為你收集整理的[ 移植 ] ___ Utils : Alsa的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 时间序列模型是什么?
- 下一篇: 个人微信号API接口,微信机器人