當前位置: 首頁 > 工業(yè)電子產(chǎn)品 > 其他電子產(chǎn)品 > 開發(fā)板,套件,編程器 > 開發(fā)板
發(fā)布日期:2022-10-14 點擊率:66
我司自組網(wǎng)產(chǎn)品測試過程中,經(jīng)常使用madplay來測試聲卡功能是否正常。老產(chǎn)品大多采用了Qualcomm Atheros AR9344處理器,已經(jīng)有現(xiàn)成的固件集成了madplay;這次的新產(chǎn)品采用了Qualcomm Atheros的QCA9558處理器,需要臨時編譯一個固件,才能測試聲卡。在OpenWRT目錄下,使用make menuconfig,勾選Sound - -> madplay,如下圖
保存配置后直接使用make V=s 命令進行編譯,會遇到如下問題
make[6]: Entering directory `/home/lics/data/code/ars-mb-a1/build_dir/target-mips_34kc_uClibc-0.9.33.2/alsa-lib-1.1.0/src/topology' CC parser.lo parser.c: In function 'snd_tplg_build_file': parser.c:262:35: error: 'S_IRUSR' undeclared (first use in this function) open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); ^ parser.c:262:35: note: each undeclared identifier is reported only once for each function it appears in parser.c:262:45: error: 'S_IWUSR' undeclared (first use in this function) open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); ^ parser.c: In function 'snd_tplg_build': parser.c:330:35: error: 'S_IRUSR' undeclared (first use in this function) open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); ^ parser.c:330:45: error: 'S_IWUSR' undeclared (first use in this function) open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); ^ make[6]: *** [parser.lo] Error 1
如下圖
很明顯,這個錯誤是在編譯alsa-lib過程中出現(xiàn)的。
ALSA是Advanced Linux Sound Architecture,高級Linux聲音架構(gòu)的簡稱,它在Linux操作系統(tǒng)上提供了音頻和MIDI(Musical Instrument Digital Interface,音樂設(shè)備數(shù)字化接口)的支持。在2.6系列內(nèi)核中,ALSA已經(jīng)成為默認的聲音子系統(tǒng),用來替換2.4系列內(nèi)核中的OSS(Open Sound System,開放聲音系統(tǒng))。ALSA的主要特性包括:高效地支持從消費類入門級聲卡到專業(yè)級音頻設(shè)備所有類型的音頻接口,完全模塊化的設(shè)計, 支持對稱多處理(SMP)和線程安全,對OSS的向后兼容,以及提供了用戶空間的alsa-lib庫來簡化應用程序的開發(fā)。
可見,madplay用到了alsa-lib庫,問題就出在這里。查看了一下AR9344中的代碼,發(fā)現(xiàn)當時針對這個問題做了個補丁,如下
--- a/src/topology/parser.c +++ b/src/topology/parser.c @@ -18,6 +18,7 @@ #include "list.h" #include "tplg_local.h" +#include <sys/stat.h> /* * Parse compound
將AR9344代碼中的這個補丁移動至QCA9558代碼中的對應目錄,make clean之后再重新make,以上問題不再出現(xiàn)。將編譯得到的固件下載至QCA9558板卡中,madplay命令正常運行,如下圖
附上這個補丁給需要的讀者
0001-topology-Add-missing-include-sys-stat.h-by-zencheer.patch
這個補丁需要放置在如下目錄
feeds/packages/libs/alsa-lib/patches/
最后,附上madplay的簡介
madplay is a command-line MPEG audio decoder and player based on the MAD library (libmad). MAD is a high-quality MPEG audio decoder. It currently supports MPEG-1 and the MPEG-2 extension to Lower Sampling Frequencies, as well as the so-called MPEG 2.5 format. All three audio layers (Layer I, Layer II, and Layer III a.k.a. MP3) are fully implemented.
下一篇: PLC、DCS、FCS三大控
上一篇: Dell T7810 安裝Ubunt