简体   繁体   English

将Alsa移植到Android

[英]Port Alsa to Android

I'm trying to add the usb audio function for my android phone. 我正在尝试为我的Android手机添加USB音频功能。 Is it possible that as long as I can add all the alsa driver to my android system and then i can get what i want? 是否有可能,只要我可以将所有alsa驱动程序添加到我的android系统中,然后我就能得到我想要的? Can anyone give me some hints on how android is using alsa and how I can add alsa kernel modules to existing system? 谁能给我一些有关android如何使用alsa以及如何将alsa内核模块添加到现有系统的提示?

Thank you. 谢谢。

@James, the android platform already includes alsa for its audio sub system as a standard and you do not need to add it yourself. @ James,Android平台已经将alsa作为其音频子系统的标准配置,您无需自己添加。 If you have a rooted phone or a branded phone you can connect your phone to your network and using the ip address connect it your development system: adb connect IP-address:5555 , the easiest way to check will be to use adb to connect to your phone 如果您的电话是根电话或品牌电话,则可以将电话连接到网络,并使用ip地址将其连接到开发系统:adb connect IP-address:5555,最简单的检查方法是使用adb连接到您的手机

You can verify the existences of alsa by going into the /proc directory. 您可以通过进入/ proc目录来验证alsa的存在。 You will find a file called devices. 您会找到一个名为devices的文件。 If you cat the devices file you should see under character devices alsa with device ID 116 如果对设备文件进行分类,您应该在字符设备alsa下看到设备ID为116的设备

Also inside the /proc directory you should find another directory called asound. 同样在/ proc目录中,您应该找到另一个名为asound的目录。 Go into that directory and do a listing ls -l. 进入该目录并列出ls -l。 You will notice all the sound devices - sound cards, including the SPDIF, HDMI and sound codes used by your android device. 您会注意到所有声音设备-声卡,包括您的Android设备使用的SPDIF,HDMI和声音代码。 All these devices are controlled by alsa. 所有这些设备均由alsa控制。

If you unplug your usb device you will notice that the listing in the asound directory changes. 如果拔下USB设备,则会注意到asound目录中的列表已更改。 Alsa manages all the audio functions including playback and recording of audio on your android device. Alsa管理所有音频功能,包括在Android设备上播放和录制音频。

I hope this non technical overview helps. 希望这篇非技术性的概述对您有所帮助。 By all means if you have more questions feel free to ask 如果您有更多问题,请随时提出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM