Showing posts with label #link. Show all posts
Showing posts with label #link. Show all posts

2014-07-13

raw image format, ffmpeg, and raspivid

The SwView.org node 165: RGB565 To PNG/JPEG showed up at the top of the results listing for a search on RGB565, an image data format produced by a camera. We are most interested in capturing an manipulating said data, so we want to know what format it's in, and this RGB565 is used to refer to the format throughout the files which we currently access.


if image.raw contains data for multiple frames (e.g. of a video), you can use "%d" and ffmpeg will automatically name the additional files generated: 
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 1024x768 -i movie.raw -f image2 -vcodec png image%d.png

Instead of a file, If you have an rgb565 stream, you may attempt to direct the data to stdin of ffmpeg and accomplish the same. In such a case, instead of "-i image.raw", you can use "-i -":
firstCommand | ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 1024x768 -i - -f image2 -vcodec png image%d.png

Note that raspivid can produce raw video and place it on stdout.

2014-07-06

Raspberry Metalflake

 rpiplayground: Hacking the GPU for Fun and Profit (Part 1 of 4)
Fun for those rainy days... Says the author: 
"This series of posts will walk through the GPU architecture by designing and optimizing a non-trivial algorithm (parallel SHA-256) to run on the GPU.  Because this is a relatively advanced topic, some background knowledge must be assumed. [ … ] You should have some understanding of GPGPU concepts (Google can help) and you should read the Broadcom BCM2835 GPU Documentation. I’ll describe most Raspberry Pi GPU specific concepts but in case I miss some, the documentation is your friend."
[ed note: we will try to cover some of those assumed bits of background knowledge here as we find out what they are. kthx]
SHA-256 implementation on QPUs
Raspberry Pi Forum thread where the rpiplayground (see link above) blog showed up.
OpenVG™ – The Standard for Vector Graphics Acceleration
From the page:
"… royalty-free, cross-platform API that provides a low-level hardware acceleration interface for vector graphics libraries such as Flash and SVG. OpenVG is targeted primarily at handheld devices that require portable acceleration of high-quality vector graphics for compelling user interfaces and text on small screen devices - while enabling hardware acceleration to provide fluidly interactive performance at very low power levels."
hermanhermitage/videocoreiv
Tools and information for the Broadcom VideoCore IV (RaspberryPi)

Simon's accelerated X development thread
This thread at the Raspberry Pi Forum leads to quite a few interesting links – starting with the low level virtual machine code repository:  simonjhall/llvm_qpu – Low Level Virtual Machine
GitHub repository for the LLVM sources – this is a frequently updated mirror of the official site … note that this is not anything to do with the java virtual machines –
"This directory and its subdirectories contain source code for the Low Level Virtual Machine, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments."
other simonjhall repositories on github: 
My Robot Blog:  GPU Accelerated Camera Processing On The Raspberry Pi
am very actively trying to follow this work currently

2014-07-01

freecode.com goes static

freecode.com is moving to a static site due to lack of use. Following are some links to content from the site which may be of interest or use: 
dumpmpeg project
— "a simple program that allows you to dump frames from mpeg movies. Future features may include dumping of the audio as well. dumpmpeg uses Loki's SMPEG library for decoding."
PHP OAuth API
"PHP OAuth API authorizes user access using the OAuth protocol. It abstracts OAuth 1.0, 1.0a, and 2.0 in the same class. It provides built-in support for popular OAuth servers: 37Signals, Amazon, Buffer, Bitbucket, Box.net, Dailymotion, Discogs, Disqus, Dropbox with OAuth 1.0 and 2.0, Etsy, Eventful, Facebook, Fitbit, Flickr, Foursquare, github, Google with OAuth 1.0a and OAuth 2.0, Instagram, LinkedIn, Microsoft, Rdio, Reddit, RightSignature, Salesforce, Scoop.it, StockTwits, SurveyMonkey, Tumblr, Twitter, VK, Withings, Xero, XING, and Yahoo!. Every other OAuth server is supported by setting an endpoint URLs and other parameters using specific class variables or an external JSON configuration file. The class can also send requests to an API using the previously-obtained OAuth access token. For servers which support offline access, the class can renew expired tokens automatically using refresh tokens."
Possum
"Possum is a point of sales (POS) system for restaurants, bars, and brasseries. It is intended for use with a ticket printer and a touch screen. It can be used to provide billing and presents different statistics such as sales, VAT amount, total payments by payment type, settings, average ticket per table, etc. These statistics are calculated per day and per month. It can also manage music playlists."
OpenSimulator
"OpenSimulator is a multi-platform, multi-user 3D distributed virtual environment platform. Out of the box, it can be used to simulate virtual environments similar to that of Second Life. These can be used as social virtual worlds or for specific applications such as education, training, and visualization. Access is via the regular Second Life open-source viewer or via third-party clients. There are a number of private and public deployments of OpenSimulator, including OSgrid, which has over 8000 regions hosted by independent individuals and organizations spread over the Internet."
Horde Application Framework
"The Horde Application Framework is a modular, general-purpose Web application framework. It provides an extensive array of classes that are targeted at the common problems and tasks involved in developing modern Web applications."
See also the profile for user chuck for more plugin-type, horde-friendly apps.

2014-06-30

Aircraft-grade Aluminum Case for Raspberry Pi

Aircraft-grade Aluminum Raspberry Pi Assembly Guide from the ModMyPi blog

WiFi for Raspberry Pi

How to install wifi on Raspberry Pi is a handy, simple description of bringing up WiFi on a Raspberry Pi.

Following this guide, everything worked on the first try.

Note that prior efforts to bring the WiFi interface up from the command line were unsuccessful; the iw, ip, iwconfig, and ifup commands did not bring the wlan0 interface up.

The connection to the Pi in this instance was an SSH connection; the Pi running headless with X11 forwarded across and SSH tunnel via VNC, so the eth0 connection was active until disabled from wicd after wlan0 was successfully provisioned.

Note that the WiFi configuration for the dongle – wlan0 – does not appear to have been saved on reboot; Pi still comes up with Ethernet eth0 active, and the wlan0 module loaded and showing in the iwconfig ougtput, but the interface is not up, does not have an IP address, and no routing nor gateway configured for it.

2014-06-29

Dropbox Source Code

How do I build the Dropbox installer for Linux from source? short and sweet - we should have this for the Raspberry Pi RSN - it may already be out here...

update:  This code did not build successfully on the Raspberry Pi, first try. The problem was during ./configure – libnautilus-extension-dev could not be satisfied because processing of the depends-on fails, reporting a missing newline on an apt config file for the ssh package - no idea WtF reegardz that ther, meh.

2014-06-23

Network Interface Bonding

Linux.com :: What can you do with a second Ethernet port?: "To bond two Ethernet interfaces, you must have the bonding module compiled for your kernel (which on a modern distro is almost a certainty), and the ifenslave package (which is a standard utility, although you might need to install it from from your distro's RPM or APT repository)."
'via Blog this'
On a typical two-port motherboard, the Ethernet adapters are named eth0 and eth1, so we will use that for our example commands.
With ifenslave installed, take both Ethernet adapters offline by running
sudo ifdown eth0
sudo ifdown eth1.
Load the bonding module into the Linux kernel with modprobe. There are two important options to pass to the module: mode and miimon.  Mode establishes the type of bond (round-robin, failover, and so on), and miimon establishes how often (in milliseconds) the links will be checked for failure.
sudo modprobe bonding mode=0 miimon=100
will set up a round-robin configuration in which network packets alternate between the Ethernet adapters as they are sent out.
The miimon value of 100 is a standard place to begin; you can adjust if it you really want to tweak your network.
To create an actual bond (which for convenience we'll call bond0), run
sudo ifconfig bond0 192.168.1.100 up
to assign an IP address to the bond, then run
ifenslave bond0 eth0
followed by
ifenslave bond0 eth1
to tie the physical Ethernet interfaces into it.
Round-robin mode is good for general purpose load balancing between the adapters, and if one of them fails, the link will stay active via the other.
The other six mode options provide features for different setups.
  • Mode 1::  active backup, uses just one adapter until it fails, then switches to the other.
  • Mode 2::  balance XOR, tries to balance traffic by splitting up outgoing packets between the adapters, using the same one for each specific destination when possible.
  • Mode 3::  broadcast, sends out all traffic on every interface.
  • Mode 4::  dynamic link aggregation, uses a complex algorithm to aggregate adapters by speed and other settings.
  • Mode 5::  adaptive transmit load balancing, redistributes outgoing traffic on the fly based on current conditions.
  • Mode 6::  adaptive load balancing, does the same thing, but attempts to redistribute incoming traffic as well by sending out ARP updates.
The latter, complex modes are probably unnecessary for home use. If you have a lot of network traffic you are looking to manage, consult the bonding driver documentation. For most folks, bonding's fault tolerance and failover is a bigger gain than any increased link speed. For example, bonding two WAN links gives you load balancing and fault tolerance between them, but it does not double your upstream throughput, since each connection (such as a Web page HTTP request) has to take one or the other route.

2014-06-18

OpenVG™: Open Vector Graphics Standard

OpenVG™ official site
“ ...a royalty-free, cross-platform API that provides a low-level hardware acceleration interface for vector graphics libraries such as Flash and SVG.”

Broadcom Listed as OpenVG COnformant

… from OpenVG Conformant Products listing at Kronos Group:

Broadcom Corporation 2011-04-03 OpenVG_1_1
CPU: VideoCore IV, OS:Threadx,
Pipeline: Broadcom VideoCore IV HW/OpenVG 1.1,
Display: 64x64 32bpp

dnsmasq

Note that the How-To from Xmodulo (again) fails to mention the "new" initialization "standard" for system initialization (obsoleting SysV Init, etc. There has to be a way to remove the new software (kickstart, quickstart??) and go back to using the SysV process. Whomever did this, imo, ignored one Cardinal Rule: If it ain't broke, don't fix it.

What part of SysV Init were these geniuses trying to fix? What improvements did they make? The only change I see is that I can no longer manipulate the init.d scripts that get run at startup...

2014-06-17

ES/GLES Framebuffer code sighting

On Stackoverflow.com

This link is to an Android programming forum, but contains the first framebuffer ES/GLES example code I have seen (to draw triangles on the screen...

The article contains the statement:

Everything is rendered on screen correctly, but the performance are ruined just when I draw the FBO texture. Thank you very much for your help. I worked very hard on this and didn't find a solution.

... so perhaps the code isn't perfect, but it's a place to start. This does confirm what I suspected about library being the home of the GPU e.g. triangle-drawing routines.

Here is what the code looks like – this is C:

// Create a framebuffer and renderbuffer
GLES20.glGenFramebuffers(1, fb, offset);
GLES20.glGenRenderbuffers(1, depthRb, offset);

// Create a texture to hold the frame buffer
GLES20.glGenTextures(1, renderTex, offset);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTex[offset]);

GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA,
                    screenWidth, screenHeight, 0,
                    GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE,
                    null);


GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,
                       GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,
                       GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,
                       GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
                       GLES20.GL_LINEAR);

//bind renderbuffer
GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER, depthRb[offset]);

GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER, GLES20.GL_DEPTH_COMPONENT16,
                             screenWidth, screenHeight);

// bind the framebuffer
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fb[offset]);

// specify texture as color attachment
GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
                              GLES20.GL_TEXTURE_2D, renderTex[offset], 0);

// specify depth_renderbufer as depth attachment
GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER, GLES20.GL_DEPTH_ATTACHMENT,
                                 GLES20.GL_RENDERBUFFER, depthRb[0]);

// Check FBO status.
int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);

if ( status == GLES20.GL_FRAMEBUFFER_COMPLETE )
{
    Log.d("GLGame framebuffer creation", "Framebuffer complete");
}


// set default framebuffer
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); 

On ZipForums.com

Android OpenGL.ES Texture/Image Drawing has more examples of ES/GLES code for Android.

public void onDrawFrame(GL10 gl) {
    checkGLError(gl);
    if (mContextSupportsFrameBufferObject) {
        GL11ExtensionPack gl11ep = (GL11ExtensionPack) gl;
        if (DEBUG_RENDER_OFFSCREEN_ONSCREEN) {
            drawOffscreenImage(gl, mSurfaceWidth, mSurfaceHeight);
        } else {
            gl11ep.glBindFramebufferOES(GL11ExtensionPack.GL_FRAMEBUFFER_OES, mFramebuffer);
            drawOffscreenImage(gl, mFramebufferWidth, mFramebufferHeight);
            gl11ep.glBindFramebufferOES(GL11ExtensionPack.GL_FRAMEBUFFER_OES, 0);
            drawOnscreen(gl, mSurfaceWidth, mSurfaceHeight);
        }
    } else {
        // Current context doesn't support frame buffer objects.
        // Indicate this by drawing a red background.
        gl.glClearColor(1,0,0,0);
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    }
}

From Google Code

This project is in Java: An OpenGL ES 2.0 example for Android

Build Tools for Raspbian Userland Build Tools

The Raspberry Pi GitHub Repository

The tools needed to build the code found in GitHub:  raspberrypi / userland are found at rasperrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian at master · raspberrypi/tools · GitHub

2014-06-14

userland github #link

https://github.com/raspberrypi/userland

"This repository contains the source code for the ARM side libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib and includes source for the ARM side code to interface to: EGL, mmal, GLESv2, vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG."
rPi Software Block Diagram
Image courtesy of The Raspberry Pi Foundation

Other Links

2014-06-12

VNC for ChromeOS

https://bitbucket.org/saljam/vnc &nash; Overview
This is a VNC viewer Chrome app. It uses Chrome's sockets API to talk to the VNC server directly.
The RFB rendering is based on NoVNC[0]. The icon is based on "Computer" from the Noun Project[1].
[0] http://kanaka.github.com/noVNC/
[1] http://thenounproject.com/noun/computer/#icon-No115
Note the use of markdown style links in the page content shown above.
HACK.md



Make sure:
  1. vncserver is installed on the Debian machine
  2. user account on the remote host is configured to allow ssh public key login
  3. vnc client app is installed on local host
  4. ssh private key (key pair) is installed on local host
  • Using VNC Viewer for Chrome OS to connect to a Debian server running Xvnc4 server.


2014-06-09

SSH-client for ChromeOS


Using Secure Shell version 0.8.27 app for ChromeOS.

The only text in the Secure Shell app that shows what it is, where it came from, or promises any information about how to use the app is printed in the Terminal window when the app is opened:

Welcome to Secure Shell version 0.8.27.
Answers to Frequently Asked Questions: http://goo.gl/TK7876

The goo.gl URL above expands to https://chromium.googlesource.com/apps/libapps/+/master/nassh/doc/faq.txt  which is a pointer into the Secure Shell app source code libraries at the Google Git repository:  
    https://chromium.googlesource.com/apps/libapps/+/master/