Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: Gentoo Users List <gentoo-user@l.g.o>
Subject: [gentoo-user] Finally got my Acer Aspire 4551 notebook 100% functional
Date: Tue, 22 Feb 2011 18:04:15
Message-Id: 20110222175158.GB11268@waltdnes.org
1 I finally got my Acer 4551 100% functional under 64-bit Gentoo linux.
2 Thanks to various people on various linux forums who spelled out the
3 answers, and also to "Mr. Google" for helping me find them. There are
4 sevaral tweaks that are required to get things working. I'll
5 concentrate on the stuff that's not obvious/intuiutive. Unless
6 otherwise specified, everything here is an entry in "make menuconfig",
7 setting up the kernel. Here it is...
8
9 1)
10 Getting USB mice and keyboards and other low-speed USB devices to work.
11 Device Drivers --->
12 [*] USB support --->
13 <*> EHCI HCD (USB 2.0) support
14 <*> OHCI HCD support
15
16 Notice that in addition to EHCI (USB 2.0), I've specified OHCI (USB1.1)
17 support. Low-speed USB peripherals (e.g. external mice and keybords)
18 and older USB peripherals in general *MUST* have this driver to work. I
19 know that the "Root Hub Transaction Translators" item is *SUPPOSED* to
20 provide OHCI support via the EHCI driver. But for this machine, it
21 doesn't work.
22
23 2)
24 The Broadcomm chip/nic requires "PHY Device support" *IN ADDITION TO*
25 the expected driver entry. It doesn't work without the PHY driver.
26 Device Drivers --->
27 [*] Network device support --->
28 -*- PHY Device support and infrastructure --->
29 <*> Drivers for Broadcom PHYs
30
31 The standard entry is also required...
32
33 Device Drivers --->
34 [*] Network device support --->
35 [*] Ethernet (1000 Mbit) --->
36 <*> Broadcom Tigon3 support
37
38 The wireless is pretty standard, using the ath9k module.
39
40 3)
41 Power management could be a wiki article all on its own. First, the
42 kernel setup. Recompile and reboot after the following two areas are
43 set...
44
45 Power management and ACPI options --->
46 [*] Power Management support
47 [*] ACPI (Advanced Configuration and Power Interface) Support --
48 [*] Deprecated /proc/acpi files
49 [*] Deprecated power /proc/acpi directories
50 [*] Future power /sys interface
51 [*] Deprecated /proc/acpi/event support
52 <*> AC Adapter
53 <*> Battery
54 <*> Button
55 <*> Fan
56 <*> Dock
57 <*> Processor
58 <*> Processor Aggregator
59 <*> Thermal Zone
60 <*> Smart Battery System
61
62 Build the performance/powersave/userspace/ondemand/conservative
63 governors into the kernel. Make "conservative" the default governor.
64
65 Power management and ACPI options --->
66 [*] Power Management support
67 CPU Frequency scaling --->
68 [*] CPU Frequency scaling
69 [*] Enable CPUfreq debugging
70 < > CPU frequency translation statistics
71 Default CPUFreq governor (conservative) --->
72 -*- 'performance' governor
73 <*> 'powersave' governor
74 <*> 'userspace' governor for userspace frequency scaling
75 -*- 'ondemand' cpufreq policy governor
76 <*> 'conservative' cpufreq governor
77 *** CPUFreq processor drivers ***
78 < > Processor Clocking Control interface driver
79 <*> ACPI Processor P-States driver
80 <*> AMD Opteron/Athlon64 PowerNow
81
82 * Then install "cpufrequtils"
83
84 * Then set up a couple of configuration files. First, use ACPI to
85 detect power status. When the machine switches to battery power,
86 select "powersave" governor. When the machine switches to AC power,
87 select "conservative" governor. Note that the lines below are *NOT*
88 the complete "/etc/acpi/default.sh". *DO NOT DELETE THE REST OF THE
89 FILE!* I am simply including only the relevant portion of the file.
90 The following lines are near the bottom of the default version of...
91
92 /etc/acpi/default.sh
93 ====================
94 ac_adapter)
95 case "$value" in
96 # Add code here to handle when the system is unplugged
97 # (maybe change cpu scaling to powersave mode). For
98 # multicore systems, make sure you set powersave mode
99 # for each core!
100 *0)
101 cpufreq-set -c0 -g powersave
102 cpufreq-set -c1 -g powersave
103 ;;
104
105 # Add code here to handle when the system is plugged in
106 # (maybe change cpu scaling to performance mode). For
107 # multicore systems, make sure you set performance mode
108 # for each core!
109 *1)
110 cpufreq-set -c0 -g conservative
111 cpufreq-set -c1 -g conservative
112 ;;
113
114 *) log_unhandled $* ;;
115 esac
116 ;;
117
118 * That takes care of what to do when the AC adaptor state changes. But
119 what about at bootup? There isn't an "AC adaptor event" at bootup, so
120 we have to check the power status directly, and select the governor as
121 required. The standard location for custom bootup scripting is
122 /etc/conf.d/local.start
123
124 /etc/conf.d/local.start
125 =======================
126 # Check whether AC adapter is plugged in, and set governor accordingly
127 ac_state=`cat /sys/class/power_supply/ADP1/online`
128 if [ ${ac_state} -eq 1 ]; then
129 cpufreq-set -c0 -g conservative
130 cpufreq-set -c1 -g conservative
131 else
132 cpufreq-set -c0 -g powersave
133 cpufreq-set -c1 -g powersave
134 fi
135
136 4)
137 Setting up the video. This is based on instructions found at
138 http://www.gentoo.org/doc/en/xorg-config.xml The "new world order" in
139 linux video drivers seems to be that the framebuffer is built directly
140 into the driver itself. Therefore card-specific framebuffer driver
141 support *MUST* be disabled, but console framebuffer support *MUST* be
142 enabled, like so...
143
144 Device Drivers --->
145 Graphics support --->
146 Support for frame buffer devices --->
147 (Disable all drivers, including VGA, Intel, nVidia, and ATI)
148
149 (Further down, enable basic console support. KMS uses this.)
150 Console display driver support --->
151 <*> Framebuffer Console Support
152
153 To enable Radeon KMS support...
154 Device Drivers --->
155 Graphics support --->
156 <*> Direct Rendering Manager --->
157 <*> ATI Radeon
158 [*] Enable modesetting on radeon by default
159
160 Point to the firmware blob to be loaded into the kernel to enable
161 hardware acceleration...
162 Device Drivers --->
163 Generic Driver Options --->
164 [*] Include in-kernel firmware blobs in kernel binary
165 (radeon/R600_rlc.bin) External firmware blobs to build into the kernel
166 (/lib/firmware/) Firmware blobs root directory
167
168
169 Next, we have to download and install the firmware blob that enables
170 hardware acceleration for the onboard graphics chip. In Gentoo linux,
171 the command is "emerge radeon-ucode". Similar commands should exist in
172 most distros. If not, you can download the blob files directly from
173 http://people.freedesktop.org/~agd5f/radeon_ucode/ into directory
174 /lib/firmware/radeon on your Acer Aspire 4551. Create that directory if
175 it doesn't already exist. Your machine should only need one of the
176 files in the directory but it doesn't hurt to download all of them. In
177 my case, it's the R600_rlc.bin file. This should be true for most Acer
178 Aspire 4551 models, but a newer video chip may be inserted in future
179 production runs, which requires a different blob file.
180
181 And now for a little bonus... usable text consoles. With the new KMS
182 video drivers the text console defaults to native graphics resolution,
183 which is 1366x768 for the Acer Aspire 4551. Some quick division shows
184 that the default 8x16 VGA font will result in an unreadably crowded 170
185 columns x 48 rows display. But you can select any other supported mode
186 found in /var/log/Xorg.0.log. One valid mode is 640x480. We can put
187 the option "video=640x480" in the "append" line of /etc/lilo.conf, or in
188 the equivalant area of the GRUB loader. The text consoles will be
189 640x480, but X will remain at 1366x768. The default 8x16 VGA font will
190 result in a perfectly readable 80 columns x 30 rows display on text
191 consoles.
192
193 As they say in the infomercials... but wait, there's more. If you cd
194 to /usr/share/consolefonts and execute "ls -1 lat1*", you'll get...
195 lat1-08.psfu.gz
196 lat1-10.psfu.gz
197 lat1-12.psfu.gz
198 lat1-14.psfu.gz
199 lat1-16.psfu.gz
200
201 These fonts are all 8 pixels wide, so that results in a 640 / 8 = 80
202 column display. The vertical size differs for each font. If you
203 execute "setfont lat1-08" at a text console, you'll get a hard-to-read
204 80 columns x 60 rows display. If you execute "setfont lat1-10", you'll
205 get a crisp 80 x 48 text display. "setfont lat1-12" gives an 80 x 40
206 display, and "setfont lat1-14" gives an 80 x 34 text display. By the
207 way, 8x8 is the ancient CGA font, and 8x14 is the old EGA font. To have
208 the desired font come up at bootup, enter it in /etc/conf.d/consolefont
209 In my case, I have the line...
210
211 CONSOLEFONT="lat1-10"
212
213 in /etc/conf.d/consolefont. In combination with "video=640x480", this
214 gives an 80 columns x 48 rows text display. Which one you choose
215 depends on personal taste, and how good your eyesight is. Note that I
216 used "lat1" as an example. You can use another available encoding if
217 you desire.
218
219 6)
220 The webcam does not show up under the "lspci"command. Rather, it seems
221 to be internally hooked up to a USB connector. On my machine, the
222 output of the command "lsusb" includes the line...
223
224 Bus 002 Device 003: ID 064e:a219 Suyin Corp.
225
226 That's a "Suyin Crystal Eye" webcam. Here are the items that need to
227 be selected in the kernel...
228
229 Device Drivers --->
230 <*> Multimedia support --->
231 <*> Video For Linux
232 [*] Enable Video For Linux API 1 compatible Layer
233 [*] Video capture adapters --->
234 [*] Autoselect pertinent encoders/decoders and other helper chi
235 [*] V4L USB devices --->
236 <*> USB Video Class (UVC)
237 [*] UVC input events device support
238
239 Note that with UVC functionality implemented in newer kernels, you do
240 *NOT* need to install the linux-uvc library separately.
241
242 Depending on whether you have the necessary codecs built in, you can
243 display video from the webcam with...
244 mplayer tv:// -tv driver=v4l2:device=/dev/video0
245
246 ...or record to disk with a command like...
247 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
248
249
250
251 7)
252 The kernel configs I used for setting up sound playback and recording
253 are as follows. Note that you *MUST BUILD "Sound card support" AS A
254 MODULE*. I don't know why this is the case, but I couldn't get the
255 microphone to work if I didn't do it this way. If you're *ABSOLUTELY
256 100% CERTAIN* that you won't be using OSS compatability support, you can
257 drop the OSS items listed below. I keep them, because devices are more
258 reasonably named in OSS than in ALSA. Note the 2 audio codecs. The
259 Realtek codec is for the sound chip. The ATI HDMI codec is for audio
260 output from the video card (YES!). The HDMI spec handles audio and
261 video via one cable, and the Acer 4554 does have an HDMI output port
262 (not DVI, but you can get adaptor cables).
263
264 Device Drivers --->
265 <M> Sound card support --->
266 [*] Preclaim OSS device numbers
267 <M> Advanced Linux Sound Architecture --->
268 <M> Sequencer support
269 <M> Sequencer dummy client
270 <M> OSS Mixer API
271 <M> OSS PCM (digital audio) API
272 [*] OSS PCM (digital audio) API - Include plugin system
273 [*] OSS Sequencer API
274 [*] Verbose procfs contents
275 [*] PCI sound devices --->
276 <M> Intel HD Audio --->
277 [*] Build Realtek HD-audio codec support
278 [*] Build ATI HDMI HD-audio codec support
279
280
281 In order to be able to record from the microphone, you *MUST TURN ON
282 CAPTURE MODE*. The attached screen capture is from the "alsamixer"
283 utility, which is run from the command line. After starting alsamixer,
284 press {F5} to display all devices/controls. I stretched the xterm to
285 accomadate it. If you don't stretch it, you can scroll sideways.
286
287 Note the red "CAPTURE" text near the bottom right. This is toggled
288 on/off by pressing the spacebar in alsamixer, similar to toggling
289 speaker on/off by pressing "M". You must turn it on to enable recording
290 from either the built-in microphone or an external microphone that you
291 plug in. Here are the settings I use to record sound with enough volume
292 to be clearly audible, but not loud enough to generate hissing static...
293
294 91 89<>89 89<>89 90<>90 0<>0 0<>0 0<>0
295 Master Headphone Speaker PCM Front Mic Front Mic Front Mic
296
297 84<>84 67<>67 67<>67 84<>84 0<>0
298 Mic Mic Boost Mic Boost Capture Capture 1
299
300 To record sound, you can use either ALSA mode or OSS mode (if support
301 has been built in). Example corresponding commands for ALSA and OSS...
302
303 ffmpeg -y -f alsa -i plughw:0,0 audio1.wav
304
305 ffmpeg -y -f oss -i /dev/dsp audio2.wav
306
307 Remember what I said about OSS devices being more reasonably named?
308
309 8)
310 Putting items 6 and 7 together, you can record/transmit video and
311 audio simultaneously, i.e. webcam and microphone. You can specify
312 video size (from a limited number of valid sizes), frame rate, codecs,
313 sampling rate, etc, if you want complete control. An example command
314 to record yourself is...
315
316 ffmpeg -y -f alsa -r 16000 -i plughw:0,0 -f video4linux2 -s 800x600 -i /dev/video0 -r 30 -f avi -vcodec mpeg4 -vtag xvid -sameq -acodec libmp3lame -ab 96k output.avi
317
318 If you change "-f alsa -r 16000 -i plughw:0,0"
319 to "-f oss -r 16000 -i /dev/dsp"
320 it will also work, as long as you've built OSS support..
321
322 --
323 Walter Dnes <waltdnes@××××××××.org>

Attachments

File name MIME type
alsa.png image/png

Replies