How to build a kernel on a Parallela board

Forum about Parallella boot process, linux kernel, distros, SD-cards, etc.

How to build a kernel on a Parallela board

Postby shodruk » Sat May 17, 2014 9:57 am

This guide is only about native compiling on a Parallella board.

Cross compiling guide is here.
https://github.com/parallella/parallella-bin

Install dependent packages

Code: Select all
sudo apt-get install build-essential git libncurses5-dev u-boot-tools bc


Get the kernel source

Code: Select all
mkdir ~/src

cd ~/src

wget -O parallella-linux-adi-xcomm_zynq.tar.gz https://github.com/parallella/parallella-linux-adi/archive/xcomm_zynq.tar.gz

tar xzf parallella-linux-adi-xcomm_zynq.tar.gz

cd parallella-linux-adi-xcomm_zynq


Configuration

Code: Select all
make mrproper

make parallella_defconfig

# If you want to customize the configuration, execute this command

make menuconfig

# e.g. enable USB sound adapter
# Device Drivers->Sound card support->Advanced Linux Sound Architecture->USB sound devices->USB Audio/MIDI driver[*] (Press Y), Save, Exit

nano Makefile


(search and edit these lines)

Code: Select all
EXTRAVERSION = -parallella

CFLAGS_MODULE   = -fno-stack-protector

CFLAGS_KERNEL   = -fno-stack-protector


Build the kernel

Code: Select all
make -j 2 LOADADDR=0x8000 uImage


Install

Code: Select all
sudo mount /dev/mmcblk0p1 /mnt

# If you get an error, try these commands, then mount again)
# sudo mknod -m 660 /dev/mmcblk0 b 179 0
# sudo mknod -m 660 /dev/mmcblk0p1 b 179 1
# sudo mknod -m 660 /dev/mmcblk0p2 b 179 2

sudo cp /mnt/uImage /mnt/uImage.bak

sudo cp arch/arm/boot/uImage /mnt/

# If you want to use modules, execute these commands
# make modules
# sudo make modules_install

sudo sync

sudo reboot


To use USB devices properly, you should enable devtmpfs.
http://elinux.org/Parallella_Linaro_Nan ... e_devtmpfs
Last edited by shodruk on Tue Jun 24, 2014 11:08 am, edited 3 times in total.
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: How to build a kernel on a Parallela board

Postby shodruk » Tue May 20, 2014 7:20 am

If you want to use USB sound adapter instead of the HDMI sound output, you have to configure ~/.asoundrc

Code: Select all
nano ~/.asoundrc

(copy, paste and save)
Code: Select all
defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

pcm.!default {
 type rate
 slave {
  pcm "hw:1"
  rate 48000
 }
 converter "samplerate"
}
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: How to build a kernel on a Parallela board

Postby nickoppen » Sat May 24, 2014 11:03 am

Shodruky,

I'm having no luck with usb sound on my headset. I modified my .asoundrc to be the above file and I got "Cannot open default device" (or similar). Do I need to do anything else to use it?

I've got a Logitech head set connected to my hub and lsusb (which is now working!) shows it as device 5. I work mainly headless so I'd like to use my usb phones for sound.

Your HDMI version of this file works fine. I've gotten sound from vlc and SMPlayer.

I've tried alsaconf that most sites mention but that is not found. alsa-base is installed and up-to-date.

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: How to build a kernel on a Parallela board

Postby shodruk » Sat May 24, 2014 2:10 pm

nick,

What is the product name of your headset?

and post the outputs of these commands.

$ lsusb
$ cat /proc/asound/cards
$ cat /proc/asound/devices
$ cat /proc/asound/pcm
$ cat /proc/asound/timers
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: How to build a kernel on a Parallela board

Postby nickoppen » Sun May 25, 2014 12:20 am

Hi Shodruky,

Here is the output:


First with no headset attached and the HDMI text in .asoundrc ..................................................

Code: Select all
linaro-nano:~> lsusb
Bus 001 Device 009: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 008: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]
Bus 001 Device 006: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

linaro-nano:~> cat /proc/asound/cards
 0 [monitor        ]: HDMI_monitor - HDMI monitor
                      HDMI monitor

linaro-nano:~> cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 33:        : timer

linaro-nano:~> cat /proc/asound/pcm
00-00: HDMI adv7511-0 :  : playback 1

linaro-nano:~> cat /proc/asound/timers
G0: system timer : 10000.000us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE

Now I've attached the Logitect headset, replaced the .asoundrc text and rebooted...................................

Code: Select all
linaro-nano:~> lsusb

Bus 001 Device 005: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 004: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]
Bus 001 Device 003: ID 046d:0a0c Logitech, Inc. Clear Chat Comfort USB Headset
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

linaro-nano:~> cat /proc/asound/cards
 0 [monitor        ]: HDMI_monitor - HDMI monitor
                      HDMI monitor

linaro-nano:~> cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 33:        : timer

linaro-nano:~>  cat /proc/asound/pcm
00-00: HDMI adv7511-0 :  : playback 1

linaro-nano:~> cat /proc/asound/timers
G0: system timer : 10000.000us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE


Apart from the head set showing up on lsusb, there does not seem to be any difference.

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: How to build a kernel on a Parallela board

Postby shodruk » Sun May 25, 2014 7:59 am

What is the output of this command:

$ lsusb -v -d 046d:0a0c

reconnect the USB audio, then

$ tail -n 20 /var/log/syslog
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: How to build a kernel on a Parallela board

Postby nickoppen » Sun May 25, 2014 8:16 am

The output from the lsusb -v -d was a bit of a mouthful so I've attached as a file.

headset.txt
Output from lsusb -v -d 046d:0a0c
(12.09 KiB) Downloaded 999 times


The tail of the syslog file is:

Code: Select all
May 25 00:29:16 linaro-nano dnsmasq[1915]: warning: no upstream servers configured
May 25 00:29:16 linaro-nano dnsmasq[1915]: setting upstream servers from DBus
May 25 00:29:16 linaro-nano dnsmasq[1915]: using nameserver 10.1.1.1#53
May 25 00:29:16 linaro-nano dbus[1053]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
May 25 08:03:50 linaro-nano ntpdate[1948]: step time server 91.189.89.199 offset 27266.027181 sec
May 25 08:03:57 linaro-nano NetworkManager[1566]: <info> (eth3): IP6 addrconf timed out or failed.
May 25 08:03:57 linaro-nano NetworkManager[1566]: <info> Activation (eth3) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
May 25 08:03:57 linaro-nano NetworkManager[1566]: <info> Activation (eth3) Stage 4 of 5 (IPv6 Configure Timeout) started...
May 25 08:03:57 linaro-nano NetworkManager[1566]: <info> Activation (eth3) Stage 4 of 5 (IPv6 Configure Timeout) complete.
May 25 08:05:47 linaro-nano dbus[1053]: [system] Activating service name='org.freedesktop.UDisks2' (using servicehelper)
May 25 08:05:48 linaro-nano udisksd[2147]: udisks daemon version 2.1.0 starting
May 25 08:05:48 linaro-nano dbus[1053]: [system] Successfully activated service 'org.freedesktop.UDisks2'
May 25 08:05:48 linaro-nano udisksd[2147]: Acquired the name org.freedesktop.UDisks2 on the system message bus
May 25 08:08:33 linaro-nano kernel: hid-generic 0003:046D:0A0C.0001: can't reset device, xusbps-ehci.0-1.1/input3, status -71
May 25 08:08:33 linaro-nano kernel: usb 1-1.1: USB disconnect, device number 3
May 25 08:09:04 linaro-nano kernel: usb 1-1.1: new full-speed USB device number 6 using xusbps-ehci
May 25 08:09:04 linaro-nano kernel: input: Logitech Logitech USB Headset as /devices/amba.1/e0002000.usb/xusbps-ehci.0/usb1/1-1/1-1.1/1-1.1:1.3/input/input1
May 25 08:09:04 linaro-nano kernel: hid-generic 0003:046D:0A0C.0002: input,hidraw0: USB HID v1.00 Device [Logitech Logitech USB Headset] on usb-xusbps-ehci.0-1.1/input3
May 25 08:09:04 linaro-nano mtp-probe: checking bus 1, device 6: "/sys/devices/amba.1/e0002000.usb/xusbps-ehci.0/usb1/1-1/1-1.1"
May 25 08:09:04 linaro-nano mtp-probe: bus: 1, device: 6 was not an MTP device


I's all gibberish to me so I hope it means something to you.

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: How to build a kernel on a Parallela board

Postby shodruk » Sun May 25, 2014 12:33 pm

Sorry, one more...

$ zcat /proc/config.gz | grep SND
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: How to build a kernel on a Parallela board

Postby nickoppen » Sun May 25, 2014 9:19 pm

Hey, no worries. I'm happy to run any command you like!

Here it is:

Code: Select all
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_DMAENGINE_PCM=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_COMPRESS_OFFLOAD=y
CONFIG_SND_JACK=y
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
# CONFIG_SND_VERBOSE_PROCFS is not set
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDA_INTEL is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
# CONFIG_SND_ARM is not set
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
CONFIG_SND_SOC_ADI=y
CONFIG_SND_SOC_AXI_SPDIF=y
CONFIG_SND_SOC_ADI_AXI_I2S=y
CONFIG_SND_SOC_ADV7511_HDMI=y
CONFIG_SND_SOC_ZED_ADAU1761=y
# CONFIG_SND_ATMEL_SOC is not set
# CONFIG_SND_DESIGNWARE_I2S is not set
CONFIG_SND_SOC_I2C_AND_SPI=y
CONFIG_SND_SOC_ADAU17X1=y
CONFIG_SND_SOC_ADAU1761=y
CONFIG_SND_SOC_SIGMADSP=y
# CONFIG_SND_SIMPLE_CARD is not set

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: How to build a kernel on a Parallela board

Postby shodruk » Mon May 26, 2014 10:41 am

It seems that your kernel doesn't support USB audio driver.
Are you using current kernel source and rebuilt it?
Also we have to enable USB audio driver with menuconfig.

# e.g. enable USB sound adapter
# Device Drivers->Sound card support->Advanced Linux Sound Architecture->USB sound devices->USB Audio/MIDI driver[*] (Press Y), Save, Exit

We should be able to see these options in a properly configured kernel.

CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y

viewtopic.php?f=48&t=1230#p7643
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Next

Return to Linux/U-Boot

Who is online

Users browsing this forum: No registered users and 2 guests

cron