Kernel version: Kernel 2.6.28.6 compiled by the menuconfig configuration file top6410_3d.config (if you use the old version of 28 kernel or use the default menuconfig configuration file for compilation, the Alsa recording will not sound)
File System Version: ubifs in the old version.
ALSA-lib version: 1.0.9
ALSA-util version: 1.0.9a
Other versions of ALSA-lib and ALSA-util cannot guarantee normal operation
After the previous versions of the kernel and ubifs have been successfully installed to 6410 (you can also use TFTP to download the kernel and NFS to mount ubifs In the debugging phase), start the following work:
First, cross-compile ALSA-lib and ALSA-util on Ubuntu.
1.decompress alsa-lib-1.0.9.tar and enter the decompressed directory.
2. Use commands
./Configure -- Host = arm-None-Linux-gnueabi -- prefix =/usr/share/ARM-ALSA
TIPS: -- The host parameter specifies that the cross compiler is "arm-None-Linux-gnueabi-GCC". Therefore, you must ensure that the cross compiler is successfully configured. www.linuxidc.com can be directly called in shell; the -- prefix parameter specifies the target installation directory of ALSA-lib, and the subsequent ALSA-util configuration is the same.
3. Use commands
Make
Sudo make install
TIPS: make install sudo must be added, because some directories will be created during the install process.
4.decompress alsa-util-1.0.9a.tar and enter the extracted directory.
5. Use commands
. /Configure -- Host = arm-None-Linux-gnueabi -- prefix =/usr/share/ARM-ALSA -- With-ALSA-inc-Prefix =/usr/share/ARM-ALSA /include -- With-ALSA-Prefix =/usr/share/ARM-ALSA/lib -- disable-alsamixer
TIPS: -- With-ALSA-inc-prefix and -- With-ALSA-Prefix specify the header files and library files required for cross-compiling util applications; -- disable-alsamixer indicates that the alsamixer application is not compiled and generated, because the program depends on the ncurses GUI library. Currently, we cannot cross-compile the library, so we give up
6. Use commands
Touch alsaconf/po/t-ja.gmo
Avoid making errors later
7. Use commands
Make
Sudo make install
So far, all work on Ubuntu has ended.
Then deploy the cross-compiled ALSA-lib and ALSA-util on 6410.
For ease of understanding, set the 6410 root directory to $ rootfs
1. Move all files under the Alsa installation directory in Ubuntu to the corresponding directory of 6410 (the absolute path must be consistent) and run the following command:
Sudo CP-r/usr/share/ARM-ALSA $ rootfs/usr/share/
2. Move the cross-compiled ALSA library under the Alsa installation directory to the default library search directory in 6410 and use the command
Sudo CP-r $ rootfs/usr/share/ARM-ALSA/lib/* $ rootfs/lib/
3. Move the cross-compiled ALSA-util application under the Alsa installation directory to the 6410 Default Application search directory and use the command
Sudo CP-r $ rootfs/usr/share/ARM-ALSA/bin/* $ rootfs/usr/sbin/
Sudo CP-r $ rootfs/usr/share/ARM-ALSA/sbin/* $ rootfs/usr/sbin/
4. Edit $ rootfs/etc/init. d/RCs and add the following lines:
[Plain]
- # Alsa_init
- Mkdir/dev/SND
- Ln/dev/controlc0/dev/snd/controlc0
- Ln/dev/pcmc0d0c/dev/snd/pcmc0d0c
- Ln/dev/pcmc0d0p/dev/snd/pcmc0d0p
- Ln/dev/Timer/dev/snd/Timer
- Amixer cset numid = 86 2
- Amixer cset numid = 87 2
TIPS: The two commands of amixer change the default values of 'left capture source' and 'right capture source' of amixer to 'line ', otherwise, the Alsa recording has no sound.
5. Edit $ rootfs/etc/profile and add the following two lines:
[Plain]
- # Alsa_init
- Export alsa_config_path =/usr/share/ARM-ALSA/share/ALSA. conf
TIPS: The environment variable value must be consistent with the Alsa installation directory. Otherwise, an error is reported when aplay and arecord are used.
Now the transplantation of ALSA-lib and ALSA-util is complete.
Test
1. test whether the video can be played normally. Run the following command:
Aplay test1.wav
Test1.wav is a normal recorded audio file.
2. test whether the recording can be normal. Use the command
Arecord-D 10-fdat test2.wav
-D indicates that the recording time is 10 seconds, and-fdat indicates that the recording is based on the DAT quality (the sampling rate, audio channel, and other parameters are determined)