Transcode Videos with VLC

Pick up a video, any video and run it on VLC.

Go to Tools->Codec information and check the video and audio codecs.

If you want to change containers, for eaxmple from PS/VOD to TS, you will only need to demux and mux into a new container. But if there’s a weird audio codec for example, you might need to transcode the audio and can actually copy the video.

So Open VLC and then

  1. Multimedia->Convert/save
  2. Open the File you want to convert
  3. Click Convert/Save for next
  4. Select a TS profile
  5. Edit that profile
  6. Go to video and select “Keep the original video” to keep the original video content.
    • Beware that video codec needs to be compatible with TS containers in order to copy, instead of transcode
  7.  Go to audio and check if its configured for transcoding
  8. Save
  9. Select output file
  10. Press begin

And that’s all. VLC will start “Streaming” meaning, its remuxing, transcoding your file into the destination file.

Running Kernel 3.19 in Matrix TBS2910

Here we go again.

After successfully installing u-boot we can now move to the real deal, that is, building a minimum working system. Bare in mind that these are manual learning procedures and nothing more. I’m learning as I go, so keep in mind that many things might be done a different, yet better way(e.g. YOCTO). This was done purely for learning purposes.

TBS_Matrix_Board

Requisites:

  • Matrix TBS2910 (mine V2.1)
  • Mini USB cable for the OTG
  • TTL-232R-3V3 for the UART
  • Recent Linux Debian based environment (e.g Ubuntu 14.04)
  • Git/Compilation skills
  • Ethernet Cable
  • TFTP Server (e.g. tftp-hpa)

Again no need for a TFTP server.

Buildroot

Buildroot lets you create a complete Linux system to put on top of our kernel. The buildroot actually installs a ARM TOOLCHAIN that you can use later.

wget http://buildroot.uclibc.org/downloads/buildroot-2014.11.tar.gz
tar -zxvf buildroot-2014.11.tar.gz
cd buildroot-2014.11

make menuconfig

Now Select the following options

  • Target ARM (Little-Endian)
  • Target Cortex A-9
  • Under toolchain: enable large file support and WCHAR
  • Under System Configuration, chose ttymxc1 as the “Port to run a getty (login prompt) on”
  • Under Package Selection:Hardware, enabled dosfstools and e2fsprogs
  • Under Filesystem Images, selected Output cpio – gzipped
make busybox-menuconfig
# Exit without doing nothing. Just to save

export ARCH=arm
make V=1 2>&1|tee make.out
ls output/images/
export PATH=$PATH:/path/to/u-boot/tools

There is no need to wrap buildroot for u-boot, because instead we can add it to our uImage itself.

GCC toolchain will be created under ./output/host/opt/ext-toolchain/bin/.
ROOTFS image will be created under ./output/images/rootfs.cpio.gz


Kernel 3.19

wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.tar.xz
tar -zxvf linux-3.19.tar.xz
export ARCH=arm
# You can point to recently created buildroot toochain
export CROSS_COMPILE=arm-linux-gnueabi-
make distclean
make imx_v6_v7_defconfig
make

Before we create the uImage, we need to edit .config and add the following lines.


CONFIG_INITRAMFS_SOURCE="/path/to/buildroot/output/images/rootfs.cpio.gz"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0

After that:

# Export u-boot tools path in order to get mkImage
export PATH=$PATH:/path/to/u-boot/tools
make uImage LOADADDR=0x10800000

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  Image arch/arm/boot/uImage is ready

#Finally compile Device Tree Binary
make dtbs imx6q-tbs2910.dtb

U-Boot Fix

In order to get u-boot to accept a uImage larger than 8MB you need to add a smal detail to tbs2910.h in the u-boot source.

+#define CONFIG_SYS_BOOTM_LEN (16 << 20)

Don’t forget to compile and install u-boot again. You can check my patch in order to get a update_uboot command in order to get somethings done automatically.

Now place all your files in the TFTP server.

Loading Kernel in RAM


Matrix U-Boot>
Matrix U-Boot> tftpboot uImage 0x10800000
Using FEC device
TFTP from server 192.168.1.247; our IP address is 192.168.1.137
Filename 'uImage'.
Load address: 0x10800000
Loading: #################################################################
#################################################################
#################################################################
##############################T ###################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
###################################################
456.1 KiB/s
done
Bytes transferred = 10285840 (9cf310 hex)
Matrix U-Boot> tftpboot 0x11800000 imx6q-tbs2910.dtb
Using FEC device
TFTP from server 192.168.1.247; our IP address is 192.168.1.137
Filename 'imx6q-tbs2910.dtb'.
Load address: 0x11800000
Loading: ###
213.9 KiB/s
done
Bytes transferred = 31584 (7b60 hex)
Matrix U-Boot> bootm 0x10800000 – 0x11800000
## Booting kernel from Legacy Image at 10800000 …
Image Name: Linux-3.19.0
Created: 2015-02-23 22:04:20 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 10285776 Bytes = 9.8 MiB
Load Address: 10800000
Entry Point: 10800000
Verifying Checksum … OK
## Flattened Device Tree blob at 11800000
Booting using the fdt blob at 0x11800000
Loading Kernel Image … OK
Loading Device Tree to 7bff5000, end 7bfffb5f … OK
Starting kernel …
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.19.0 () (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #3 SMP Mon Feb 23 22:01:57 WET 2015
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: TBS2910 Matrix ARM mini PC
[ 0.000000] cma: Reserved 16 MiB at 0x8f000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 9 pages/cpu @ee79e000 s8064 r8192 d20608 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 520720
[ 0.000000] Kernel command line: noinitrd console=ttymxc0,115200
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 262144 (order: 8, 1048576 bytes)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Memory: 2039324K/2097152K available (6923K kernel code, 415K rwdata, 2420K rodata, 4964K init, 8344K bss, 41444K reserved, 16384K cma-reserved, 253952K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 – 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 – 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xf0000000 – 0xff000000 ( 240 MB)
[ 0.000000] lowmem : 0x80000000 – 0xef800000 (1784 MB)
[ 0.000000] pkmap : 0x7fe00000 – 0x80000000 ( 2 MB)
[ 0.000000] modules : 0x7f000000 – 0x7fe00000 ( 14 MB)
[ 0.000000] .text : 0x80008000 – 0x8092801c (9345 kB)
[ 0.000000] .init : 0x80929000 – 0x80e02000 (4964 kB)
[ 0.000000] .data : 0x80e02000 – 0x80e69fc0 ( 416 kB)
[ 0.000000] .bss : 0x80e69fc0 – 0x8169029c (8345 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] L2C-310 erratum 769419 enabled
[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9
[ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines
[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[ 0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB
[ 0.000000] L2C-310: CACHE_ID 0x410000c7, AUX_CTRL 0x76070001
[ 0.000000] Switching to timer-based delay loop, resolution 333ns
[ 0.000007] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655765682ns
[ 0.000991] Console: colour dummy device 80×30
[ 0.001021] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.001030] … MAX_LOCKDEP_SUBCLASSES: 8
[ 0.001039] … MAX_LOCK_DEPTH: 48
[ 0.001047] … MAX_LOCKDEP_KEYS: 8191
[ 0.001055] … CLASSHASH_SIZE: 4096
[ 0.001063] … MAX_LOCKDEP_ENTRIES: 32768
[ 0.001070] … MAX_LOCKDEP_CHAINS: 65536
[ 0.001078] … CHAINHASH_SIZE: 32768
[ 0.001086] memory used by lock dependency info: 5167 kB
[ 0.001094] per task-struct memory footprint: 1152 bytes
[ 0.001127] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
[ 0.001146] pid_max: default: 32768 minimum: 301
[ 0.001477] Mount-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.001496] Mountpoint-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.003617] CPU: Testing write buffer coherency: ok
[ 0.004404] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004513] Setting up static identity map for 0x106c8f00 – 0x106c8f70
[ 0.008623] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.010349] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.011729] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.011908] Brought up 4 CPUs
[ 0.011935] SMP: Total of 4 processors activated (24.00 BogoMIPS).
[ 0.011945] CPU: All CPU(s) started in SVC mode.
[ 0.013447] devtmpfs: initialized
[ 0.014769] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 0.016963] pinctrl core: initialized pinctrl subsystem
[ 0.041946] NET: Registered protocol family 16
[ 0.044912] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.046876] CPU identified as i.MX6Q, silicon rev 1.2
[ 0.090476] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.090493] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.092823] imx6q-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.146861] mxs-dma 110000.dma-apbh: initialized
[ 0.151747] vgaarb: loaded
[ 0.152688] SCSI subsystem initialized
[ 0.153786] usbcore: registered new interface driver usbfs
[ 0.153937] usbcore: registered new interface driver hub
[ 0.154140] usbcore: registered new device driver usb
[ 0.157854] i2c i2c-0: IMX I2C adapter registered
[ 0.157878] of_dma_request_slave_channel: dma-names property of node '/soc/aips-bus@02100000/i2c@021a0000' missing or empty
[ 0.157899] i2c i2c-0: can't use DMA
[ 0.158594] i2c i2c-1: IMX I2C adapter registered
[ 0.158616] of_dma_request_slave_channel: dma-names property of node '/soc/aips-bus@02100000/i2c@021a4000' missing or empty
[ 0.158633] i2c i2c-1: can't use DMA
[ 0.159989] i2c i2c-2: IMX I2C adapter registered
[ 0.160011] of_dma_request_slave_channel: dma-names property of node '/soc/aips-bus@02100000/i2c@021a8000' missing or empty
[ 0.160029] i2c i2c-2: can't use DMA
[ 0.160224] Linux video capture interface: v2.00
[ 0.160458] pps_core: LinuxPPS API ver. 1 registered
[ 0.160472] pps_core: Software ver. 5.3.6 – Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.160526] PTP clock support registered
[ 0.161310] Advanced Linux Sound Architecture Driver Initialized.
[ 0.165051] cfg80211: Calling CRDA to update world regulatory domain
[ 0.166246] Switched to clocksource mxc_timer1
[ 0.193544] NET: Registered protocol family 2
[ 0.195155] TCP established hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.195533] TCP bind hash table entries: 16384 (order: 7, 589824 bytes)
[ 0.201137] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.201322] TCP: reno registered
[ 0.201368] UDP hash table entries: 1024 (order: 4, 81920 bytes)
[ 0.202108] UDP-Lite hash table entries: 1024 (order: 4, 81920 bytes)
[ 0.203646] NET: Registered protocol family 1
[ 0.204626] RPC: Registered named UNIX socket transport module.
[ 0.204642] RPC: Registered udp transport module.
[ 0.204652] RPC: Registered tcp transport module.
[ 0.204663] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.609708] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[ 0.613159] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.630725] VFS: Disk quotas dquot_6.5.2
[ 0.631172] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.637922] NFS: Registering the id_resolver key type
[ 0.638109] Key type id_resolver registered
[ 0.638124] Key type id_legacy registered
[ 0.638303] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.640120] fuse init (API version 7.23)
[ 0.643414] bounce: pool size: 64 pages
[ 0.643488] io scheduler noop registered
[ 0.643512] io scheduler deadline registered
[ 0.643609] io scheduler cfq registered (default)
[ 0.644323] imx-weim 21b8000.weim: Driver registered.
[ 0.964053] imx6q-pcie 1ffc000.pcie: phy link never came up
[ 0.964633] imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
[ 0.964655] pci_bus 0000:00: root bus resource [io 0x1000-0xffff]
[ 0.964673] pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
[ 0.964693] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.965884] PCI: bus0: Fast back to back transfers disabled
[ 0.966306] PCI: bus1: Fast back to back transfers enabled
[ 0.966480] pci 0000:00:00.0: BAR 0: assigned [mem 0x01000000-0x010fffff]
[ 0.966509] pci 0000:00:00.0: BAR 6: assigned [mem 0x01100000-0x0110ffff pref]
[ 0.966530] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 0.967207] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[ 0.971196] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[ 0.971223] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware
[ 0.978580] imx-sdma 20ec000.sdma: initialized
[ 0.980309] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 23, base_baud = 5000000) is a IMX
[ 1.757333] console [ttymxc0] enabled
[ 1.763152] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 296, base_baud = 5000000) is a IMX
[ 1.773653] [drm] Initialized drm 1.1.0 20060810
[ 1.784311] imx-ipuv3 2400000.ipu: IPUv3H probed
[ 1.793122] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.799805] [drm] No driver support for vblank timestamp query.
[ 1.806256] imx-drm display-subsystem: bound imx-ipuv3-crtc.0 (ops ipu_crtc_ops)
[ 1.813853] imx-drm display-subsystem: bound imx-ipuv3-crtc.1 (ops ipu_crtc_ops)
[ 1.821505] imx-drm display-subsystem: bound imx-ipuv3-crtc.4 (ops ipu_crtc_ops)
[ 1.829128] imx-drm display-subsystem: bound imx-ipuv3-crtc.5 (ops ipu_crtc_ops)
[ 1.837416] imx-hdmi 120000.hdmi: Detected HDMI controller 0x13:0xa:0xa0:0xc1
[ 1.844941] imx-drm display-subsystem: bound 120000.hdmi (ops hdmi_ops)
[ 1.852148] imx-drm display-subsystem: No connectors reported connected with modes
[ 1.859770] [drm] Cannot find any crtc or sizes – going 1024×768
[ 1.881344] Console: switching to colour frame buffer device 128×48
[ 1.893618] imx-drm display-subsystem: fb0: frame buffer device
[ 1.899664] imx-drm display-subsystem: registered panic notifier
[ 1.926340] [drm] Initialized imx-drm 1.0.0 20120507 on minor 0
[ 1.932949] imx-ipuv3 2800000.ipu: IPUv3H probed
[ 1.955533] brd: module loaded
[ 1.968821] loop: module loaded
[ 1.973684] ahci-imx 2200000.sata: fsl,transmit-level-mV not specified, using 00000024
[ 1.981656] ahci-imx 2200000.sata: fsl,transmit-boost-mdB not specified, using 00000480
[ 1.989699] ahci-imx 2200000.sata: fsl,transmit-atten-16ths not specified, using 00002000
[ 1.997913] ahci-imx 2200000.sata: fsl,receive-eq-mdB not specified, using 05000000
[ 2.008673] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled
[ 2.015682] ahci-imx 2200000.sata: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[ 2.024515] ahci-imx 2200000.sata: flags: ncq sntf stag pm led clo only pmp pio slum part ccc apst
[ 2.036815] scsi host0: ahci_platform
[ 2.041612] ata1: SATA max UDMA/133 mmio [mem 0x02200000-0x02203fff] port 0x100 irq 299
[ 2.054841] CAN device driver interface
[ 2.060518] 2188000.ethernet supply phy not found, using dummy regulator
[ 2.087573] pps pps0: new PPS source ptp0
[ 2.109328] libphy: fec_enet_mii_bus: probed
[ 2.115308] fec 2188000.ethernet eth0: registered PHC device 0
[ 2.122488] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 2.129061] ehci-pci: EHCI PCI platform driver
[ 2.133664] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 2.139383] usbcore: registered new interface driver usb-storage
[ 2.159591] ci_hdrc ci_hdrc.1: doesn't support gadget
[ 2.164678] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 2.169783] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 2.196297] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 2.205154] hub 1-0:1.0: USB hub found
[ 2.209187] hub 1-0:1.0: 1 port detected
[ 2.216557] mousedev: PS/2 mouse device common for all mice
[ 2.228433] rtc-ds1307 2-0068: rtc core: registered ds1307 as rtc0
[ 2.234657] rtc-ds1307 2-0068: 56 bytes nvram
[ 2.241159] snvs_rtc 20cc034.snvs-rtc-lp: rtc core: registered 20cc034.snvs-rtc-lp as rtc1
[ 2.249716] i2c /dev entries driver
[ 2.255992] IR NEC protocol handler initialized
[ 2.260578] IR RC5(x/sz) protocol handler initialized
[ 2.265653] IR RC6 protocol handler initialized
[ 2.270226] IR JVC protocol handler initialized
[ 2.274777] IR Sony protocol handler initialized
[ 2.279432] IR SANYO protocol handler initialized
[ 2.284157] IR Sharp protocol handler initialized
[ 2.288896] IR MCE Keyboard/mouse protocol handler initialized
[ 2.294748] IR XMP protocol handler initialized
[ 2.299807] Registered IR keymap rc-empty
[ 2.304961] input: gpio_ir_recv as /devices/soc0/ir_recv/rc/rc0/input0
[ 2.312360] rc0: gpio_ir_recv as /devices/soc0/ir_recv/rc/rc0
[ 2.319238] input: MCE IR Keyboard/Mouse (gpio-rc-recv) as /devices/virtual/input/input1
[ 2.331308] coda 2040000.vpu: Direct firmware load for v4l-coda960-imx6q.bin failed with error -2
[ 2.340244] coda 2040000.vpu: firmware request failed
[ 2.342745] gpio-fan fan: GPIO fan initialized
[ 2.350568] platform 2000000.aips-bus:tempmon: Driver imx_thermal requests probe deferral
[ 2.360904] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 2.367476] Driver 'mmcblk' needs updating – please use bus_type methods
[ 2.374280] sdhci: Secure Digital Host Controller Interface driver
[ 2.380514] sdhci: Copyright(c) Pierre Ossman
[ 2.384939] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.391843] sdhci-esdhc-imx 2194000.usdhc: could not get ultra high speed state, work on normal mode
[ 2.396287] ata1: SATA link down (SStatus 0 SControl 300)
[ 2.396341] ahci-imx 2200000.sata: no device found, disabling link.
[ 2.396348] ahci-imx 2200000.sata: pass ahci_imx..hotplug=1 to enable hotplug
[ 2.421282] sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
[ 2.466757] mmc0: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
[ 2.474920] sdhci-esdhc-imx 2198000.usdhc: could not get ultra high speed state, work on normal mode
[ 2.485462] sdhci-esdhc-imx 2198000.usdhc: No vqmmc regulator found
[ 2.526365] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 2.536534] mmc1: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
[ 2.544706] sdhci-esdhc-imx 219c000.usdhc: No vmmc regulator found
[ 2.550942] sdhci-esdhc-imx 219c000.usdhc: No vqmmc regulator found
[ 2.596268] mmc2: SDHCI controller on 219c000.usdhc [219c000.usdhc] using ADMA
[ 2.605294] usbcore: registered new interface driver usbhid
[ 2.610914] usbhid: USB HID core driver
[ 2.623482] sgtl5000 0-000a: sgtl5000 revision 0x11
[ 2.679423] hub 1-1:1.0: USB hub found
[ 2.683400] mmc2: BKOPS_EN bit is not set
[ 2.687532] hub 1-1:1.0: 4 ports detected
[ 2.687895] sgtl5000 0-000a: Using internal LDO instead of VDDD
[ 2.705631] mmc2: new DDR MMC card at address 0001
[ 2.714973] imx-sgtl5000 sound-sgtl5000: sgtl5000 <-> 2028000.ssi mapping ok
[ 2.722244] mmcblk0: mmc2:0001 016G92 14.6 GiB
[ 2.727254] mmcblk0boot0: mmc2:0001 016G92 partition 1 4.00 MiB
[ 2.733589] mmcblk0boot1: mmc2:0001 016G92 partition 2 4.00 MiB
[ 2.741459] mmcblk0rpmb: mmc2:0001 016G92 partition 3 512 KiB
[ 2.753032] imx-spdif sound-spdif: snd-soc-dummy-dai <-> 2004000.spdif mapping ok
[ 2.765791] mmcblk0: p1
[ 2.771935] TCP: cubic registered
[ 2.776766] NET: Registered protocol family 10
[ 2.784637] sit: IPv6 over IPv4 tunneling driver
[ 2.791210] NET: Registered protocol family 17
[ 2.795712] can: controller area network core (rev 20120528 abi 9)
[ 2.802117] NET: Registered protocol family 29
[ 2.806738] can: raw protocol (rev 20120528)
[ 2.811160] can: broadcast manager protocol (rev 20120528 t)
[ 2.816914] can: netlink gateway (rev 20130117) max_hops=1
[ 2.823137] Key type dns_resolver registered
[ 2.833138] Registering SWP/SWPB emulation handler
[ 2.847458] rtc-ds1307 2-0068: setting system clock to 2015-02-24 00:14:12 UTC (1424736852)
[ 2.894408] ALSA device list:
[ 2.897428] #0: On-board Codec
[ 2.900666] #1: On-board SPDIF
[ 2.909646] Freeing unused kernel memory: 4964K (80929000 – 80e02000)
[ 3.007161] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
Starting logging: OK
Initializing random number generator… [ 3.078720] random: dd urandom read with 7 bits of entropy available
done.
Starting network…
Welcome to Buildroot
buildroot login:

How to change Matrix TBS2910 U-Boot

This tutorial exposes all the underlying work needed to flash a new u-boot into a Matrix TBS2910. You can use this knowledge and compile your own u-boot.imx with all these included, just in case.

TBS_Matrix_Board

Requisites:

  • Matrix TBS2910
  • Mini USB cable for the OTG
  • TTL-232R-3V3 for the UART
  • Recent Linux Debian based environment (e.g Ubuntu 14.04)
  • Git/Compilation skills
  • Ethernet Cable
  • TFTP Server (e.g. tftp-hpa)

In this case you won’t need a DHCP server because you can choose to program your own IP addr.

Install iMX USB loader

git clone https://github.com/boundarydevices/imx_usb_loader.git
cd imx_usb_loader
make
sudo make install

Compile U-boot

git clone git://git.denx.de/u-boot-imx.git
cd u-boot-imx
make distclean
make tbs2910_config

Before compiling, you need a cross compiling GCC version. Look for the ones available to you.

apt-cache search arm-linux-gnuabi-gcc

Makefile will be looking for the arm-linux-gnueabi-gcc compiler.

export CROSS_COMPILE=arm-linux-gnueabi-
export ARCH=arm
make

If everything goes well you should have a u-boot.imx file now available. All you need now is to load that file into the Matrix.

  • Turn off the device
  • move switch to Update/Burn mode
  • plug USB and UART cables
  • turn on the device

Now run the following command:

sudo imx_usb --configdir=/usr/etc/imx-loader.d/ ../u-boot-imx/u-boot.imx

Output should look like this:


config file </usr/etc/imx-loader.d/imx_usb.conf>
vid=0x066f pid=0x3780 file_name=mx23_usb_work.conf
vid=0x15a2 pid=0x004f file_name=mx28_usb_work.conf
vid=0x15a2 pid=0x0052 file_name=mx50_usb_work.conf
vid=0x15a2 pid=0x0054 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0061 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0063 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0041 file_name=mx51_usb_work.conf
vid=0x15a2 pid=0x004e file_name=mx53_usb_work.conf
vid=0x15a2 pid=0x006a file_name=vybrid_usb_work.conf
vid=0x066f pid=0x37ff file_name=linux_gadget.conf
config file </usr/etc/imx-loader.d/mx6_usb_work.conf>
parse /usr/etc/imx-loader.d/mx6_usb_work.conf
15a2:0054(mx6_qsb) bConfigurationValue =1
Interface 0 claimed
HAB security state: development mode (0x56787856)
== work item
filename ../u-boot-imx/u-boot.imx
load_size 0 bytes
load_addr 0x00000000
dcd 1
clear_dcd 0
plug 1
jump_mode 2
jump_addr 0x00000000
== end work item
main dcd length 310
sub dcd length 30c
loading binary file(../u-boot-imx/u-boot.imx) to 7ffff400, skip=0, fsize=48c00 type=aa
<<<297984, 297984 bytes>>>
succeeded (status 0x88888888)
jumping to 0x7ffff400

view raw

imx-usb

hosted with ❤ by GitHub

Matrix will start boot and you will be able to see through the Serial connection.


U-Boot 2015.04-rc1-19966-ge72d344 (Feb 16 2015 – 23:27:14)
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
I2C: ready
DRAM: 2 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
*** Warning – bad CRC, using default environment
No panel detected: default to HDMI
Display: HDMI (1024×768)
In: serial
Out: vga
Err: vga
Board: TBS2910 Matrix ARM mini PC
Net: FEC [PRIME]
Hit any key to stop autoboot: 0
Matrix U-Boot>

view raw

Matrix U-Boot

hosted with ❤ by GitHub

Where you go from here is up to you. You can type help just to check all the commands. But this is a tutorial on how to change u-boot so just type the following commands.

setenv serverip "your tftp server"
setenv ipaddr "any unused ip server in your tftp server subnet"
setenv loadaddr 0x10800000

tftp u-boot.imx
mmc dev 2 1
setexpr fw_sz ${filesize} / 0x200
setexpr fw_sz ${fw_sz} + 1
mmc erase 0x0 0x2000
mmc write ${loadaddr} 0x2 ${fw_sz}

This is merely a learning exercise I did, as I’ve never done this before. You can easily integrate these kind of things into the tbs2910.h itself, in the u-boot source code under include/configs.

This is were I took most of my info. Kudos for l3iggs for his work. U-Boot source

How to use DiSEqC with DVBlast the right way

If you are here you probably know what DiSEqC. If you don’t lets take an overview.

What is DiSEqC? The word stands for Digital Satellite Equipment Control and with it you are able to select which satellite to lock when selecting a frequency. Using DVBlast and boards like TBS, you are able to expand your control through at least 8 satellites using the right equipment.

I normally use the EMP – Centauri brand, which are cheap and have a lot of options. Always go for the Professional line, they have support for both QUAD and QUATTRO LNBS. The options can go from DiSEqC 1.0 (4 satellites) and (DiSEqC 1.1) for 16 satellites, although I don’t know any brand that makes Multiswitches >8.

For example, this product enables 8 tuners, DTV, and 3 LNBs.

EMP Centauri 13/8

Now all you need to look for in DVBlast is the following:

~$ dvblast -h
 -S --diseqc satellite number for diseqc (0: no diseqc, 1-4, A or B) 
-k --uncommitted port number for uncommitted diseqc (0: no uncommitted diseqc, 1-4) 

By using these options you can work out which satellite you want to use.

Examples:

dvblast ... -S 1 -k 1 (select 1st LNB/SAT)
dvblast ... -S 2 -k 2 (select 6th LNB/SAT)
dvblast ... -S 4 -k 2 (select 8th LNB/SAT)
...
dvblast .... -S 4 -k 4 (select 16th LNB/SAT)

You will see logs like this:

 debug: configuring LNB to v=13 p=0 satnum=4 uncommitted=2

Hope it helps.

How to create a AllShare DLNA Server for a Samsung Smart TV

If you really want to stream all those torrents you download from the Internet and watch them on your TV set then you’re in the right place.

For this you will need at least a linux machine. A Raspberry PI using using a 4GB SD should be more than enough to have a few episodes. If not you can use any debian/redhat based linux system. Including the one and only Ubuntu.

So let’s start. First of all check that your distro has minidlna. A Raspberry will output the following.

pi@raspberrypi ~ $ apt-get update
pi@raspberrypi ~ $ apt-cache search minidlna
minidlna - lightweight DLNA/UPnP-AV server targeted at embedded systems

Well if you are lucky to have the following output on your OS then you are in for a treat. Just install it then

pi@raspberrypi ~ $ sudo apt-get -y install minidlna

Now you need to check an important detail regarding the placement of your videos. Edit /etc/minidlna.conf (vim /etc/minidlna.conf) and edit the following line to point to the place you want your files in.

media_dir=V,/var/lib/transmission-daemon/downloads

And that’s all you need for now. After editing the config file make sure you restart the minidlna server.

pi@raspberrypi ~ $ sudo service minidlna force-reload
[ ok ] Restarting DLNA/UPnP-AV media server: minidlna.
Samsung AllShare

Samsung AllShare

How to add a command to the Makefile

This tutorial is a quick way to understand how to add a script or something else to the Makefile installation process. This is solely for those who are building rpm/deb packages and want to add extra stuff in the installation package.

So inside your Makefile directory add the file you would like to see in the final installation:

For example:

[root@softether vpnserver_package]# ls script*
script_i_want_to_add.sh

Now edit Makefile to properly add the script to the final package.

[root@softether vpnserver_package]# vim Makefile

Look for the install and uninstall part and add the lines you need.


install:
cp vpncmd/vpncmd /usr/bin/
cp vpncmd/ham* /usr/bin/
cp -r vpnserver /usr/local/
chmod 755 vpnserver
cp vpnserver.init /etc/init.d/vpnserver
cp vpn_server.config /usr/local/vpnserver/
chmod 755 /etc/init.d/vpnserver
/sbin/chkconfig –add vpnserver
### adding install line here
cp script_i_want_to_add.sh /usr/bin
uninstall:
rm -rf /usr/local/vpnserver
#rm -f /etc/init.d/vpnserver
/sbin/chkconfig –del vpnserver
rm /usr/bin/hamco*
rm /usr/bin/vpncmd
### adding uninstall line here
rm /usr/bin/changevhub

view raw

Makefile

hosted with ❤ by GitHub

And that’s it. This script will then be accessible in the final stage of the installation, under /usr/bin/ folder which is the PATH folder.

How to compile Softether and create RPM package

This tutorial will explain how to compile and create a softether RPM package. This rpm package will have a small step to include a preset configuration.

First go to Softether and copy the source link.

First install all the dependencies you will need

yum -y install readline-devel ncurses-devel openssl-devel gcc vim wget

Then download the package, extract it, configure the system and compile it.

[root@softether ~]# cd /usr/src
[root@softether src]# wget http://www.softether-download.com/files/softether/v4.05-9423-beta-2014.02.18-tree/Source%20Code/softether-src-v4.05-9423-beta.tar.gz

[root@softether src]# tar -zxvf softether-src-v4.05-9423-beta.tar.gz
[root@softether src]# cd v4*
[root@softether v4.05-9423]# ./configure


Select your operating system below:
1: Linux
2: FreeBSD
3: Solaris
4: Mac OS X
5: OpenBSD

Which is your operating system (1 – 5) ? : 1

Select your CPU bits below:
1: 32-bit
2: 64-bit

Which is the type of your CPU (1 – 2) ? : 2

[root@softether v4.05-9423]# make

And that’s it. Now all we need to do is to add two files. One for the configuration and the other for the auto start.

Softether Package preparation

[root@softether v4.05-9423]# cd /usr/src
[root@softether src]# mkdir vpnserver_package
[root@softether src]# cd vpnserver_package
[root@softether vpnserver_package]# cp -r ../v4.05-9423/bin/vpnserver .
[root@softether vpnserver_package]# cp -r ../v4.05-9423/bin/vpncmd .

AutoStart
[root@softether vpnserver_package]# vim vpnserver.init

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case &amp;quot;$1&amp;quot; in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo &amp;quot;Usage: $0 {start|stop|restart}&amp;quot;
exit 1
esac
exit 0

Get the vpnserver configuration and put it in the same folder.

[root@softether vpnserver_package]# ls *vpn
vpn_server.config

Create Makefile

[root@softether vpnserver_package]# wget https://dl.dropboxusercontent.com/u/1227943/ali/Makefile

Now all you need to do is follow this instructions and run checkinstall inside the softether compiled source directory.

Connect a Git/Bitbucket project with a Koding workspace

First create a ssh-key rsa public key.


nrmmota@vm-0:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nrmmota/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/nrmmota/.ssh/id_rsa.
Your public key has been saved in /home/nrmmota/.ssh/id_rsa.pub.
The key fingerprint is:
xx:xx:xxx..... nrmmota@vm-0.nrmmota.koding.kd.io
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| . |
| . o . |
| . S .= |
| . . = = |
| E . = oo . |
| . . =..o.+. |
| oo....+= |
+-----------------+

Now cat the public id and copy all of it.

nrmmota@vm-0:~$ cat .ssh/id_rsa.pub
ssh-rsa XXXXXXXXXXXXXXXXXXXXXXXXXX… nrmmota@vm-0.nrmmota.koding.kd.io

In Bitbucket go to “Manage account” -> SSH Keys. Create a new one and paste the key you just copied.

Warning: All its left is to create new Bitbucket project from scratch. Now the manual Git commands come into action. I haven’t found any versioning stuff besides clone project. This only refers to Bitbucket new projects.

nrmmota@vm-0:~$ ls
Applications Backup Documents Web
nrmmota@vm-0:~$ cd Documents/
nrmmota@vm-0:~/Documents$ ls
nrmmota@vm-0:~/Documents$ mkdir OTT
nrmmota@vm-0:~/Documents$ cd OTT/
nrmmota@vm-0:~/Documents/OTT$ git init
Initialized empty Git repository in /home/nrmmota/Documents/OTT/.git/
nrmmota@vm-0:~/Documents/OTT$ git remote add origin git@bitbucket.org:mundumelga/ott.git
nrmmota@vm-0:~/Documents/OTT$ ls
nrmmota@vm-0:~/Documents/OTT$ echo "OTT Project" >> README.md
nrmmota@vm-0:~/Documents/OTT$ git add README.md
nrmmota@vm-0:~/Documents/OTT$ git commit -m "First commit. Adding a README."
[master (root-commit) 995f512] First commit. Adding a README.
Committer: nrmmota
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 file changed, 1 insertion(+)
create mode 100644 README.md

nrmmota@vm-0:~/Documents/OTT$ git push -u origin master
The authenticity of host 'bitbucket.org (XXX)' can't be established.
RSA key fingerprint is XXXXXXXX
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bitbucket.org,XXX' (RSA) to the list of known hosts.

Counting objects: 3, done.
Writing objects: 100% (3/3), 242 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@bitbucket.org:mundumelga/ott.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.