Create a multi-media Linux system on the Character Interface

Source: Internet
Author: User
0 environment and target hardware: One ThinkPad r52 notebook. Objective: To view pictures, listen to music, watch videos, and connect to the Internet over wireless in the Linux System of the character interface, it is important to listen to music programming!
Note: The system created in this article is mainly used by an engineer rather than a common Internet user. 1 system installation 1.1 minimum installation system

Download the centos 6.4-Minimal image from the official website and burn the CD installation system. The system itself supports framebuffer.

1.2 enable framebuffer

Modify the/boot/GRUB/grub. conf file and add the kernel startup parameter VGA = 791 to start the framebuffer mode.

1.3 connect to the Internet and install tools

Configure the IP address of the wired network adapter to connect to the Internet.

Yum installs pciutils and usbutils to view hardware devices.

Install wget in Yum to download the source package.

2. We want to listen to music, watch movies, watch pictures, and test the 2.1 sound card.

Yum installs ALSA-utils to test the working status of the sound card. The system itself supports the sound card of this notebook. lspci can see the sound card information.

Run the alsamixer command to adjust the volume and run aplay to play an audio file in WAV format. The sound card works properly when the sound is generated.

2.2 install mplayer in source code, supporting most audio and video files

Download the mplayer source code and CODEC library from the official website, decompress the codec library, and extract all the content in it (note that it is not the folder itself, but the content in the folder after decompression) put it under/usr/local/lib/codecs.

Download yasm, which needs to be used when compiling mplayer. I don't know why I can't download it on the official website. I finally downloaded it from csdn.

Decompress the mplayer source code and follow readme instructions to compile and install the code (no GUI is required). The compilation takes a long time and you can wait patiently.

2.3 make mplayer sound

Mplayer uses the OSS standard sound-driven interface. Therefore, it is very easy to simulate OSS using ALSA, which is as follows:

Modprobe snd_pcm_oss

Now, mplayer can play most audio and video correctly, including MP3 and rmvb.

2.4 control the position and size of the video to play

Mplayer-vo fbdev2-geometry 500: 10-zoom-x 400-y 300 somemovie. rmvb

-Vo fbdev2 is used to play a video. You can use Alt + F2 and Other switching terminals, but-vo fbdev cannot be switched.

In this way, the position in the upper left corner of the playback window is (400, 10), the window width is 300, and the height is. In this way, the played video will not block the command line. It is nice to watch the movie while working under the command line!

Let's take a look at the figure above:


2.5 check the image. First install libpng and libjpg libraries in yum, so that mgaview supports images in PNG and jpg formats. Download the mgaview source code and compile and install it. Note: there will be two errors during compilation. You can modify the source code (with brackets ). 3. We need wireless Internet access. We have installed the wireless toolkit 3.1.

Install wireless-tools and wpa_supplicant in Yum to set wireless network card access to wifi.

3.2 install wireless network card firmware

The system can correctly load the driver of the wireless network card. lspci can check the device. But you need to download the firmware file for the ipw2200-bss.fw to the/lib/firmware directory.

Run the iwconfig command to view the wireless network card information. The Wireless Network Card Name Is eth1.

3.3 Access WiFi

Run the iwlist scanning command to scan the currently visible SSID, find the desired one, and write down the Essid name for backup.

Create the/etc/my_wpa_supplicant.conf file with the following content:

Ctrl_interface =/var/run/wpa_supplicant

Network = {
SSID = "Essid name noted down above"
PSK = "wifi password"
}

Run the following command to connect to wifi

Wpa_supplicant-B-I eth1-C/etc/my_wpa_supplicant.conf

Run the following command to obtain the IP Address:

Dhclient eth1

Now, you have connected to wifi. Run the iwconfig command to check whether the connection is normal.

4. We need a serial port (required by network engineers). 4.1 prepare a USB to com adapter.

I am using a Z-TEK and the default system already has its driver, lsusb can be seen on the device. The inserted device name is/dev/ttyusb0.

4.2 install The minicom Super Terminal

Install yum.

4.3 set minicom

Run minicom-s to set the device name, speed, and other parameters and save the settings.

5. Install the dependency library with the screenshot tool fbgrab5.1.

The official website displays fbgrab dependencies and splint, LibPNG, and zlib. Here, we have installed libpng and zlib.

Splint is actually a tool for static code detection. You don't need to use the following method:

Remove the splint line in the fbgrab makefile.

5.2 compile and install fbgrab

As mentioned above, unzip the package and remove the makefile line Sino-German splint. directly make and make install.

The following command can be used to complete screenshots and save them as PNG files. Fbgrab storage path/image name .png.

This is done in the vicinity of this Article. To avoid damaging the image display, you can use the-S parameter of fbgrab or use SSH for remote login.

6. We want to use Chinese Characters

Note: In the character interface, we recommend that you use more English and try to use less or even less Chinese.

In framebuffer, the Chinese character terminals are zhcon and CCE. I installed zhcon and thought it was enough, so I didn't install CCE.

6.1 download zhcon and install patches

Zhcon has not been updated for a long time and remains in version 0.2.6. In addition, it is patched and upgraded in 0.2.5.

# Tar zxvf zhcon-0.2.5.tar.gz
# Gunzip zhcon-0.2.5-to-0.2.6.diff.gz
# Cd zhcon-0.2.5/
# Patch-P1 <../zhcon-0.2.5-to-0.2.6.diff

6.2 annoying compilation troubleshooting Process

The compilation process was not smooth, and many errors were found. Fortunately, the solution was found on the Internet, which may be changed as follows:

(1) If a memset or memcpy error is reported, # include <string. h> or # include <cstring>

(2) An ABS, atoi, and free error is reported. # include <stdlib. h> # include <algorithm>

(3) If term. h cannot be found, install the ncurses-devel library.

(4) If a tgetent error is reported, before./configure, export libs = "-lncurses"

(5) If an if_mask error is reported
# Define vif_mask 0x00080000
# Define if_mask 0x00000200
# Define iopl_mask 0x00003000
# Define tf_mask 0x00000100


(6) If there are other errors, Google. Baidu is hard to find a proper answer.

6.3 use zhcon for UTF-8 encoding

Zhcon -- utf8

7. You must note that you can only browse simple web pages in character mode. The main purpose is to find some download links. Do not try complex web pages! On the Character interface, Webpage Browsing is mainly lynx and w3m. After lynx is installed, w3m is not installed. 7.1 install lynxyum install lynx7.2 lynx and zhcon in yum

Zhcon -- utf8

Lynx www. Baidu. com8: Let's program it. Let's explain it in C/C ++. 8.1 use GCC for the compiler and makelinux. Do not forget make for automated compilation. Yum installation is extremely convenient. 8.2 editor Emacs and Vim are the most popular editors. I am used to VIM myself. Install yum. Vim is so powerful. I will not talk about it here, but there will be one later. Appendix: Number of system operations

Figure 0 run the alsamixer command to test and adjust the sound card


Figure 1 run the mplayer-zoom-x 400-y 300 audio and video file. rmvb

Figure 2 run the mgaview Image File Name


Figure 3 run zhcon -- utf8 to enter the Chinese terminal, and press CTRL + ALT + space to start the Chinese input method.


Figure 4 run the command zhcon -- utf8 and then Lynx www.baidu.com


Figure 5 Vim code editing



VESA compatible mode:

Depth 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
4 bits ? ? Zero X 302 ? ? ? ?
8 bits Zero X 300 Zero X 301 Zero X 303 Zero X 305 Zero X 161 Zero X 307 0x31c
15 bits ? Zero X 310 Zero X 313 Zero X 316 Zero x 162 Zero X 319 0x31d
16 bits ? Zero X 311 Zero X 314 Zero X 317 Zero X 163 0x31a 0x31e
24 bits ? Zero X 312 Zero x 315 Zero X 318 ? 0x31b 0x31f
32 bits ? ? ? ? Zero X 164 ? ?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.