CM-T54: Linux: Arago Project

From Compulab Mediawiki
Jump to: navigation, search

Overview

The example run-time Linux filesystem image for the CompuLab CM-T54 System-on-Module / Computer-on-Module is based on Arago Project Linux filesystem for OMAP-5432-uEVM evaluation board from TI, distributed with the official TI OMAP5 GLSDK 6.03.00.01. More details about supported features are available in OMAP5 GLSDK 6.03.00.01 Release Notes and OMAP5 GLSDK Software Developers Guide.
The CM-T54: Linux: Getting started page provides a brief introduction on how to install the run-time Linux image.

Using Arago Project Linux on CM-T54

Connection and Logging In

Use the following username to login:

cm-t54 login: root

To login into the Linux system, you may use a serial console (ttyO3) at 115200 bps, or connect through the network, or use a keyboard and HDMI/DVI displays.

Display options

CM-T54 evaluation platform has four video output interfaces: LCD, DVI, LVDS and HDMI. LVDS video output is not supported in CM-T54 Linux package, based on kernel v3.8.13.
CM-T54 display subsystem is based on “Direct Render Mode” (DRM) and “Kernel Modesetting” (KMS) APIs as important parts of the Linux graphics system. DRM allows frame buffers to be mapped into user space so that applications can write directly to the buffers. In the DRM framework, a physical connector in the display subsystem is called a "connector". Most of the applications used to demonstrate graphics would require the user to pass a connector id. A connector id is a number that is assigned to each of the display devices connected to the system. To get the list of the display devices connected and the corresponding connector id the modetest application can be used as mentioned below:

root@cm-t54:~# modetest -c
trying to load module i915...failed.
trying to load module radeon...failed.
trying to load module nouveau...failed.
trying to load module vmwgfx...failed.
trying to load module omapdrm...success.
Connectors:
id	encoder	status		type	size (mm)	modes	encoders
4	3	connected	DVI-D	0x0		1	3
  modes:
	name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1920x1080 53 1920 2040 2248 2576 1080 1081 1084 1118 flags: nhsync, pvsync; type: preferred, driver
  props:
	1 EDID:
		flags: immutable blob
		blobs:

		value:	2 DPMS:
		flags: enum
		enums: On=0 Standby=1 Suspend=2 Off=3
		value: 0
12	11	connected	HDMI-A	510x290		21	11
  modes:
	name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 flags: phsync, pvsync; type: preferred, driver
  1920x1080 50 1920 2448 2492 2640 1080 1084 1089 1125 flags: phsync, pvsync; type: driver
  1920x1080i 50 1920 2448 2492 2640 1080 1084 1094 1125 flags: phsync, pvsync, interlace; type: driver
  1920x1080i 60 1920 2008 2052 2200 1080 1084 1094 1125 flags: phsync, pvsync, interlace; type: driver
  1280x1024 75 1280 1296 1440 1688 1024 1025 1028 1066 flags: phsync, pvsync; type: driver
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 flags: phsync, pvsync; type: driver
  1152x864 75 1152 1216 1344 1600 864 865 868 900 flags: phsync, pvsync; type: driver
  1280x720 50 1280 1720 1760 1980 720 725 730 750 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 flags: phsync, pvsync; type: driver
  1440x576i 50 1440 1464 1590 1728 576 580 586 625 flags: nhsync, nvsync, interlace, dblclk; type: driver
  1024x768 75 1024 1040 1136 1312 768 769 772 800 flags: phsync, pvsync; type: driver
  1024x768 60 1024 1048 1184 1344 768 771 777 806 flags: nhsync, nvsync; type: driver
  1440x480i 60 1440 1478 1602 1716 480 488 494 525 flags: nhsync, nvsync, interlace, dblclk; type: driver
  800x600 75 800 816 896 1056 600 601 604 625 flags: phsync, pvsync; type: driver
  800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
  720x576 50 720 732 796 864 576 581 586 625 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 flags: nhsync, nvsync; type: driver
  640x480 75 640 656 720 840 480 481 484 500 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
  720x400 70 720 738 846 900 400 412 414 449 flags: nhsync, pvsync; type: driver
  props:
	1 EDID:
		flags: immutable blob
		blobs:

		value:
			00ffffffffffff0010ac58d0544e3930
			0917010380331d78eae295a2554f9f26
			115054a54b00714f8180d1c001010101
			010101010101023a801871382d40582c
			4500fd1e1100001e000000ff00354659
			4a3533325330394e540a000000fc0044
			454c4c2053323334304c0a20000000fd
			00384c1e5311000a2020202020200185
			02031ff14c9005040302071601141f12
			13230907078301000065030c00100002
			3a801871382d40582c4500fd1e110000
			1e011d8018711c1620582c2500fd1e11
			00009e011d007251d01e206e285500fd
			1e1100001e8c0ad08a20e02d10103e96
			00fd1e11000018000000000000000000
			000000000000000000000000000000e7
	2 DPMS:
		flags: enum
		enums: On=0 Standby=1 Suspend=2 Off=3
		value: 0


DVI

DVI connector ID is 4. CM-T54 evaluation board uses TFP410 DPI-to-DVI transceiver (on SB-T54 baseboard) to provide DVI video output capability. Reading DVI display EDID information is not supported. The display resolution should be configured by the kernel boot options using video parameter.

  • Example of video parameter setting, specifying full HD resolution on DVI display
CM-T54 # setenv mmcargs 'setenv bootargs console=${console} root=${mmcroot} rw rootwait video=DVI-D-1:1920x1080@60'
CM-T54 # saveenv

HDMI

HDMI connector ID is 12. The display resolution is set up automatically, based on EDID information passed by the connected display device. DVI output resolution should match HDMI resolution:

  • Example of video parameter setting, specifying full HD resolution on DVI dipslay to match full HD resolution on HDMI video output.
CM-T54 # setenv mmcargs 'setenv bootargs console=${console} root=${mmcroot} rw rootwait video=DVI-D-1:1920x1080@60'
CM-T54 # saveenv

LCD

LCD video output replaces DVI output. The LCD connector ID is 4. In order to activate the LCD video out, the U-Boot environment variable should be adjusted:

  • LCD output enabled (DVI/HDMI output disabled)
CM-T54 # setenv mmcloadfdt 'load mmc ${mmcdev} ${fdtaddr} ${fdtfile}; fdt addr ${fdtaddr}; fdt rm /ocp/dss/dpi/dvi;'
CM-T54 # saveenv
  • Default settings
CM-T54 # setenv mmcloadfdt 'load mmc ${mmcdev} ${fdtaddr} ${fdtfile};'
CM-T54 # saveenv

HDMI Audio

CM-T54 provides a digital HDMI audio interface, which is registered as a standard ALSA sound card. If the default CM-T54 configuration is used, the audio drivers are loaded automatically during the boot process.

Since the HDMI audio card is the default one in the Linux for CM-T54, the following command can be used for audio play back:

root@cm-debian:~# aplay <wav-file>

Analog Audio

CM-T54 provides the analog audio interface, which is registered as a standard ALSA sound card. If the default CM-T54 configuration is used, the audio drivers are loaded automatically during the boot process.
aplay -l shows list of all soundcards and digital audio devices registered on the system. Here is a sample aplay -l output.

root@cm-t54:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: OMAP5HDMI [OMAP5HDMI], device 0: HDMI omap-hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: wm8731audio [wm8731-audio], device 0: WM8731 PCM wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The 'card 1' is the analog audio device.

Analog Audio Settings

To enable the Analog audio playback, alsamixer or amixer applications can be used.

  • alsamixer - set the “Output Mixer HiFi” control on.

or

  • amixer - set the “Output Mixer HiFi Playback Switch” control on using command line interface:
# amixer -c 1 cset numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch' on
# alsactl store wm8731audio

Analog Audio Playback

In order to play a sound file make use of the aplay application.

  • aplay -L can be used for listing of all PCM devices.

Here is a sample output of aplay -L command:

root@cm-t54:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=OMAP5HDMI
    OMAP5HDMI, 
    Default Audio Device
sysdefault:CARD=OMAP5HDMI
    OMAP5HDMI, 
    Default Audio Device
default:CARD=wm8731audio
    wm8731-audio, 
    Default Audio Device
sysdefault:CARD=wm8731audio
    wm8731-audio, 
    Default Audio Device

The next command can be used for audio playback:

root@cm-t54:~# aplay -D sysdefault:CARD=wm8731audio <wav-file>

The above command makes use of the wm8731 audio codec and passes the audio signal to the audio out connector (J5 on SB-T54).

Recording Audio

CM-T54 provides recording audio signal from either “Line In” or “Mic In” sources. The arecord application can be used for capturing audio signal. arecord -L shows all devices that can be used for audio capturing.
The below list of devices is shown on a CM-T54 module:

root@cm-t54:~# arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=wm8731audio
    wm8731-audio, 
    Default Audio Device
sysdefault:CARD=wm8731audio
    wm8731-audio, 
    Default Audio Device

==== Audio Input Settings ====
CM-T54 provides an audio capturing feature from either ''Mic'' or ''Line In'' input sources.
{{cmd|alsamixer}} or {{cmd|amixer}} can be used in order to switch between these inputs.

===== Mic =====
* Using {{cmd|alsamixer}}
:: Set ''Input Mux'' playback control to ''Mic'' state
:: Set ''Mic Boost'' playback control to the highest state
:: Set ''Mic'' capture control to ''CAPTURE'' state
* Using {{cmd|amixer}}
<pre>
root@cm-t54:~# amixer -c 1 cset numid=11,iface=MIXER,name='Input Mux' 1
root@cm-t54:~# amixer -c 1 cset numid=5,iface=MIXER,name='Mic Boost Volume' 1
root@cm-t54:~# amixer -c 1 cset numid=6,iface=MIXER,name='Mic Capture Switch' 1
Line In
  • Using alsamixer
Set Input Mux playback control to Line In state
Set Line capture control to CAPTURE state
  • Using amixer
root@cm-t54:~# amixer -c 1 cset numid=11,iface=MIXER,name='Input Mux' 0
root@cm-t54:~# amixer -c 1 cset numid=4,iface=MIXER,name='Line Capture Switch' 1

Sample Audio Recording

As soon as the correct input values are set, audio signal can be captured.
Here is a sample command that shows the arecord usage for capturing audio signal from the selected input line.

root@cm-t54:~# arecord -D sysdefault:CARD=wm8731audio -f cd -t wav /tmp/out.wav

Media applications demos

Graphics demos

The graphics driver and userspace libraries and binaries are distributed along with the example root file system. Please make sure the board is connected to a display. To execute the demos, the graphics driver must be initialized by running pvrsrvinit.

pvrsrvinit

Example root file system contains pre-built kmscube application to demonstrate hardware graphic acceleration support.

kmscube is an example of communicating with the DRM/KMS drivers, creating the EGL context, and drawing the multi-colored cube using GLES2 with GBM from Mesa to the KMS console. kmscube code, available in the official TI GLSDK for OMAP5.

  • Display cube on all connected displays
kmscube -a
  • Display cube using HDMI connector only
kmscube -c 12

Wayland/Weston

Wayland is a protocol that specifies the communication between a display server (called Wayland compositor) and its clients, as well as a reference implementation of the protocol. The Wayland project includes a demo Wayland compositor, called Weston. It's fast, small, and runs on embedded and mobile devices.

To execute the demos, the graphics driver must be initialized by running pvrsrvinit.

root@cm-t54:~# pvrsrvinit

To launch Weston on HDMI display (connector ID 12), run the following:

root@cm-t54:~# weston --connector=12

Running Weston clients

After launching Weston, the user should be able to use the keyboard and the mouse for various controls.

There are two icons on the top right hand corner of the Weston desktop window which have been configured for

  • terminal
  • flower application

Clicking these respective icons should launch the applications on the Weston Desktop.

There are several other applications that are included in the example filesystem. To invoke these applications, the user should launch the weston-terminal (top right hand corner of the desktop) and then invoke the client apps as described below from within the terminal window:

wayland sh # /usr/bin/weston-clients/flower
wayland sh # /usr/bin/weston-clients/clickdot
wayland sh # /usr/bin/weston-clients/cliptest
wayland sh # /usr/bin/weston-clients/dnd
wayland sh # /usr/bin/weston-clients/editor
wayland sh # /usr/bin/weston-clients/eventdemo
wayland sh # /usr/bin/weston-clients/image /usr/share/weston/terminal.png
wayland sh # /usr/bin/weston-clients/resizor
wayland sh # /usr/bin/weston-clients/simple-egl
wayland sh # /usr/bin/weston-clients/simple-shm
wayland sh # /usr/bin/weston-clients/simple-touch
wayland sh # /usr/bin/weston-clients/smoke
wayland sh # /usr/bin/weston-clients/weston-info
wayland sh # /usr/bin/weston-clients/weston-terminal

Exiting Weston

If you have invoked Weston from the serial console, exit Weston by pressing Ctrl-C.

Video Playback

Hardware accelerated video playback on CM-T54 evaluation board is supported by the GStreamer framework. Running the following GStreamer pipelines demonstrate the video/audio decoding:

  • Video output to HDMI display, audio output to HDMI audio
gst-launch playbin2 uri=file:///<path_to_file> video-sink="kmssink connector=12" audio-sink=alsasink
  • Video output to DVI/LCD display, audio output to analog audio
gst-launch playbin2 uri=file:///<path_to_file> video-sink=kmssink audio-sink="alsasink device=hw:1,0"


See also