CL-SOM-iMX7: Yocto Linux: User Space

From Compulab Mediawiki
Revision as of 09:48, 25 April 2017 by Ilya (talk) (WiFi Initialization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

The example run-time Yocto Linux filesystem image for the CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module is based on NXP Community Yocto Project BSP for i.MX based boards.

The Yocto Linux manual installation on SD card page provides a brief introduction on how to install the run-time Yocto Linux image.


Admolition note.png The article uses cl-rootfs hostname. A real hostname may be different.

Using Yocto Linux on CL-SOM-iMX7

Connection and Logging In

Use the root username to login:

cl-rootfs login: root

Networking

The networking configuration in the example Yocto Linux image is almost the same as in the Debian Linux image.

Analog Audio

Use aplay -l to list all sound cards and digital audio devices registered on the system:

root@cl-rootfs:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: clsomimx7 [cl-som-imx7], device 0: 308a0000.sai-wm8731-hifi wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

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=clsomimx7
    cl-som-imx7, 
    Default Audio Device
sysdefault:CARD=clsomimx7
    cl-som-imx7, 
    Default Audio Device
dmix:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct sample mixing device
dsnoop:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct sample snooping device
hw:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct hardware device without any conversions
plughw:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Hardware device with all software conversions

The next command can be used for audio play back:

root@cl-rootfs:~# aplay -D sysdefault <wav-file>

Audio Input Settings

CL-SOM-iMX7 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
Capture Volume => 100
Line Capture Switch => off
Mic Capture Switch => on
Input Mux => Mic
  • amixer
amixer cset numid=1 65536
amixer -c 0 cset numid=3 31,31
amixer -c 0 cset numid=4 0
amixer -c 0 cset numid=6 1
amixer -c 0 cset numid=14 1
Line In
  • alsamixer
Capture Volume => 100
Line Capture Switch => on
Mic Capture Switch => off
Input Mux => Line In
  • amixer
amixer cset numid=1 65536
amixer -c 0 cset numid=3 31
amixer -c 0 cset numid=4 1
amixer -c 0 cset numid=6 0
amixer -c 0 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 -D sysdefault -d 10 -f dat -t wav /tmp/out.wav

WiFi

By default all wireless interfaces are soft blocked. Use the rfkill utility to block/unblock wireless interfaces and display their status.

WiFi Initialization

  • The WiFi driver gets loaded automatically.
Make sure that the WiFi driver is loaded:
root@cl-rootfs:~# lsmod | grep wl18xx
wl18xx                 84190  0
The WiFi driver can be loaded manually:
root@cl-rootfs:~# modprobe wl18xx
  • Configure wpa_supplicant to connect to SSID with no key management. Put the network name into the "ssid" fields:
root@cl-rootfs:~# cat << EOF > /etc/wpa_supplicant.conf
network={
        scan_ssid=1
        ssid="wireless_network_name"
        key_mgmt=NONE
}
EOF
or with key management. Put the network name and the password into the "ssid/psk" fields:
root@cl-rootfs:~# cat << EOF > /etc/wpa_supplicant.conf
network={
        scan_ssid=1
        ssid="wireless_network_name"
        key_mgmt=WPA-PSK
        psk="wireless_network_password"
}
EOF
  • Unblock the interface:
root@cl-rootfs:~# rfkill unblock 1
root@cl-rootfs:~# rfkill list 1
1: phy0: wlan
        Soft blocked: no
        Hard blocked: no
  • Bring the wireless interface up:
root@cl-rootfs:~# ifup wlan0
  • Obtain an IP address:
root@cl-rootfs:~# udhcpc -i wlan0