bengreen.eu Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

Raspberry Pi with Gentoo

Installing Gentoo on Raspberry Pi

The installation, most of it is covered very well on the Gentoo Wiki website or here so I will not repeat all that here.

Hardware Configuration

I found some areas on the wiki lacking, mainly on sound configuration. But I also have a 5" touch screen and wanted to use excellerated OpenGL ES 2.0 on my Pi.

Sound Configuration

Firstly, install some utilities so we can check that the device is being detected:

emerge alsa-utils

Then you can modprobe the sound module:

modprobe snd_bcm2835

And check that it was infact loaded:

lsmod

Now try and change the volume:

alsamixer

Didn't work? no, so what you need to do is provide an option in the /boot/config.txt file to enable it.

dtparam=audio=on

Once you do that, and reboot, you should be able to see the volume control in alsamixer.

More information on changing the output to HDMI/analogue is available in the references section

# Turn on Analogue output
amixer cset numid=3 1
# Turn on HDMI output
amixer cset numid=3 2

Touch Screen Configuration

My touch screen is a 5" 800x480 cheap-o from ebay, and if you don't have one I suggest you get one! It is really cool.

# /boot/config.txt
# Video Parameters
gpu_mem=64
hdmi_force_hotplug=1
hdmi_cvt=800 480 60 6
hdmi_group=2
hdmi_mode=87
hdmi_drive=1
startup_file=startup_x.elf
fixup_file=fixup_x.elf
# Touch Screen Configuration
dtparam=i2c_arm=on
dtparam=spi=on
dtoverlay=ads7846,penirq=25,speed=10000,penirq_pull=2,xohms=150

The following should all be on one line! (not including the #comment, of course). Please see references for some detail on the HDMI options for config.txt.

# /etc/modules
ads7846_device model=7846 cs=1 gpio_pendown=25 speed=1000000 
  keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=150 
  x_min=184 x_max=3869 y_min=141 y_max=3959

I am only really worried about mouse input and will be looking into console or raw interaction with the device, if you care about X and whatnot please see the references.

Turning Off Video output

There is a utility for this called tvservice. This will allow you to turn off the HDMI output and change various other properties... the only thing is it is not included... this is simple to fix:

emerge raspberrypi-userland

Once installed you should have some nice tools in /opt/vc/bin to change the power mode use:

# Turn off HDMI output
tvservice -o
# Turn on HDMI output
tvservice --preferred
# See Status
tvservice -s
# As usual, more can be found in the POSIX way
tvservice --help

Cool! you will have a white screen if you have one of the 5" HDMI screens like mine but if you have a soldering iron and some time you can put a transistor in place of that switch and perhaps activate it through one of the free GPIOs?

VC4 Video on Raspberry Pi

More to come...

References

Quick Links: Techie Stuff | General | Personal | Quick Reference