Dienstag, 23. September 2014

Joins with Typo3 Extbase


Joins mit Extbase Vers 1.0

        // Erstmal: Selector erweitern:
        // Selector 1 ist das aktuelle Model:
        $selector1 = $query->getSource();
        $selector1_JoinField = "company.postcode";
        // QomFactory holen
        //$qomFactory = $this->persistenceManager->getBackend()->getQOMFactory();
        $backend = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend');
        $qomFactory = $backend->getQomFactory();
        // Selector 2 zusammenstellen:
        $model = null;
        $tableName = "postcode_test";
        $selector2_JoinField = "uid";
        $selector2 = $qomFactory->selector($model, $tableName);
        var_dump($selector2);
        // Selectoren Joinen:
        $joinCondition = $qomFactory->equiJoinCondition(
            $selector1->getSelectorName(), $selector1_JoinField,
            $selector2->getSelectorName(), $selector2_JoinField
        );

        $query->setSource(
            $qomFactory->join(
                $selector2,
                $selector1,
                // For the List of Joins,visit : http://typo3.org/api/typo3cms/_query_interface_8php_source.html
                \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_LEFT_OUTER,
                $joinCondition)
        );

Mittwoch, 9. April 2014

Olinuxino A20 - Enabling Battery Control.

Use this Tutorial to recompile Kernel with APM support
http://linux-sunxi.org/Advanced_Power_Management
Then:
apt-get install apmd
apm

Sonntag, 6. April 2014

Olinuxino A20 - Use both Cores.

For using both cores separately,you have to assign tasks to each core.
taskset -c 0 <cmd> // Core1
taskset -c 1 <cmd> // Core2

Samstag, 5. April 2014

Ralink Driver on Debian 7

I have bought a cheap Wlan Stick(3 Euro on Ebay). For using it,i had to remove "the old" driver,which was spamming my dmesg.



Entfernen von RF Driver:

rmmod rt5370sta
echo 'blacklist rt5370sta' | sudo tee -a /etc/modprobe.d/blacklist.conf



http://www.geekamole.com/2013/rt2800usb-fix-for-ralinkmediatek-3070-gentoo-linux/

Remove all loaded modules:
rmmod rt2x00usb rt2800lib rt2800usb rt2800usb rt2x00lib

Patch alle the Drivers:


find ./drivers/net/wireless/rt2x00/ -type f -exec sed -i -e 's|RF5370|RF3070|g' {} \;
 
Mod rt2800.h File:#define RF3070    0x3070   
 
Remove Old drivers from(new drivers will be in /lib/modules/3.4.79+/extra:
rm /lib/modules/3.4.79+/kernel/drivers/net/wireless/rt2x00/*
 

make M=drivers/net/wireless/rt2x00/

make M=drivers/net/wireless/rt2x00/ modules_install

*plug in Device *




Speedtest Results:
0bda:8189 Realtek Semiconductor Corp. RTL8187B:

Testing download speed........................................
Download: 3.87 Mbit/s
Testing upload speed..................................................
Upload: 2.12 Mbit/s








Mittwoch, 2. April 2014

Blue Usb Rocket Launcher Driver

 Usb Rocket Launcher Library for the Blue Model. Self Explaining use.




Find my Library under:
https://github.com/N8body/RocketLauncher

Olinuxino A20 H264 Encoding

This Blogpost is about the Hardware h264 Encoder on the A20 and how to use it.
After searching around,i found this Encoder(https://github.com/jemk/cedrus/tree/master/h264enc) but was not able to use it. After contacting the Author,i finally got it working,and the author told me,that there is another library,which was forked of his project,and should work well. I tried both. So enought Talk,here ist the instruction

1. git clone https://github.com/ebutera/gst-plugin-cedar
2. For Compiling youll need
apt-get install gstreamer0.10-tools libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

2. compile using the autogen.sh script & make
3.  On my Installation(Stock Debian 7 Image of Olinuxino A20 ) i had to put the two Files(libgstcedar.la & libgstcedar.so) to the right path. Trough "make install" they were copied to /usr/local/lib/gstreamer-0.10/ but in my Installation,the gstreamer path was  /usr/lib/arm-linux-gnueabihf/gstreamer-0.10/
4. Test if the Library is recognized correctly by  "gst-inspect cedar_h264enc". If you get no errors you have managed it.
5. Before using it,ensure you have a /dev/cedar_dev . if not,just make a modprobe sunxi_cedar_mod
for having it everytime use: put sunxi_cedar_mod in  /etc/modules 

Now to the Encoding Commands
1 Get Testoutput:
gst-launch -ve videotestsrc ! cedar_h264enc ! h264parse ! matroskamux ! filesink location="test.mkv"
2. Convert from some format to h264 (maybe with an error)
gst-launch -ve filesrc location=input.avi ! ffmpegcolorspace ! cedar_h264enc ! h264parse ! matroskamux ! filesink location="output.mkv" 
 3. Stream from your Webcam on Justin.Tv(you can also use ustream or twitch,or any other rtmp server)
gst-launch -ve v4l2src device=/dev/video0 ! ffmpegcolorspace ! video/x-raw-yuv, width=1280, height=720, format=(fourcc)NV12 ! cedar_h264enc ! h264parse ! flvmux streamable=true ! rtmpsink location=rtmp://live-fra.justin.tv/app/$STREAMKEY



For now the Cpu is going to 100% but i have read,its because of the Color Converting Routines.
There is some discussion about using a custom Filter(not the ffmpegcolorspace) here:
http://processors.wiki.ti.com/index.php/GstTIPlugin_Elements#TIPrepEncBuf
Havent tried it yet,but i think its possible to use. 
 The Cpu is going to 100% with or without the color conversion. The Plugin is experemental,maybe thats why.


For Overlays you can use:
Also consider about using https://developer.ridgerun.com/wiki/index.php/Fast_GStreamer_overlay_element for overlays.



Donnerstag, 20. März 2014

Add new script.bin

mount /dev/mmcblk0p1 /projects/mnt
cd /projects/mnt

git clone https://github.com/linux-sunxi/sunxi-tools
cd sunxi-tools 
make
cd .. 
sunxi-tools/bin2fex ./script.bin ./script.fex
 


[uart_para3]
uart_used = 1
uart_port = 3
uart_type = 2
uart_tx = port:PG06<4><1><default><default>
uart_rx = port:PG07<4><1><default><default>

sunxi-tools/fex2bin ./script.fex ./script_changed.bin


Testen mit:
dmesg | grep uart

[    0.624293] [uart]: used uart info.: 0xc9
[    0.629014] [uart]: serial probe 0 irq 33 mapbase 0x01c28000
[    0.655253] sunxi-uart.0: ttyS0 at MMIO 0x1c28000 (irq = 33) is a U6_16550A
[    1.395339] [uart]: serial probe 3 irq 36 mapbase 0x01c28c00
[    1.427200] sunxi-uart.3: ttyS1 at MMIO 0x1c28c00 (irq = 36) is a U6_16550A
[    1.439012] [uart]: serial probe 6 irq 51 mapbase 0x01c29800
[    1.470806] sunxi-uart.6: ttyS2 at MMIO 0x1c29800 (irq = 51) is a U6_16550A
[    1.482628] [uart]: serial probe 7 irq 52 mapbase 0x01c29c00
[    1.514441] sunxi-uart.7: ttyS3 at MMIO 0x1c29c00 (irq = 52) is a U6_16550A


Entnommen aus:
http://linux-sunxi.org/Fex_Guide#.5Buart_para1.5D
http://linux-sunxi.org/A20/PIO 
port:<port><mux feature><pullup/down><drive capability><output level>