I finally got my Acer 4551 100% functional under 64-bit Gentoo linux.
Thanks to various people on various linux forums who spelled out the
answers, and also to "Mr. Google" for helping me find them.  There are
sevaral tweaks that are required to get things working.  I'll
concentrate on the stuff that's not obvious/intuiutive.  Unless
otherwise specified, everything here is an entry in "make menuconfig",
setting up the kernel.  Here it is...

1)
Getting USB mice and keyboards and other low-speed USB devices to work.
Device Drivers  --->
[*] USB support  --->
<*>     EHCI HCD (USB 2.0) support
<*>     OHCI HCD support

Notice that in addition to EHCI (USB 2.0), I've specified OHCI (USB1.1)
support.  Low-speed USB peripherals (e.g. external mice and keybords)
and older USB peripherals in general *MUST* have this driver to work.  I
know that the "Root Hub Transaction Translators" item is *SUPPOSED* to
provide OHCI support via the EHCI driver.  But for this machine, it
doesn't work.

2)
The Broadcomm chip/nic requires "PHY Device support" *IN ADDITION TO*
the expected driver entry.  It doesn't work without the PHY driver.
Device Drivers  --->
[*] Network device support  --->
-*-   PHY Device support and infrastructure  --->
<*>   Drivers for Broadcom PHYs

The standard entry is also required...

Device Drivers  --->
[*] Network device support  --->
[*]   Ethernet (1000 Mbit)  --->
      <*>   Broadcom Tigon3 support

The wireless is pretty standard, using the ath9k module.

3)
Power management could be a wiki article all on its own.  First, the
kernel setup.  Recompile and reboot after the following two areas are
set...

Power management and ACPI options  --->
[*] Power Management support
[*] ACPI (Advanced Configuration and Power Interface) Support  --
   [*]   Deprecated /proc/acpi files
   [*]   Deprecated power /proc/acpi directories
   [*]   Future power /sys interface
   [*]   Deprecated /proc/acpi/event support
   <*>   AC Adapter
   <*>   Battery
   <*>   Button
   <*>   Fan
   <*>   Dock
   <*>   Processor
   <*>     Processor Aggregator
   <*>     Thermal Zone
   <*>   Smart Battery System

Build the performance/powersave/userspace/ondemand/conservative
governors into the kernel.  Make "conservative" the default governor.

Power management and ACPI options  --->
[*] Power Management support
    CPU Frequency scaling  --->
    [*] CPU Frequency scaling
    [*]   Enable CPUfreq debugging
    < >   CPU frequency translation statistics
          Default CPUFreq governor (conservative)  --->
    -*-   'performance' governor
    <*>   'powersave' governor
    <*>   'userspace' governor for userspace frequency scaling
    -*-   'ondemand' cpufreq policy governor
    <*>   'conservative' cpufreq governor
          *** CPUFreq processor drivers ***
    < >   Processor Clocking Control interface driver
    <*>   ACPI Processor P-States driver
    <*>   AMD Opteron/Athlon64 PowerNow

* Then install "cpufrequtils"

* Then set up a couple of configuration files.  First, use ACPI to
  detect power status.  When the machine switches to battery power,
  select "powersave" governor.  When the machine switches to AC power,
  select "conservative" governor.  Note that the lines below are *NOT*
  the complete "/etc/acpi/default.sh".  *DO NOT DELETE THE REST OF THE
  FILE!*  I am simply including only the relevant portion of the file.
  The following lines are near the bottom of the default version of...

/etc/acpi/default.sh
====================
      ac_adapter)
            case "$value" in
                  # Add code here to handle when the system is unplugged
                  # (maybe change cpu scaling to powersave mode).  For
                  # multicore systems, make sure you set powersave mode
                  # for each core!
                   *0)
                        cpufreq-set -c0 -g powersave
                        cpufreq-set -c1 -g powersave
                        ;;

                  # Add code here to handle when the system is plugged in
                  # (maybe change cpu scaling to performance mode).  For
                  # multicore systems, make sure you set performance mode
                  # for each core!
                   *1)
                        cpufreq-set -c0 -g conservative
                        cpufreq-set -c1 -g conservative
                        ;;

                  *)      log_unhandled $* ;;
            esac
                ;;

* That takes care of what to do when the AC adaptor state changes.  But
  what about at bootup?  There isn't an "AC adaptor event" at bootup, so
  we have to check the power status directly, and select the governor as
  required.  The standard location for custom bootup scripting is
  /etc/conf.d/local.start

/etc/conf.d/local.start
=======================
# Check whether AC adapter is plugged in, and set governor accordingly
ac_state=`cat /sys/class/power_supply/ADP1/online`
if [ ${ac_state} -eq 1 ]; then
  cpufreq-set -c0 -g conservative
  cpufreq-set -c1 -g conservative
else
  cpufreq-set -c0 -g powersave
  cpufreq-set -c1 -g powersave
fi

4)
Setting up the video.  This is based on instructions found at
http://www.gentoo.org/doc/en/xorg-config.xml  The "new world order" in
linux video drivers seems to be that the framebuffer is built directly
into the driver itself.  Therefore card-specific framebuffer driver
support *MUST* be disabled, but console framebuffer support *MUST* be
enabled, like so...

Device Drivers --->
  Graphics support --->
    Support for frame buffer devices --->
    (Disable all drivers, including VGA, Intel, nVidia, and ATI)

    (Further down, enable basic console support. KMS uses this.)
    Console display driver support --->
      <*>  Framebuffer Console Support

To enable Radeon KMS support...
Device Drivers --->
  Graphics support --->
  <*>  Direct Rendering Manager --->
  <*>    ATI Radeon
  [*]      Enable modesetting on radeon by default

Point to the firmware blob to be loaded into the kernel to enable
hardware acceleration...
Device Drivers --->
  Generic Driver Options --->
  [*]  Include in-kernel firmware blobs in kernel binary
  (radeon/R600_rlc.bin) External firmware blobs to build into the kernel
  (/lib/firmware/) Firmware blobs root directory


  Next, we have to download and install the firmware blob that enables
hardware acceleration for the onboard graphics chip.  In Gentoo linux,
the command is "emerge radeon-ucode".  Similar commands should exist in
most distros.  If not, you can download the blob files directly from
http://people.freedesktop.org/~agd5f/radeon_ucode/ into directory
/lib/firmware/radeon on your Acer Aspire 4551.  Create that directory if
it doesn't already exist.  Your machine should only need one of the
files in the directory but it doesn't hurt to download all of them.  In
my case, it's the R600_rlc.bin file.  This should be true for most Acer
Aspire 4551 models, but a newer video chip may be inserted in future
production runs, which requires a different blob file.

  And now for a little bonus... usable text consoles.  With the new KMS
video drivers the text console defaults to native graphics resolution,
which is 1366x768 for the Acer Aspire 4551.  Some quick division shows
that the default 8x16 VGA font will result in an unreadably crowded 170
columns x 48 rows display.  But you can select any other supported mode
found in /var/log/Xorg.0.log.  One valid mode is 640x480.  We can put
the option "video=640x480" in the "append" line of /etc/lilo.conf, or in
the equivalant area of the GRUB loader.  The text consoles will be
640x480, but X will remain at 1366x768.  The default 8x16 VGA font will
result in a perfectly readable 80 columns x 30 rows display on text
consoles.

  As they say in the infomercials... but wait, there's more.  If you cd
to /usr/share/consolefonts and execute "ls -1 lat1*", you'll get...
lat1-08.psfu.gz
lat1-10.psfu.gz
lat1-12.psfu.gz
lat1-14.psfu.gz
lat1-16.psfu.gz

  These fonts are all 8 pixels wide, so that results in a 640 / 8 = 80
column display.  The vertical size differs for each font.  If you
execute "setfont lat1-08" at a text console, you'll get a hard-to-read
80 columns x 60 rows display.  If you execute "setfont lat1-10", you'll
get a crisp 80 x 48 text display. "setfont lat1-12" gives an 80 x 40
display, and "setfont lat1-14" gives an 80 x 34 text display.  By the
way, 8x8 is the ancient CGA font, and 8x14 is the old EGA font.  To have
the desired font come up at bootup, enter it in /etc/conf.d/consolefont
In my case, I have the line...

CONSOLEFONT="lat1-10"

in /etc/conf.d/consolefont.  In combination with "video=640x480", this
gives an 80 columns x 48 rows text display.  Which one you choose
depends on personal taste, and how good your eyesight is.  Note that I
used "lat1" as an example.  You can use another available encoding if
you desire.

6)
The webcam does not show up under the "lspci"command.  Rather, it seems
to be internally hooked up to a USB connector.  On my machine, the
output of the command "lsusb" includes the line...

Bus 002 Device 003: ID 064e:a219 Suyin Corp.

That's a "Suyin Crystal Eye" webcam.  Here are the items that need to
be selected in the kernel...

Device Drivers  --->
<*> Multimedia support  --->
    <*>   Video For Linux
    [*]     Enable Video For Linux API 1 compatible Layer
    [*]   Video capture adapters  --->
          [*]   Autoselect pertinent encoders/decoders and other helper chi
          [*]   V4L USB devices  --->
                <*>   USB Video Class (UVC)
                [*]     UVC input events device support

  Note that with UVC functionality implemented in newer kernels, you do
*NOT* need to install the linux-uvc library separately.

  Depending on whether you have the necessary codecs built in, you can
display video from the webcam with...
mplayer tv:// -tv driver=v4l2:device=/dev/video0

...or record to disk with a command like...
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg



7)
The kernel configs I used for setting up sound playback and recording
are as follows.  Note that you *MUST BUILD "Sound card support" AS A
MODULE*.  I don't know why this is the case, but I couldn't get the
microphone to work if I didn't do it this way.  If you're *ABSOLUTELY
100% CERTAIN* that you won't be using OSS compatability support, you can
drop the OSS items listed below.  I keep them, because devices are more
reasonably named in OSS than in ALSA.  Note the 2 audio codecs.  The
Realtek codec is for the sound chip.  The ATI HDMI codec is for audio
output from the video card (YES!).  The HDMI spec handles audio and
video via one cable, and the Acer 4554 does have an HDMI output port
(not DVI, but you can get adaptor cables).

Device Drivers  --->
<M> Sound card support  --->
    [*]   Preclaim OSS device numbers
    <M>   Advanced Linux Sound Architecture  --->
          <M>   Sequencer support
          <M>     Sequencer dummy client
          <M>   OSS Mixer API
          <M>   OSS PCM (digital audio) API
          [*]     OSS PCM (digital audio) API - Include plugin system
          [*]   OSS Sequencer API
          [*]   Verbose procfs contents
          [*]   PCI sound devices  --->
                <M>   Intel HD Audio  --->
                      [*]   Build Realtek HD-audio codec support
                      [*]   Build ATI HDMI HD-audio codec support


  In order to be able to record from the microphone, you *MUST TURN ON
CAPTURE MODE*.  The attached screen capture is from the "alsamixer"
utility, which is run from the command line.  After starting alsamixer,
press {F5} to display all devices/controls.  I stretched the xterm to
accomadate it.  If you don't stretch it, you can scroll sideways.

  Note the red "CAPTURE" text near the bottom right.  This is toggled
on/off by pressing the spacebar in alsamixer, similar to toggling
speaker on/off by pressing "M".  You must turn it on to enable recording
from either the built-in microphone or an external microphone that you
plug in.  Here are the settings I use to record sound with enough volume
to be clearly audible, but not loud enough to generate hissing static...

 91      89<>89    89<>89    90<>90     0<>0      0<>0      0<>0
Master  Headphone  Speaker     PCM    Front Mic Front Mic Front Mic

84<>84    67<>67    67<>67    84<>84     0<>0 
  Mic    Mic Boost Mic Boost  Capture  Capture 1

  To record sound, you can use either ALSA mode or OSS mode (if support
has been built in).  Example corresponding commands for ALSA and OSS...

ffmpeg -y -f alsa -i plughw:0,0 audio1.wav

ffmpeg -y -f oss  -i /dev/dsp audio2.wav

  Remember what I said about OSS devices being more reasonably named?

8)
Putting items 6 and 7 together, you can record/transmit video and
audio simultaneously, i.e. webcam and microphone.  You can specify
video size (from a limited number of valid sizes), frame rate, codecs,
sampling rate, etc, if you want complete control.  An example command
to record yourself is...

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

If you change "-f alsa -r 16000 -i plughw:0,0"
to            "-f oss  -r 16000 -i /dev/dsp"
it will also work, as long as you've built OSS support..

-- 
Walter Dnes <waltd...@waltdnes.org>

<<attachment: alsa.png>>

Reply via email to