Difference between revisions of "CL-SOM-AM57x: Linux: Debian"

From Compulab Mediawiki
Jump to: navigation, search
(Analog Audio Playback)
 
(One intermediate revision by one other user not shown)
Line 16: Line 16:
  
 
=== Connection and Logging In ===
 
=== Connection and Logging In ===
Use the following username and password to login:
+
Use the following username to login:
  
Account with administrative privileges:
 
 
<pre>
 
<pre>
cl-debian-armhf login: root
+
User: root
Password: 111111
 
 
</pre>
 
</pre>
  
Regular user account:
+
To login into the Linux system, you may use a serial console (ttyO2) at 115200 bps, or connect through the network, or use a keyboard and HDMI display.
 +
 
 +
==== root password ====
 +
This Debian rootfs comes without default root password.<br>
 +
The root password has to be set at the very first login:
 +
 
 
<pre>
 
<pre>
cl-debian-armhf login: user
+
Debian GNU/Linux stretch/sid cl-rootfs ttyS2
Password: 111111
+
 
 +
cl-rootfs login: root
 +
You are required to change your password immediately (root enforced)
 +
Enter new UNIX password:
 
</pre>
 
</pre>
  
To login into the Linux system, you may use a serial console (ttyO2) at 115200 bps, or connect through the network, or use a keyboard and HDMI display.
+
=== 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.
 +
 
 +
During start-up
 +
* The Weston starts with the current active display (HDMI by default - connector J4).
 +
* The Texas Instrument Matrix Weston clients is lunched.
  
=== X Windows system ===
+
==== Running Weston clients ====
CompuLab DEMO root filesystem image contains fully featured X server system with Fluxbox window manager.
 
Before starting X server, connect USB mouse and keyboard to the system.
 
You can run X server and Fluxbox window manager by typing {{cmd|startx}}.
 
  
=== Fluxbox window manager ===
+
After launching Weston, the user should be able to use the keyboard and the mouse for various controls.
  
CL-SOM-AM57x Debian Linux features installed Fluxbox package - a lightweight window manager for the X server system.
+
There is a terminal icon, located in the left hand corner of the Weston desktop window.
 +
Clicking terminal icons should launch the weston-terminal on the Weston Desktop.
  
* Fluxbox provides configurable window decorations, a root menu to launch applications and a toolbar that shows the current workspace name, a set of application names and the current time. There is also a workspace menu which allows you to add or remove workspaces. The {{parameter|slit}} can be used to dock small applications, e.g. most of the bbtools can use slit.
+
There are several other applications that are included in the example file system.
* Fluxbox can iconify windows to the toolbar, in addition to adding the window to the Icons submenu of the workspace menu.
+
To invoke these applications, the user should launch the weston-terminal and then invoke the client apps as described below from within the terminal window:
  
Visit [http://fluxbox-wiki.org Fluxbox Wiki] and [http://fluxbox.org/ Official home page] for more details.
+
<pre>
 +
root@cl-rootfs:~# /etc/init.d/matrix-gui-2.0 start
 +
root@cl-rootfs:~# /usr/bin/weston-calibrator
 +
root@cl-rootfs:~# /usr/bin/weston-clickdot
 +
root@cl-rootfs:~# /usr/bin/weston-cliptest
 +
root@cl-rootfs:~# /usr/bin/weston-dnd
 +
root@cl-rootfs:~# /usr/bin/weston-editor
 +
root@cl-rootfs:~# /usr/bin/weston-eventdemo
 +
root@cl-rootfs:~# /usr/bin/weston-flower
 +
root@cl-rootfs:~# /usr/bin/weston-fullscreen
 +
root@cl-rootfs:~# /usr/bin/weston-info
 +
root@cl-rootfs:~# /usr/bin/weston-multi-resource
 +
root@cl-rootfs:~# /usr/bin/weston-presentation-shm
 +
root@cl-rootfs:~# /usr/bin/weston-resizor
 +
root@cl-rootfs:~# /usr/bin/weston-scaler
 +
root@cl-rootfs:~# /usr/bin/weston-simple-damage
 +
root@cl-rootfs:~# /usr/bin/weston-simple-egl
 +
root@cl-rootfs:~# /usr/bin/weston-simple-shm
 +
root@cl-rootfs:~# /usr/bin/weston-simple-touch
 +
root@cl-rootfs:~# /usr/bin/weston-smoke
 +
root@cl-rootfs:~# /usr/bin/weston-stacking
 +
root@cl-rootfs:~# /usr/bin/weston-subsurfaces
 +
root@cl-rootfs:~# /usr/bin/weston-transformed
 +
</pre>
  
 
=== Software Management ===
 
=== Software Management ===
Line 66: Line 99:
  
 
==== Touchscreen calibration ====
 
==== Touchscreen calibration ====
A touchscreen device can be calibrated using {{cmd|xinput_calibrator}} utility.
+
A touchscreen device can be calibrated using {{cmd|weston-calibrator}} utility.
 +
{{Note| [[CL-SOM-AM57x:_Linux:_Manual_Installation:_destination:_eMMC#Select_video_output|LCD display]] should be selected for touchscreen calibration}}
  
 
To calibrate the touchscreen:
 
To calibrate the touchscreen:
* Update the primary video output to the calibrated display type.
+
* Launch Weston:
* Run X Server by issuing {{cmd|startx}} command
+
<blockquote><pre>
 +
/etc/init.d/weston start
 +
</pre></blockquote>
 
* Make sure the touchscreen driver is loaded
 
* Make sure the touchscreen driver is loaded
* Set the {{parameter|DISPLAY}} environment variable: <pre> export DISPLAY=:0</pre>
+
* Start the Weston calibrator:
* Run {{cmd|xinput_calibrator}} utility. For proper calibration you are required to touch the touchscreen corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center.
+
<blockquote><pre>
* Create a file {{filename|/usr/share/X11/xorg.conf.d/99-calibration.conf}} and paste there a snippet with the calibration results:
+
/usr/bin/weston-calibrator
 +
</pre></blockquote>
 +
* For proper calibration you are required to follow the calibrator and touch at the '+' locations.
 +
* The calibration file will be created at the following path:
 +
<blockquote><pre>
 +
/etc/udev/rules.d/ws-calibrate.rules
 +
</pre></blockquote>
 +
 
 +
=== Analog Audio ===
 +
CL-SOM-AM57x provides an analog audio interface, which is registered as a standard ALSA sound card.  
 +
Use {{cmd|aplay -l}} to list all soundcards and digital audio devices registered on the system:
 
<pre>
 
<pre>
root@cl-debian-armhf:~# xinput_calibrator
+
root@cl-rootfs:~# aplay -l
Setting calibration data: 0, 4095, 0, 4095
+
**** List of PLAYBACK Hardware Devices ****
Calibrating EVDEV driver for "ADS7846 Touchscreen" id=6
+
card 0: clsomamx57xx [cl-som-amx57xx], device 0: davinci-mcasp.0-wm8731-hifi wm8731-hifi-0 []
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
+
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
card 1: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
</pre>
 +
 
 +
==== Analog Audio Settings ====
 +
To enable the Analog audio playback, {{cmd|alsamixer}} or {{cmd|amixer}} applications can be used.
 +
* {{cmd|alsamixer}} - set the “''Output Mixer''” control on.
 +
or
 +
* {{cmd|amixer}} - set the “''Output Mixer HiFi Playback Switch''” control on using command line interface:
 +
<blockquote><pre>
 +
root@cl-rootfs:~# amixer cset numid=13 1
 +
numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch'
 +
  ; type=BOOLEAN,access=rw------,values=1
 +
  : values=on
 +
</pre></blockquote>
 +
To set maximum playback volume, {{cmd|alsamixer}} or {{cmd|amixer}} applications can be used.
 +
* {{cmd|alsamixer}} - set the “''Master''” control to 100.
 +
or
 +
* {{cmd|amixer}} - set the “''Master Playback Volume''” control to 127 by using command line interface:
 +
<blockquote><pre>
 +
root@cl-rootfs:~# amixer cset numid=1 127 127
 +
numid=1,iface=MIXER,name='Master Playback Volume'
 +
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
 +
  : values=127,127
 +
  | dBscale-min=-121.00dB,step=1.00dB,mute=1
 +
</pre></blockquote>
 +
 
 +
==== Analog Audio Playback ====
 +
In order to play back a sound file make use of the {{cmd|aplay}} application.
 +
<dl>
 +
* {{cmd|aplay -L}} can be used for listing of all pcm devices.
 +
</dl>
 +
:Here is a sample output of {{cmd|aplay -L}} command:
 +
<blockquote><pre>
 +
root@cl-rootfs:~# aplay -L
 +
null
 +
    Discard all samples (playback) or generate zero samples (capture)
 +
default:CARD=clsomamx57xx
 +
    cl-som-amx57xx,
 +
    Default Audio Device
 +
sysdefault:CARD=clsomamx57xx
 +
    cl-som-amx57xx,
 +
    Default Audio Device
 +
dmix:CARD=clsomamx57xx,DEV=0
 +
    cl-som-amx57xx,
 +
    Direct sample mixing device
 +
dsnoop:CARD=clsomamx57xx,DEV=0
 +
    cl-som-amx57xx,
 +
    Direct sample snooping device
 +
hw:CARD=clsomamx57xx,DEV=0
 +
    cl-som-amx57xx,
 +
    Direct hardware device without any conversions
 +
plughw:CARD=clsomamx57xx,DEV=0
 +
    cl-som-amx57xx,
 +
    Hardware device with all software conversions
 +
default:CARD=H58040000encode
 +
    HDMI 58040000.encoder,
 +
    Default Audio Device
 +
sysdefault:CARD=H58040000encode
 +
    HDMI 58040000.encoder,
 +
    Default Audio Device
 +
dmix:CARD=H58040000encode,DEV=0
 +
    HDMI 58040000.encoder,
 +
    Direct sample mixing device
 +
dsnoop:CARD=H58040000encode,DEV=0
 +
    HDMI 58040000.encoder,  
 +
    Direct sample snooping device
 +
hw:CARD=H58040000encode,DEV=0
 +
    HDMI 58040000.encoder,
 +
    Direct hardware device without any conversions
 +
plughw:CARD=H58040000encode,DEV=0
 +
    HDMI 58040000.encoder,
 +
    Hardware device with all software conversions
 +
</pre></blockquote>
 +
 
 +
:The next command can be used for audio playback:
 +
<blockquote><pre>
 +
root@cm-debian:~# aplay <wav-file>
 +
</pre></blockquote>
 +
 
 +
==== Audio Input Settings ====
 +
CL-SOM-AM57x 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 =====
 +
* {{cmd|alsamixer}}
 +
:: Line Input => 100
 +
:: Line => off
 +
:: Mic => on
 +
* {{cmd|amixer}}
 +
<blockquote><pre>
 +
amixer cset numid=3 31
 +
amixer cset numid=4 0
 +
amixer cset numid=6 1
 +
amixer cset numid=11 1
 +
amixer cset numid=14 1
 +
</pre></blockquote>
 +
 
 +
===== Line In =====
 +
* {{cmd|alsamixer}}
 +
:: Line Input => 100
 +
:: Line => on
 +
:: Mic => off
 +
* {{cmd|amixer}}
 +
<blockquote><pre>
 +
amixer cset numid=3 31
 +
amixer cset numid=4 1
 +
amixer cset numid=6 0
 +
amixer cset numid=11 0
 +
amixer cset numid=14 0
 +
</pre></blockquote>
  
Doing dynamic recalibration:
+
==== Sample Audio Recording ====
Setting calibration data: 289, 3781, 3887, 227
+
As soon as the correct input values have been set, audio signal can be captured.
--> Making the calibration permanent <--
+
Here is a sample command that shows the {{cmd|arecord}} usage for capturing audio signal from the selected input line.
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
+
<blockquote><pre>
Section "InputClass"
+
root@cl-rootfs:~# arecord -f dat -t wav /tmp/out.wav
Identifier "calibration"
+
</pre></blockquote>
MatchProduct "ADS7846 Touchscreen"
 
Option "Calibration" "289 3781 3887 227"
 
Option "SwapAxes" "0"
 
EndSection
 
</pre>
 
  
 
=== Bluetooth ===
 
=== Bluetooth ===
Line 98: Line 251:
  
 
==== Host Controller Interface (HCI) Initialization ====  
 
==== Host Controller Interface (HCI) Initialization ====  
 
* For TI SDK kernel v4.1.13, create a symbolic link to the bluetooth UART:
 
<pre>
 
root@debian-armhf:~# ln -sf /dev/ttyS9 /dev/ttyO9
 
</pre>
 
  
 
* Attach the ttyO9 serial port to the HCI Bluetooth subsystem:
 
* Attach the ttyO9 serial port to the HCI Bluetooth subsystem:
<pre>
+
<blockquote><pre>
root@debian-armhf:~# echo "enabled" > /sys/bus/platform/devices/reg-userspace-consumer.0/state
+
root@cl-rootfs:~# echo "enabled" > /sys/bus/platform/devices/reg-userspace-consumer.0/state
root@debian-armhf:~# hciattach -s 115200 /dev/ttyO9 texas 3000000
+
root@cl-rootfs:~# hciattach -s 115200 /dev/ttyS9 texas 3000000
 
Found a Texas Instruments' chip!
 
Found a Texas Instruments' chip!
 
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
 
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
 
Loaded BTS script version 1
 
Loaded BTS script version 1
 
texas: changing baud rate to 3000000, flow control to 1
 
texas: changing baud rate to 3000000, flow control to 1
[   89.019183] Bluetooth: Core ver 2.21
+
[ 359.147143] Bluetooth: Core ver 2.21
[   89.023025] NET: Registered protocol family 31
+
[ 359.151930] NET: Registered protocol family 31
[   89.027726] Bluetooth: HCI device and connection manager initialized
+
[ 359.156626] Bluetooth: HCI device and connection manager initialized
[   89.034581] Bluetooth: HCI socket layer initialized
+
[ 359.163317] Bluetooth: HCI socket layer initialized
[   89.039779] Bluetooth: L2CAP socket layer initialized
+
[ 359.168224] Bluetooth: L2CAP socket layer initialized
[   89.045296] Bluetooth: SCO socket layer initialized
+
[ 359.173380] Bluetooth: SCO socket layer initialized
[   89.055192] Bluetooth: HCI UART driver ver 2.3
+
[ 359.181770] Bluetooth: HCI UART driver ver 2.3
[   89.059914] Bluetooth: HCI UART protocol H4 registered
+
[ 359.186391] Bluetooth: HCI UART protocol H4 registered
[   89.065306] Bluetooth: HCI UART protocol LL registered
+
[ 359.191884] Bluetooth: HCI UART protocol BCSP registered
[   89.308172] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
+
[  359.197221] Bluetooth: HCI UART protocol LL registered
[   89.313747] Bluetooth: BNEP filters: protocol multicast
+
[ 359.202470] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   89.319275] Bluetooth: BNEP socket layer initialized
+
[  359.325453] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
 +
[ 359.330844] Bluetooth: BNEP filters: protocol multicast
 +
[ 359.336103] Bluetooth: BNEP socket layer initialized
 
Device setup complete
 
Device setup complete
</pre>
+
</pre></blockquote>
  
 
* Run HCI device configuration utility to retrieve detailed information about the Bluetooth device:
 
* Run HCI device configuration utility to retrieve detailed information about the Bluetooth device:
<pre>
+
<blockquote><pre>
root@debian-armhf:~# hciconfig -a
+
root@cl-rootfs:~# hciconfig -a
hci0:  Type: BR/EDR Bus: UART
+
ci0:  Type: Primary Bus: UART
         BD Address: 54:4A:16:13:0D:42 ACL MTU: 1021:6  SCO MTU: 180:4
+
         BD Address: 20:C3:8F:88:8C:3C ACL MTU: 1021:6  SCO MTU: 180:4
         UP RUNNING PSCAN
+
         UP RUNNING  
         RX bytes:704 acl:0 sco:0 events:43 errors:0
+
         RX bytes:725 acl:0 sco:0 events:46 errors:0
         TX bytes:1782 acl:0 sco:0 commands:43 errors:0
+
         TX bytes:2764 acl:0 sco:0 commands:46 errors:0
 
         Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
 
         Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
 
         Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  
 
         Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  
 
         Link policy: RSWITCH HOLD SNIFF  
 
         Link policy: RSWITCH HOLD SNIFF  
 
         Link mode: SLAVE ACCEPT  
 
         Link mode: SLAVE ACCEPT  
         Name: 'cl-som-am57x-sid'
+
         Name: 'cl-rootfs'
 
         Class: 0x000000
 
         Class: 0x000000
 
         Service Classes: Unspecified
 
         Service Classes: Unspecified
Line 146: Line 296:
 
         LMP Version: 4.1 (0x7)  Subversion: 0xac08
 
         LMP Version: 4.1 (0x7)  Subversion: 0xac08
 
         Manufacturer: Texas Instruments Inc. (13)
 
         Manufacturer: Texas Instruments Inc. (13)
</pre>
+
</pre></blockquote>
  
 
* If the HCI device is not running, use the below command to enable the HCI device:
 
* If the HCI device is not running, use the below command to enable the HCI device:
<pre>
+
<blockquote><pre>
root@debian-armhf:~# hciconfig hci0 up
+
root@cl-rootfs:~# hciconfig hci0 up
</pre>
+
</pre></blockquote>
 
* HCI Inquire remote devices.
 
* HCI Inquire remote devices.
<pre>
+
<blockquote><pre>
root@debian-armhf:~# hcitool scan
+
root@cl-rootfs:~# hcitool scan
 
Scanning ...
 
Scanning ...
</pre>
+
</pre></blockquote>
  
 
==== Bluez5 & PulseAudio ====
 
==== Bluez5 & PulseAudio ====
Line 163: Line 313:
 
PulseAudio 5 only supports the A2DP profile and not HSP/HFP. <br>
 
PulseAudio 5 only supports the A2DP profile and not HSP/HFP. <br>
 
* Software to install {{filename|'''pulseaudio'''}}, {{filename|'''pulseaudio-module-bluetooth'''}}
 
* Software to install {{filename|'''pulseaudio'''}}, {{filename|'''pulseaudio-module-bluetooth'''}}
 +
{{Note|{{filename|rootfs.tar.bz2}} has all these packages pre-installed. Continue to the [[#Start PulseAudio | Start PulseAudio]] section if you use this root filesystem.}}
 
===== Install and configure PulseAudio =====
 
===== Install and configure PulseAudio =====
 +
The included example user space (root file system) includes PulseAudio packages.
 +
Use the following to install the packages on alternative user space:
 
<pre>
 
<pre>
root@debian-armhf:~# apt-get update
+
root@cl-rootfs:~# apt-get update
root@debian-armhf:~# apt-get install pulseaudio pulseaudio-module-bluetooth
+
root@cl-rootfs:~# apt-get install pulseaudio pulseaudio-module-bluetooth bluez
 
</pre>
 
</pre>
 
* Create a systemd service for running pulseaudio as the pulse user.
 
* Create a systemd service for running pulseaudio as the pulse user.
<pre>
+
Included in the example user space: {{filename| /etc/systemd/system/pulseaudio.service}}
root@debian-armhf:~# cat << eof > /etc/systemd/system/pulseaudio.service
 
[Unit]
 
Description=Pulse Audio
 
 
 
[Service]
 
Type=simple
 
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disable-shm
 
 
 
[Install]
 
WantedBy=multi-user.target
 
eof
 
 
 
root@debian-armhf:~# chown pulse:pulse /etc/systemd/system/pulseaudio.service
 
</pre>
 
  
 
* Create a dbus configuration file for running pulseaudio. Give the pulse user permission to use Bluetooth.
 
* Create a dbus configuration file for running pulseaudio. Give the pulse user permission to use Bluetooth.
<pre>
+
Included in the example user space: {{filename| /etc/dbus-1/system.d/pulseaudio-bluetooth.conf}}
root@debian-armhf:~# cat << eof > /etc/dbus-1/system.d/pulseaudio-bluetooth.conf
 
<busconfig>
 
 
 
  <policy user="pulse">
 
    <allow send_destination="org.bluez"/>
 
  </policy>
 
  
</busconfig>
+
* Update PulseAudio startup script to automatically load driver modules for Bluetooth hardware.
eof
+
Included in the example user space, at the end of {{filename| /etc/pulse/system.pa}}
 
 
root@debian-armhf:~# chmod 0666 /etc/dbus-1/system.d/pulseaudio-bluetooth.conf
 
</pre>
 
* Paste the following lines to the end of /etc/pulse/system.pa:
 
<pre>
 
root@debian-armhf:~# cat << eof >> /etc/pulse/system.pa
 
### Automatically load driver modules for Bluetooth hardware
 
.ifexists module-bluetooth-policy.so
 
load-module module-bluetooth-policy
 
.endif
 
  
.ifexists module-bluetooth-discover.so
+
* Create configuration directory and fix the ownership.
load-module module-bluetooth-discover
+
Included in the example user space: {{filename|/var/run/pulse/.config/pulse}}
.endif
+
{{Note| Additional information can be found at archlinux [https://wiki.archlinux.org/index.php/PulseAudio/Configuration PulseAudio/Configuration]}}
eof
 
</pre>
 
* Create {{filename|/var/run/pulse/.config/pulse}} directory and fix the ownership.
 
<pre>
 
root@debian-armhf:~# mkdir -p /var/run/pulse/.config/pulse
 
root@debian-armhf:~# chown -R pulse:pulse /var/run/pulse
 
</pre>
 
* Add root to the pulse-access,audio groups
 
<pre>
 
root@debian-armhf:~# usermod -a -G pulse-access,audio root
 
</pre>
 
  
 
===== Start PulseAudio =====
 
===== Start PulseAudio =====
 
* Start PulseAudio service
 
* Start PulseAudio service
<pre>
+
<blockquote><pre>
root@debian-armhf:~# systemctl daemon-reload
+
root@cl-rootfs:~# systemctl daemon-reload
root@debian-armhf:~# systemctl start pulseaudio.service
+
root@cl-rootfs:~# systemctl start pulseaudio.service
</pre>
+
</pre></blockquote>
* Make sure that the service is active, running and reports on no error.
+
* Make sure that the service is active, running and reports no error
<pre>
+
<blockquote><pre>
root@debian-armhf:~# systemctl status pulseaudio.service
+
root@cl-rootfs:~# systemctl status pulseaudio.service
 
   Loaded: loaded (/etc/systemd/system/pulseaudio.service; disabled)
 
   Loaded: loaded (/etc/systemd/system/pulseaudio.service; disabled)
 
   Active: active (running) since Mon 2015-07-20 12:00:13 UTC; 1min 34s ago
 
   Active: active (running) since Mon 2015-07-20 12:00:13 UTC; 1min 34s ago
Line 236: Line 348:
 
   CGroup: /system.slice/pulseaudio.service
 
   CGroup: /system.slice/pulseaudio.service
 
           └─805 /usr/bin/pulseaudio --system --disallow-exit --disable-shm
 
           └─805 /usr/bin/pulseaudio --system --disallow-exit --disable-shm
</pre>
+
</pre></blockquote>
  
 
===== Bluez5 pairing =====
 
===== Bluez5 pairing =====
 
PulseAudio 5.x supports A2DP by default. Make sure the following packages are installed:
 
PulseAudio 5.x supports A2DP by default. Make sure the following packages are installed:
pulseaudio pulseaudio-module-bluetooth pulseaudio-utils, bluez, bluez-tools.
+
{{filename|pulseaudio}}, {{filename|pulseaudio-module-bluetooth}}, {{filename|pulseaudio-utils}}, {{filename|bluez}}, {{filename|bluez-tools}}.
  
 
* Start the Bluetooth system:
 
* Start the Bluetooth system:
 +
<blockquote><pre>
 +
root@cl-rootfs:~# systemctl start bluetooth
 +
</pre></blockquote>
 +
Now we can use the {{cmd|bluetoothctl}} command line utility to pair and connect. Run
 
<pre>
 
<pre>
root@debian-armhf:~# systemctl start bluetooth
+
root@cl-rootfs:~# bluetoothctl
</pre>
 
Now we can use the {{filename|'''bluetoothctl'''}} command line utility to pair and connect. Run
 
<pre>
 
root@debian-armhf:~# bluetoothctl
 
 
[bluetooth]#
 
[bluetooth]#
 
</pre>
 
</pre>
Line 282: Line 394:
  
 
===== Playback using PulseAudio =====
 
===== Playback using PulseAudio =====
{{Note|Next examples assume that the device mac address is '''00_07_A4_F2_B3_CB'''}}
+
{{Note|Next examples assume that the device mac address is {{parameter|00_07_A4_F2_B3_CB}}}}
 
* Show the PulseAudio device  
 
* Show the PulseAudio device  
<pre>
+
<blockquote><pre>
root@debian-armhf:~# pactl list cards  | awk '/00_07_A4_F2_B3_CB/' RS=""
+
root@cl-rootfs:~# pactl list cards  | awk '/00_07_A4_F2_B3_CB/' RS=""
 
Card #1                                                                                                                                                                     
 
Card #1                                                                                                                                                                     
 
         Name: bluez_card.00_07_A4_F2_B3_CB                                                                                                                                   
 
         Name: bluez_card.00_07_A4_F2_B3_CB                                                                                                                                   
Line 312: Line 424:
 
                 headset-input: Headset (priority: 0, latency offset: 0 usec, not available)
 
                 headset-input: Headset (priority: 0, latency offset: 0 usec, not available)
 
                         Part of profile(s): headset_head_unit
 
                         Part of profile(s): headset_head_unit
</pre>
+
</pre></blockquote>
:* Make sure the active card profile is a2dp_sink. Otherwise switch to it:
+
 
<pre>
+
* Make sure the active card profile is a2dp_sink. Otherwise switch to it:
 +
<blockquote><pre>
 
# pactl set-card-profile 1 a2dp_sink
 
# pactl set-card-profile 1 a2dp_sink
</pre>
+
</pre></blockquote>
:* Show the PulseAudio sink
+
 
<pre>
+
* Show the PulseAudio sink
root@debian-armhf:~# pactl list sinks | awk '/00_07_A4_F2_B3_CB/' RS=""
+
<blockquote><pre>
 +
root@cl-rootfs:~# pactl list sinks | awk '/00_07_A4_F2_B3_CB/' RS=""
 
Sink #1
 
Sink #1
 
         State: SUSPENDED
 
         State: SUSPENDED
         Name: bluez_sink.00_07_A4_F2_B3_CB
+
         Name: bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink
 
         Description: Motorola HT820
 
         Description: Motorola HT820
 
         Driver: module-bluez5-device.c
 
         Driver: module-bluez5-device.c
         Sample Specification: s16le 2ch 48000Hz
+
         Sample Specification: s16le 2ch 44100Hz
 
         Channel Map: front-left,front-right
 
         Channel Map: front-left,front-right
 
         Owner Module: 13
 
         Owner Module: 13
Line 332: Line 446:
 
                 balance 0.00
 
                 balance 0.00
 
         Base Volume: 65536 / 100% / 0.00 dB
 
         Base Volume: 65536 / 100% / 0.00 dB
         Monitor Source: bluez_sink.00_07_A4_F2_B3_CB.monitor
+
         Monitor Source: bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink.monitor
 
         Latency: 0 usec, configured 0 usec
 
         Latency: 0 usec, configured 0 usec
 
         Flags: HARDWARE DECIBEL_VOLUME LATENCY  
 
         Flags: HARDWARE DECIBEL_VOLUME LATENCY  
Line 353: Line 467:
 
         Formats:
 
         Formats:
 
                 pcm
 
                 pcm
</pre>
+
</pre></blockquote>
:* Play sound using {{filename|paplay}}. Example:
+
 
<pre>
+
* Play sound using {{filename|paplay}}. Example:
root@debian-armhf:~# paplay -d bluez_sink.00_07_A4_F2_B3_CB /path/to/<audio-file.wav>
+
<blockquote><pre>
</pre>
+
root@cl-rootfs:~# paplay -d bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink /path/to/<audio-file.wav>
 +
</pre></blockquote>
  
 
==== Obex FTP service ====
 
==== Obex FTP service ====
Line 364: Line 479:
 
Use the following command to install file transfer utility for devices that use the OBEX protocol:
 
Use the following command to install file transfer utility for devices that use the OBEX protocol:
 
<pre>
 
<pre>
root@debian-armhf:~# apt-get update
+
root@cl-rootfs:~# apt-get update
root@debian-armhf:~# apt-get install obexftp
+
root@cl-rootfs:~# apt-get install obexftp
 
</pre>
 
</pre>
  
Line 371: Line 486:
  
 
* Enable bluetooth on the phone. On CL-SOM-AM57x, scan for available devices to find out phone's BT address:
 
* Enable bluetooth on the phone. On CL-SOM-AM57x, scan for available devices to find out phone's BT address:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# hcitool scan
+
root@cl-rootfs:~# hcitool scan
 
Scanning ...
 
Scanning ...
 
00:15:2A:20:63:94 Nokia 6230i
 
00:15:2A:20:63:94 Nokia 6230i
</pre>
+
</pre></blockquote>
  
 
* Ensure the phone supports Obex FTP service:
 
* Ensure the phone supports Obex FTP service:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# sdptool search FTP
+
root@cl-rootfs:~# sdptool search FTP
 
Inquiring ...
 
Inquiring ...
 
Searching for FTP on 00:15:2A:20:63:94 ...
 
Searching for FTP on 00:15:2A:20:63:94 ...
Line 398: Line 513:
 
   "OBEX File Transfer" (0x1106)
 
   "OBEX File Transfer" (0x1106)
 
     Version: 0x0100
 
     Version: 0x0100
</pre>
+
</pre></blockquote>
  
 
* Follow the section "Bluez5 pairing" to pair the CL-SOM-AM57x module with the phone.
 
* Follow the section "Bluez5 pairing" to pair the CL-SOM-AM57x module with the phone.
 
* List phone's root folder:
 
* List phone's root folder:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# obexftp -b 00:15:2A:20:63:94  --list
+
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94  --list
 
Browsing 00:15:2A:20:63:94 ...
 
Browsing 00:15:2A:20:63:94 ...
 
Connecting..\done
 
Connecting..\done
Line 422: Line 537:
 
done
 
done
 
Disconnecting..-done
 
Disconnecting..-done
</pre>
+
</pre></blockquote>
  
 
* Transfer a file from CL-SOM-AM57x to the phone:
 
* Transfer a file from CL-SOM-AM57x to the phone:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# obexftp -b 00:15:2A:20:63:94 --put test_file.txt  
+
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94 --put test_file.txt  
 
Browsing 00:15:2A:20:63:94 ...
 
Browsing 00:15:2A:20:63:94 ...
 
Connecting..\done
 
Connecting..\done
Line 432: Line 547:
 
Sending "test_file.txt"...|done
 
Sending "test_file.txt"...|done
 
Disconnecting../done
 
Disconnecting../done
</pre>
+
</pre></blockquote>
  
 
* Retrieve a file from the phone to CL-SOM-AM57x:
 
* Retrieve a file from the phone to CL-SOM-AM57x:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# obexftp -b 00:15:2A:20:63:94 --get test_file.txt  
+
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94 --get test_file.txt  
 
Browsing 00:15:2A:20:63:94 ...
 
Browsing 00:15:2A:20:63:94 ...
 
Connecting..\done
 
Connecting..\done
Line 442: Line 557:
 
Receiving "test_file.txt".../done
 
Receiving "test_file.txt".../done
 
Disconnecting..-done
 
Disconnecting..-done
</pre>
+
</pre></blockquote>
  
 
=== WiFi ===
 
=== WiFi ===
Line 449: Line 564:
 
==== WiFi Initialization ====
 
==== WiFi Initialization ====
 
* The driver gets loaded automatically. Make sure that the WiFi driver is loaded:
 
* The driver gets loaded automatically. Make sure that the WiFi driver is loaded:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# lsmod | grep wl
+
root@cl-rootfs:~# lsmod | grep wl
 
wl18xx                89863  0  
 
wl18xx                89863  0  
 
wlcore                183512  1 wl18xx
 
wlcore                183512  1 wl18xx
Line 456: Line 571:
 
cfg80211              491510  3 mac80211,wl18xx,wlcore
 
cfg80211              491510  3 mac80211,wl18xx,wlcore
 
wlcore_sdio            6495  0  
 
wlcore_sdio            6495  0  
</pre>
+
</pre></blockquote>
* {{cmd|iwconfig}} command from {{cmd|wireless-tools}} package can be used to retrieve detailed information about the WiFi interfaces:
+
* {{cmd|iwconfig}} command from {{filename|wireless-tools}} package can be used to retrieve detailed information about the WiFi interfaces:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# iwconfig wlan0
+
root@cl-rootfs:~# iwconfig wlan0
 
wlan0    IEEE 802.11abgn  ESSID:off/any   
 
wlan0    IEEE 802.11abgn  ESSID:off/any   
 
           Mode:Managed  Access Point: Not-Associated  Tx-Power=0 dBm   
 
           Mode:Managed  Access Point: Not-Associated  Tx-Power=0 dBm   
Line 465: Line 580:
 
           Encryption key:off
 
           Encryption key:off
 
           Power Management:off
 
           Power Management:off
</pre>
+
</pre></blockquote>
  
 
* WLAN interface activating:
 
* WLAN interface activating:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# ifconfig wlan0 up
+
root@cl-rootfs:~# ifconfig wlan0 up
 
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
 
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
 
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
 
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
</pre>
+
</pre></blockquote>
 
* Sample WiFi scanning:
 
* Sample WiFi scanning:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# iwlist wlan0 scan
+
root@cl-rootfs:~# iwlist wlan0 scan
</pre>
+
</pre></blockquote>
 
The output will show the list of Access Points and Ad-Hoc cells in range.
 
The output will show the list of Access Points and Ad-Hoc cells in range.
 
For more information about connecting to wireless networks and tuning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.
 
For more information about connecting to wireless networks and tuning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.
Line 483: Line 598:
 
* Configuration sample
 
* Configuration sample
 
{{cmd|wpa_supplicant}} requires a configuration file to be created in order to get connected to a scanned wireless network.<br>
 
{{cmd|wpa_supplicant}} requires a configuration file to be created in order to get connected to a scanned wireless network.<br>
Make use of the example bellow and put the network name and the password into the "ssid/psk" fields.
+
:Create the configuration file example bellow in {{filename|/etc/wpa_supplicant.conf}} and put the network name and the password into the "ssid/psk" fields.
 
+
<blockquote><pre>
<pre>
 
root@cl-debian-armhf:~# cat << eof > /etc/wpa_supplicant.conf
 
 
ctrl_interface=/var/run/wpa_supplicant
 
ctrl_interface=/var/run/wpa_supplicant
  
Line 494: Line 607:
 
psk="wireless_network_password"
 
psk="wireless_network_password"
 
}
 
}
eof
+
</pre></blockquote>
</pre>
 
 
* Sample run
 
* Sample run
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# ifconfig wlan0 up
+
root@cl-rootfs:~# ifconfig wlan0 up
root@cl-debian-armhf:~# wpa_supplicant -B -Dwext -c /etc/wpa_supplicant.conf -i wlan0
+
root@cl-rootfs:~# wpa_supplicant -B -Dwext -c /etc/wpa_supplicant.conf -i wlan0
root@cl-debian-armhf:~# dhclient wlan0
+
root@cl-rootfs:~# dhclient wlan0
</pre>
+
</pre></blockquote>
  
 
=== Controller–area network (CAN) ===
 
=== Controller–area network (CAN) ===
Line 510: Line 622:
  
 
* Load Raw CAN protocol module:
 
* Load Raw CAN protocol module:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# modprobe can-raw
+
root@cl-rootfs:~# modprobe can-raw
 
   can: controller area network core (rev 20120528 abi 9)
 
   can: controller area network core (rev 20120528 abi 9)
 
   NET: Registered protocol family 29
 
   NET: Registered protocol family 29
 
   can: raw protocol (rev 20120528)
 
   can: raw protocol (rev 20120528)
</pre>
+
</pre></blockquote>
  
 
===== CAN interface configuration =====
 
===== CAN interface configuration =====
Line 521: Line 633:
  
 
* To make sure the right {{filename|ip}} utility is used, run:
 
* To make sure the right {{filename|ip}} utility is used, run:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# ip -V
+
root@cl-rootfs:~# ip -V
 
   ip utility, iproute2-ss140804
 
   ip utility, iproute2-ss140804
</pre>
+
</pre></blockquote>
 
* Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
 
* Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# ip link set can0 type can bitrate 125000
+
root@cl-rootfs:~# ip link set can0 type can bitrate 125000
</pre>
+
</pre></blockquote>
  
 
* Enable the CAN interface:
 
* Enable the CAN interface:
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# ip link set can0 up
+
root@cl-rootfs:~# ip link set can0 up
 
   net can0: c_can_hw_raminit_wait_syscon: time out
 
   net can0: c_can_hw_raminit_wait_syscon: time out
 
   c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
 
   c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
</pre>
+
</pre></blockquote>
  
 
===== Send/Receive packets =====
 
===== Send/Receive packets =====
Line 542: Line 654:
  
 
* Send standard CAN frame (on the first device):
 
* Send standard CAN frame (on the first device):
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# cansend can0 111#1122334455667788
+
root@cl-rootfs:~# cansend can0 111#1122334455667788
</pre>
+
</pre></blockquote>
  
 
* Send extended CAN frame (on the first device):
 
* Send extended CAN frame (on the first device):
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# cansend can0 11111111#1122334455667788
+
root@cl-rootfs:~# cansend can0 11111111#1122334455667788
</pre>
+
</pre></blockquote>
  
 
* Dump all received data frames as well as error frames (on the second device):
 
* Dump all received data frames as well as error frames (on the second device):
<pre>
+
<blockquote><pre>
root@cl-debian-armhf:~# candump any,0:0,#FFFFFFFF
+
root@cl-rootfs:~# candump any,0:0,#FFFFFFFF
 
   can0  111  [8] 11 22 33 44 55 66 77 88
 
   can0  111  [8] 11 22 33 44 55 66 77 88
 
   can0  11111111  [8] 11 22 33 44 55 66 77 88
 
   can0  11111111  [8] 11 22 33 44 55 66 77 88
</pre>
+
</pre></blockquote>
  
 
=== MMC/SD ===
 
=== MMC/SD ===
Line 576: Line 688:
 
To set the date and write it into the RTC do the following:
 
To set the date and write it into the RTC do the following:
 
<pre>
 
<pre>
root@cl-debian-armhf:~# date -s "31 JUL 2015 10:00:00"
+
root@cl-rootfs:~# date -s "31 JUL 2015 10:00:00"
 
Fri Jul 31 10:00:00 UTC 2015
 
Fri Jul 31 10:00:00 UTC 2015
root@cl-debian-armhf:~# /sbin/hwclock --systohc
+
root@cl-rootfs:~# /sbin/hwclock --systohc
root@cl-debian-armhf:~# hwclock -w
+
root@cl-rootfs:~# hwclock -w
Fri Jul 31 10:00:13 2015  -1.066224 seconds
 
 
</pre>
 
</pre>
  
 
To access the RTC time and date run:
 
To access the RTC time and date run:
 
<pre>
 
<pre>
root@cl-debian-armhf:~# hwclock
+
root@cl-rootfs:~# hwclock
 
Fri 31 Jul 2015 10:00:24 AM UTC  -0.083102 seconds
 
Fri 31 Jul 2015 10:00:24 AM UTC  -0.083102 seconds
 
</pre>
 
</pre>

Latest revision as of 15:01, 7 June 2017

Overview

The example run-time Linux filesystem image for the CompuLab CL-SOM-AM57x System-on-Module / Computer-on-Module is based on Debian GNU/Linux stretch/sid (armhf).

The default Debian sid Linux image includes many software packages. Among them:

  • Core system
  • Debian package management system
  • X11 Windowing System
  • Fluxbox desktop manager
  • SSH server and client
  • ALSA configuration and usage utilities

The Automatic Installation page provides a brief introduction on how to install the run-time Linux image.

Using Debian Linux on CL-SOM-AM57x

Connection and Logging In

Use the following username to login:

User: root

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

root password

This Debian rootfs comes without default root password.
The root password has to be set at the very first login:

Debian GNU/Linux stretch/sid cl-rootfs ttyS2

cl-rootfs login: root
You are required to change your password immediately (root enforced)
Enter new UNIX password:

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.

During start-up

  • The Weston starts with the current active display (HDMI by default - connector J4).
  • The Texas Instrument Matrix Weston clients is lunched.

Running Weston clients

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

There is a terminal icon, located in the left hand corner of the Weston desktop window. Clicking terminal icons should launch the weston-terminal on the Weston Desktop.

There are several other applications that are included in the example file system. To invoke these applications, the user should launch the weston-terminal and then invoke the client apps as described below from within the terminal window:

root@cl-rootfs:~# /etc/init.d/matrix-gui-2.0 start
root@cl-rootfs:~# /usr/bin/weston-calibrator
root@cl-rootfs:~# /usr/bin/weston-clickdot
root@cl-rootfs:~# /usr/bin/weston-cliptest
root@cl-rootfs:~# /usr/bin/weston-dnd
root@cl-rootfs:~# /usr/bin/weston-editor
root@cl-rootfs:~# /usr/bin/weston-eventdemo
root@cl-rootfs:~# /usr/bin/weston-flower
root@cl-rootfs:~# /usr/bin/weston-fullscreen
root@cl-rootfs:~# /usr/bin/weston-info
root@cl-rootfs:~# /usr/bin/weston-multi-resource
root@cl-rootfs:~# /usr/bin/weston-presentation-shm
root@cl-rootfs:~# /usr/bin/weston-resizor
root@cl-rootfs:~# /usr/bin/weston-scaler
root@cl-rootfs:~# /usr/bin/weston-simple-damage
root@cl-rootfs:~# /usr/bin/weston-simple-egl
root@cl-rootfs:~# /usr/bin/weston-simple-shm
root@cl-rootfs:~# /usr/bin/weston-simple-touch
root@cl-rootfs:~# /usr/bin/weston-smoke
root@cl-rootfs:~# /usr/bin/weston-stacking
root@cl-rootfs:~# /usr/bin/weston-subsurfaces
root@cl-rootfs:~# /usr/bin/weston-transformed

Software Management

Debian Linux image for CL-SOM-AM57x includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.

Display options

CL-SOM-AM57x evaluation platform has four video output interfaces: HDMI, LCD, DVI, and LVDS. Default configuration of Debian Linux for CL-SOM-AM57x uses HDMI (SB-SOM-AM57x J4 connector) as primary video output.

Touchscreen

CL-SOM-AM57x Evaluation Kit is equipped with Startek KD050C LCD 800x480 LCD touch panel. The touchscreen driver is modularized if you use default CL-SOM-AM57x configuration and is loaded by udev automatically on Linux boot. If the touchscreen driver is not loaded, the following command will load the touchscreen driver:

modprobe ads7846

Touchscreen calibration

A touchscreen device can be calibrated using weston-calibrator utility.

Admolition note.png LCD display should be selected for touchscreen calibration

To calibrate the touchscreen:

  • Launch Weston:
/etc/init.d/weston start
  • Make sure the touchscreen driver is loaded
  • Start the Weston calibrator:
/usr/bin/weston-calibrator
  • For proper calibration you are required to follow the calibrator and touch at the '+' locations.
  • The calibration file will be created at the following path:
/etc/udev/rules.d/ws-calibrate.rules

Analog Audio

CL-SOM-AM57x provides an analog audio interface, which is registered as a standard ALSA sound card. Use aplay -l to list all soundcards and digital audio devices registered on the system:

root@cl-rootfs:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: clsomamx57xx [cl-som-amx57xx], device 0: davinci-mcasp.0-wm8731-hifi wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Analog Audio Settings

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

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

or

  • amixer - set the “Output Mixer HiFi Playback Switch” control on using command line interface:
root@cl-rootfs:~# amixer cset numid=13 1
numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on

To set maximum playback volume, alsamixer or amixer applications can be used.

  • alsamixer - set the “Master” control to 100.

or

  • amixer - set the “Master Playback Volume” control to 127 by using command line interface:
root@cl-rootfs:~# amixer cset numid=1 127 127
numid=1,iface=MIXER,name='Master Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=127,127
  | dBscale-min=-121.00dB,step=1.00dB,mute=1

Analog Audio Playback

In order to play back 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@cl-rootfs:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=clsomamx57xx
    cl-som-amx57xx, 
    Default Audio Device
sysdefault:CARD=clsomamx57xx
    cl-som-amx57xx, 
    Default Audio Device
dmix:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct sample mixing device
dsnoop:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct sample snooping device
hw:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct hardware device without any conversions
plughw:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Hardware device with all software conversions
default:CARD=H58040000encode
    HDMI 58040000.encoder, 
    Default Audio Device
sysdefault:CARD=H58040000encode
    HDMI 58040000.encoder, 
    Default Audio Device
dmix:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct sample mixing device
dsnoop:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct sample snooping device
hw:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct hardware device without any conversions
plughw:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Hardware device with all software conversions
The next command can be used for audio playback:
root@cm-debian:~# aplay <wav-file>

Audio Input Settings

CL-SOM-AM57x provides an audio capturing feature from either Mic or Line In input sources. alsamixer or amixer can be used in order to switch between these inputs.

Mic
  • alsamixer
Line Input => 100
Line => off
Mic => on
  • amixer
amixer cset numid=3 31
amixer cset numid=4 0
amixer cset numid=6 1
amixer cset numid=11 1
amixer cset numid=14 1
Line In
  • alsamixer
Line Input => 100
Line => on
Mic => off
  • amixer
amixer cset numid=3 31
amixer cset numid=4 1
amixer cset numid=6 0
amixer cset numid=11 0
amixer cset numid=14 0

Sample Audio Recording

As soon as the correct input values have been 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@cl-rootfs:~# arecord -f dat -t wav /tmp/out.wav

Bluetooth

CL-SOM-AM57x features Bluetooth 4.1 BLE interface. Following sections describe the initialization and simple use cases of Bluetooth device.

Host Controller Interface (HCI) Initialization

  • Attach the ttyO9 serial port to the HCI Bluetooth subsystem:
root@cl-rootfs:~# echo "enabled" > /sys/bus/platform/devices/reg-userspace-consumer.0/state
root@cl-rootfs:~# hciattach -s 115200 /dev/ttyS9 texas 3000000
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
[  359.147143] Bluetooth: Core ver 2.21
[  359.151930] NET: Registered protocol family 31
[  359.156626] Bluetooth: HCI device and connection manager initialized
[  359.163317] Bluetooth: HCI socket layer initialized
[  359.168224] Bluetooth: L2CAP socket layer initialized
[  359.173380] Bluetooth: SCO socket layer initialized
[  359.181770] Bluetooth: HCI UART driver ver 2.3
[  359.186391] Bluetooth: HCI UART protocol H4 registered
[  359.191884] Bluetooth: HCI UART protocol BCSP registered
[  359.197221] Bluetooth: HCI UART protocol LL registered
[  359.202470] Bluetooth: HCI UART protocol Three-wire (H5) registered
[  359.325453] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  359.330844] Bluetooth: BNEP filters: protocol multicast
[  359.336103] Bluetooth: BNEP socket layer initialized
Device setup complete
  • Run HCI device configuration utility to retrieve detailed information about the Bluetooth device:
root@cl-rootfs:~# hciconfig -a
ci0:   Type: Primary  Bus: UART
        BD Address: 20:C3:8F:88:8C:3C  ACL MTU: 1021:6  SCO MTU: 180:4
        UP RUNNING 
        RX bytes:725 acl:0 sco:0 events:46 errors:0
        TX bytes:2764 acl:0 sco:0 commands:46 errors:0
        Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF 
        Link mode: SLAVE ACCEPT 
        Name: 'cl-rootfs'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous, 
        HCI Version: 4.1 (0x7)  Revision: 0x0
        LMP Version: 4.1 (0x7)  Subversion: 0xac08
        Manufacturer: Texas Instruments Inc. (13)
  • If the HCI device is not running, use the below command to enable the HCI device:
root@cl-rootfs:~# hciconfig hci0 up
  • HCI Inquire remote devices.
root@cl-rootfs:~# hcitool scan
Scanning ...

Bluez5 & PulseAudio

Debian stretch/sid is using BlueZ 5 and PluseAudio 5. BlueZ 5 dropped support for alsa, and uses PulseAudio.
PulseAudio 5 only supports the A2DP profile and not HSP/HFP.

  • Software to install pulseaudio, pulseaudio-module-bluetooth
Admolition note.png rootfs.tar.bz2 has all these packages pre-installed. Continue to the Start PulseAudio section if you use this root filesystem.
Install and configure PulseAudio

The included example user space (root file system) includes PulseAudio packages. Use the following to install the packages on alternative user space:

root@cl-rootfs:~# apt-get update
root@cl-rootfs:~# apt-get install pulseaudio pulseaudio-module-bluetooth bluez
  • Create a systemd service for running pulseaudio as the pulse user.

Included in the example user space: /etc/systemd/system/pulseaudio.service

  • Create a dbus configuration file for running pulseaudio. Give the pulse user permission to use Bluetooth.

Included in the example user space: /etc/dbus-1/system.d/pulseaudio-bluetooth.conf

  • Update PulseAudio startup script to automatically load driver modules for Bluetooth hardware.

Included in the example user space, at the end of /etc/pulse/system.pa

  • Create configuration directory and fix the ownership.

Included in the example user space: /var/run/pulse/.config/pulse

Admolition note.png Additional information can be found at archlinux PulseAudio/Configuration
Start PulseAudio
  • Start PulseAudio service
root@cl-rootfs:~# systemctl daemon-reload
root@cl-rootfs:~# systemctl start pulseaudio.service
  • Make sure that the service is active, running and reports no error
root@cl-rootfs:~# systemctl status pulseaudio.service
   Loaded: loaded (/etc/systemd/system/pulseaudio.service; disabled)
   Active: active (running) since Mon 2015-07-20 12:00:13 UTC; 1min 34s ago
 Main PID: 805 (pulseaudio)
   CGroup: /system.slice/pulseaudio.service
           └─805 /usr/bin/pulseaudio --system --disallow-exit --disable-shm
Bluez5 pairing

PulseAudio 5.x supports A2DP by default. Make sure the following packages are installed: pulseaudio, pulseaudio-module-bluetooth, pulseaudio-utils, bluez, bluez-tools.

  • Start the Bluetooth system:
root@cl-rootfs:~# systemctl start bluetooth

Now we can use the bluetoothctl command line utility to pair and connect. Run

root@cl-rootfs:~# bluetoothctl
[bluetooth]#

to be greeted by its internal command prompt.Then enter:

[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on

Make sure that an A2DP device is in pairing mode. It should be discovered shortly. For example,

[NEW] Device 00:07:A4:F2:B3:CB Motorola HT820

shows a device that calls itself "Motorola HT820" and has MAC address 00:07:A4:F2:B3:CB. Use the MAC address to initiate the pairing:

[bluetooth]# pair 00:07:A4:F2:B3:CB

After pairing, connect the device:

[bluetooth]# connect 00:07:A4:F2:B3:CB

After the successful connection, the new output device will be created in PulseAudio.
Scanning can be disabled now:

[bluetooth]# scan off

Exit the program:

[bluetooth]# exit
Playback using PulseAudio
Admolition note.png Next examples assume that the device mac address is 00_07_A4_F2_B3_CB
  • Show the PulseAudio device
root@cl-rootfs:~# pactl list cards  | awk '/00_07_A4_F2_B3_CB/' RS=""
Card #1                                                                                                                                                                     
        Name: bluez_card.00_07_A4_F2_B3_CB                                                                                                                                  
        Driver: module-bluez5-device.c                                                                                                                                      
        Owner Module: 13                                                                                                                                                    
        Properties:                                                                                                                                                         
                device.description = "Motorola HT820"                                                                                                                       
                device.string = "00:07:A4:F2:B3:CB"                                                                                                                         
                device.api = "bluez"                                                                                                                                        
                device.class = "sound"                                                                                                                                      
                device.bus = "bluetooth"                                                                                                                                    
                device.form_factor = "headset"                                                                                                                              
                bluez.path = "/org/bluez/hci0/dev_00_07_A4_F2_B3_CB"                                                                                                        
                bluez.class = "0x240404"                                                                                                                                    
                bluez.alias = "Motorola HT820"                                                                                                                              
                device.icon_name = "audio-headset-bluetooth"                                                                                                                
                device.intended_roles = "phone"                                                                                                                             
        Profiles:                                                                                                                                                           
                headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: no)
                a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: a2dp_sink
        Ports:
                headset-output: Headset (priority: 0, latency offset: 0 usec)
                        Part of profile(s): headset_head_unit, a2dp_sink
                headset-input: Headset (priority: 0, latency offset: 0 usec, not available)
                        Part of profile(s): headset_head_unit
  • Make sure the active card profile is a2dp_sink. Otherwise switch to it:
# pactl set-card-profile 1 a2dp_sink
  • Show the PulseAudio sink
root@cl-rootfs:~# pactl list sinks | awk '/00_07_A4_F2_B3_CB/' RS=""
Sink #1
        State: SUSPENDED
        Name: bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink
        Description: Motorola HT820
        Driver: module-bluez5-device.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 13
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                bluetooth.protocol = "a2dp_sink"
                device.description = "Motorola HT820"
                device.string = "00:07:A4:F2:B3:CB"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
                bluez.path = "/org/bluez/hci0/dev_00_07_A4_F2_B3_CB"
                bluez.class = "0x240404"
                bluez.alias = "Motorola HT820"
                device.icon_name = "audio-headset-bluetooth"
                device.intended_roles = "phone"
        Ports:
                headset-output: Headset (priority: 0)
        Active Port: headset-output
        Formats:
                pcm
  • Play sound using paplay. Example:
root@cl-rootfs:~# paplay -d bluez_sink.00_07_A4_F2_B3_CB.a2dp_sink /path/to/<audio-file.wav>

Obex FTP service

The OBject EXchange protocol (OBEX) can be used to exchange all kind of objects like files, pictures, calendar entries (vCal) and business cards (vCard) over bluetooth, IrDA, USB and serial cable links.
Use the following command to install file transfer utility for devices that use the OBEX protocol:

root@cl-rootfs:~# apt-get update
root@cl-rootfs:~# apt-get install obexftp

Following examples demonstrate its usage with mobile phone device.

  • Enable bluetooth on the phone. On CL-SOM-AM57x, scan for available devices to find out phone's BT address:
root@cl-rootfs:~# hcitool scan
Scanning ...
	00:15:2A:20:63:94	Nokia 6230i
  • Ensure the phone supports Obex FTP service:
root@cl-rootfs:~# sdptool search FTP
Inquiring ...
Searching for FTP on 00:15:2A:20:63:94 ...
Service Name: OBEX File Transfer
Service RecHandle: 0x100de
Service Class ID List:
  "OBEX File Transfer" (0x1106)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 10
  "OBEX" (0x0008)
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "OBEX File Transfer" (0x1106)
    Version: 0x0100
  • Follow the section "Bluez5 pairing" to pair the CL-SOM-AM57x module with the phone.
  • List phone's root folder:
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94  --list
Browsing 00:15:2A:20:63:94 ...
Connecting..\done
Tried to connect for 579ms
Receiving "(null)".../<?xml version="1.0"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"
 [ <!ATTLIST folder mem-type CDATA #IMPLIED> ]>
<folder-listing version="1.0">
    <folder name="EXTENTSION" user-perm="RW" mem-type="MMC"/>
    <folder name="Images" created="19800101T000000" user-perm="R" mem-type="DEV"/>
    <folder name="Video clips" created="19800101T000000" user-perm="R" mem-type="DEV"/>
    <folder name="Music files" created="19800101T000000" user-perm="R" mem-type="DEV"/>
    <folder name="Themes" created="19800101T000000" user-perm="RW" mem-type="DEV"/>
    <folder name="Graphics" created="19800101T000000" user-perm="R" mem-type="DEV"/>
    <folder name="Tones" created="19800101T000000" user-perm="R" mem-type="DEV"/>
    <folder name="Recordings" created="19800101T000000" user-perm="R" mem-type="DEV"/>
</folder-listing>
done
Disconnecting..-done
  • Transfer a file from CL-SOM-AM57x to the phone:
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94 --put test_file.txt 
Browsing 00:15:2A:20:63:94 ...
Connecting..\done
Tried to connect for 380ms
Sending "test_file.txt"...|done
Disconnecting../done
  • Retrieve a file from the phone to CL-SOM-AM57x:
root@cl-rootfs:~# obexftp -b 00:15:2A:20:63:94 --get test_file.txt 
Browsing 00:15:2A:20:63:94 ...
Connecting..\done
Tried to connect for 267ms
Receiving "test_file.txt".../done
Disconnecting..-done

WiFi

CL-SOM-AM57x features 802.11b/g/n wireless connectivity solution, implemented with the TI WiLink 8 WL1801 Wireless controller module.

WiFi Initialization

  • The driver gets loaded automatically. Make sure that the WiFi driver is loaded:
root@cl-rootfs:~# lsmod | grep wl
wl18xx                 89863  0 
wlcore                183512  1 wl18xx
mac80211              606845  2 wl18xx,wlcore
cfg80211              491510  3 mac80211,wl18xx,wlcore
wlcore_sdio             6495  0 
  • iwconfig command from wireless-tools package can be used to retrieve detailed information about the WiFi interfaces:
root@cl-rootfs:~# iwconfig wlan0
wlan0     IEEE 802.11abgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
  • WLAN interface activating:
root@cl-rootfs:~# ifconfig wlan0 up
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
  • Sample WiFi scanning:
root@cl-rootfs:~# iwlist wlan0 scan

The output will show the list of Access Points and Ad-Hoc cells in range. For more information about connecting to wireless networks and tuning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.

wpa_supplicant

  • Configuration sample

wpa_supplicant requires a configuration file to be created in order to get connected to a scanned wireless network.

Create the configuration file example bellow in /etc/wpa_supplicant.conf and put the network name and the password into the "ssid/psk" fields.
ctrl_interface=/var/run/wpa_supplicant

network={
	ssid="wireless_network_name"
	key_mgmt=WPA-PSK
	psk="wireless_network_password"
}
  • Sample run
root@cl-rootfs:~# ifconfig wlan0 up
root@cl-rootfs:~# wpa_supplicant -B -Dwext -c /etc/wpa_supplicant.conf -i wlan0
root@cl-rootfs:~# dhclient wlan0

Controller–area network (CAN)

The CL-SOM-AM57x features a Dual Controller Area Network (DCAN) Modules integrated into Sitara AM57x SoC. The DCAN implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s.

Loading CAN modules

If the DCAN driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface.

  • Load Raw CAN protocol module:
root@cl-rootfs:~# modprobe can-raw
  can: controller area network core (rev 20120528 abi 9)
  NET: Registered protocol family 29
  can: raw protocol (rev 20120528)
CAN interface configuration

It is recommended configure the CAN interface, with the iproute2 utilities.

  • To make sure the right ip utility is used, run:
root@cl-rootfs:~# ip -V
  ip utility, iproute2-ss140804
  • Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
root@cl-rootfs:~# ip link set can0 type can bitrate 125000
  • Enable the CAN interface:
root@cl-rootfs:~# ip link set can0 up
  net can0: c_can_hw_raminit_wait_syscon: time out
  c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
Send/Receive packets

Use cansend and candump utilities to send and receive packets via CAN interface.

  • Send standard CAN frame (on the first device):
root@cl-rootfs:~# cansend can0 111#1122334455667788
  • Send extended CAN frame (on the first device):
root@cl-rootfs:~# cansend can0 11111111#1122334455667788
  • Dump all received data frames as well as error frames (on the second device):
root@cl-rootfs:~# candump any,0:0,#FFFFFFFF
  can0  111  [8] 11 22 33 44 55 66 77 88
  can0  11111111  [8] 11 22 33 44 55 66 77 88

MMC/SD

The support for MMC/SD card on CL-SOM-AM57x is built into the Linux kernel. To mount the memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. For example, suppose MMC/SD partition you'd like to mount is mmcblk0p1 then:

mkdir -p /mnt/mmcblk0p1 && mount /dev/mmcblk0p1 /mnt/mmcblk0p1

USB 3.0 Dual-Role-Device

CL-SOM-AM57x has USB DWC3 (XHCI) based controller. It features SuperSpeed (SS) USB 3.0 Dual-Role-Device (DRD) subsystem with integrated SS (USB3.0) PHY and HS/FS (USB2.0) PHY. Current Linux kernel support of DWC3 features does not allow dynamic role (host/device) switching in runtime. By default, host role is assigned to CL-SOM-AM57x USB 3.0 port.

RTC

To set the date and write it into the RTC do the following:

root@cl-rootfs:~# date -s "31 JUL 2015 10:00:00"
Fri Jul 31 10:00:00 UTC 2015
root@cl-rootfs:~# /sbin/hwclock --systohc
root@cl-rootfs:~# hwclock -w

To access the RTC time and date run:

root@cl-rootfs:~# hwclock
Fri 31 Jul 2015 10:00:24 AM UTC  -0.083102 seconds

See also