It was little bit annoying to notice that openSUSE only had Poulsbo (GMA500) drivers for openSUSE 11.2 (Sorry if i’m wrong just couldn’t find them on obs).
Poulsbo seems to be popular with notebooks (Acer Aspire One for example) and some embedded devices. These are not so good drivers but they work until we get better from FSF.
(more…)
Author Archive
Intel GMA500 Poulsbo drivers and openSUSE
April 12th, 2011 by TuukkaeGalax touchscreen on CTFTAB how to make it work
December 8th, 2010 by TuukkaI’ve been playing with CTFTAB and was trying to make touch screen work on openSUSE 11.3. First everything went easy but then troubles arised!
(more…)
Gstreamer perl bindings and converting ogg to mp3
March 10th, 2009 by TuukkaI’ve been playing with Gstreamer Perl binding lately and find out there is not good tutorial abouy how to make it. Ogg playing is not so straight forward as you excpect. This just stupid example that shows how to use Perl and Gstreamer in real job.
gst-launch filesrc location=test.ogg ! oggdemux name=muxer muxer. ! vorbisdec ! audioconvert ! lame bitrate=320 ! filesink location=test.mp3
#!/usr/bin/perl
# How to convert OGG to MP3 (Why you want to do that?)
# But good way to make exampe in Gstreamer in perl
use strict;
use warnings;
use Glib qw(TRUE FALSE);
use GStreamer;
GStreamer -> init();
if ($#ARGV < 1) {
printf "usage: %s %dn", $0, $#ARGV;
exit -1;
}
print $ARGV[0]." to ";
print $ARGV[1];
print "n";
# create a new pipeline to hold the elements
my $l_SPipeline = GStreamer::Pipeline -> new("pipeline");
# Create Source read file
my $l_SSource = GStreamer::ElementFactory->make(filesrc => "file-source");
# Mux OGG
my $l_SOggDemuxer = GStreamer::ElementFactory->make(oggdemux => "ogg-demuxer");
# Decode Vorbis audio
my $l_SVorbisDecoder = GStreamer::ElementFactory->make(vorbisdec => "vorbis-decoder");
# If needed convert audio
my $l_SAudioConverter = GStreamer::ElementFactory->make(audioconvert => "converter");
# Queue it if needed
my $l_SQueue = GStreamer::ElementFactory -> make(queue => "queue");
# Sink it to file
my $l_SSink = GStreamer::ElementFactory->make(filesink => "file-sink");
# Mp3 encode
my $l_SEncode = GStreamer::ElementFactory->make(lame => "mp3-encoder");
# Set up lame
$l_SEncode->set(bitrate => 320);
# Set filenames
$l_SSource->set(location => Glib::filename_to_unicode $ARGV[0]);
# Sink
$l_SSink->set(location => Glib::filename_to_unicode $ARGV[1]);
# add objects to the main pipeline
$l_SPipeline -> add($l_SSource, $l_SOggDemuxer, $l_SVorbisDecoder, $l_SAudioConverter, $l_SQueue, $l_SEncode, $l_SSink);
# Link source to Ogg muxer
$l_SSource->link($l_SOggDemuxer) or die "Can't link source to OGG-muxer";
# Link rest of pipeline
$l_SVorbisDecoder->link($l_SQueue, $l_SAudioConverter, $l_SEncode, $l_SSink) or die "Can't link rest of stuff";
# Link Pads from Source to Sink
$l_SOggDemuxer->link_pads("src", $l_SVorbisDecoder, "sink");
# listen for newly created pads
$l_SOggDemuxer->signal_connect(pad_added => &pgotm_addPads) or die "Can't link Pads to vorbis";;
# start playing
$l_SPipeline -> set_state("playing");
# Listen for EOS
pgotm_eventLoop($l_SPipeline);
$l_SPipeline -> set_state("null");
# Add pads
sub pgotm_addPads {
my ($element, $pad, $data) = @_;
my $l_SCaps = $pad->get_caps();
my $l_SMime = $l_SCaps->get_structure(0) -> { name };
printf "Mime that is added is: %sn", $l_SMime;
printf "A new pad %s was created %sn", $pad->get_name(), $pad->get_parent()->get_name();
# If it's vorbis audio
if( $l_SMime eq "audio/x-vorbis" ) {
# Can it link to the audiopad?
my $l_SSinkPad = $l_SVorbisDecoder->get_pad("sink");
# Check if vorbis not linked..
if( !$l_SSinkPad->is_linked() ) {
if( $pad->link( $l_SSinkPad ) ) {
die "Can't link pads!rn";
}
print "Audio pads linked!n";
} else {
print "Audio is allready linked.. can't do it!n";
}
}
}
# Event loop to listen to events posted on the GstBus from the pipeline. Exits
# on EOS or ERROR events
sub pgotm_eventLoop {
my ($l_SPipe) = @_;
my $l_SBus = $l_SPipe->get_bus();
while (TRUE) {
my $l_SMessage = $l_SBus->poll("any", -1);
if ($l_SMessage->type & "eos") {
print "EOSn";
return;
} elsif ($l_SMessage->type & "warning") {
print "Warning".$l_SMessage -> error."n";
} elsif ($l_SMessage->type & "error") {
$l_SSource->set_state("null");
$l_SAudioConverter->set_state("null");
$l_SVorbisDecoder->set_state("null");
$l_SPipeline->set_state("null");
die $l_SMessage -> error;
}
}
}
and what this all has to do with openSUSE you may ask? I packaged RPM from perl-Gstreamer 0.15 it can be found on build.opensuse.org. Problem was I got stuck when I was doing mp3 to ogg conversion. Nothing happens, I assume I have to links pads some how
. Anybody how have been doing this with python??
My first trip to XSLT
December 17th, 2008 by TuukkaI found myself asking why XML formater to CSV (or what ever) should be so hard? So I started to explore XSLT stylesheets and all the bad things seems to fade a way and good things are here again!
Problem
Problem was to remove some nodes from XML-tree. There isn’t ‘good’ way to do this on XSLT (if there is please tell me!). but the XML dummy code looks like this:
<?xml version="1.0"?>
<root>
<node copy="0" id="1">
<child>Child 1</child>
</node>
<node copy="0" id="2">
<child>Child 2</child>
</node>
<node copy="0" id="3">
<child>Child 3</child>
</node>
<node copy="0" id="4">
<child>Child 4</child>
</node>
<node copy="1" id="5">
<child>Child 5</child>
</node>
<node copy="0" id="6">
<child>Child 6</child>
</node>
<node copy="1" id="7">
<child>Child 7</child>
</node>
<node copy="0" id="8">
<child>Child 8</child>
</node>
<node copy="0" id="9">
<child>Child 9</child>
</node>
<node copy="0" id="10">
<child>Child 10</child>
</node>
</root>
and XSLT file for copying only copy=”1″ looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<root>
<xsl:for-each select="/root/node">
<xsl:if test="@copy='1'">
<xsl:text> </xsl:text>
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
So its so short. Then just launch it with
xsltproc some.xsl some.xml
and there should be correct output
LTSP and x86_64 server x86 clients problems solved
December 17th, 2008 by TuukkaI was looking for something to solve my last problem how to heck compile binaries on x86_64 openSUSE 11.0 to KIWI-LTSP x86? I was lost.. totaly then i found this and decided to add LTSP developer tools (GCC and needed libs) and finally it worked. Only problem is that those LTSP machines are slow on building but I got to get icecream working on them
. I admit this is not best way to solve this but seems to work…
X86 ain’t X86_64 on LTSP
November 26th, 2008 by TuukkaDear Doc I have problem
My LTSP server is X86_64 openSUSE 11.0 and clients are x86 VIA processor machines. I want to do C-coding on LTSP server and compile them to x86 for locally testing on LTSP clients.
Okay hello-world.c goes very fine with gcc -m32. Users are happy. Then comes my problem I like to compile x86 programs that have x86-libs. There is some libraries in repos that have x86 libs also but not all. So is there easier way to do this than make like it can be done in build (I know this rpm making command but only for root) just type something and magic happens?? I have solved this using libraries from build-root (build-command) but there is problems with this also.
Please help. Am I fat I’m allmost 30 (27.11 actually) 185 cm and weight 78?
Greetings from Lappland home of a Lapdancing
October 28th, 2008 by TuukkaFirst of all I like to thank everyone (all those 18) who voted me. I’m actually thrilled about someone even noticed I’m in the race. Good thing about this voting thing was it did had better voting procent that we had last sunday in Finland (We also got voting). We only got 61,2% (Who is 0,2?) which means we have 1,5 million sleeping citizen. That’s about that
I have my opinions about chosen persons.
Call for the embedded
Are you embedded device developer? Are you interested in maintaining something in build.opensuse.org? Let’s make OpenSUSE better for embedded platform developers to come. I’ve been packaging GPE lately. Then I go packaging Hildon. I’ve been also playing around to get some crosstoolchains available for OpenSUSE but get stuck on OBS and RPM stuff.
What about the title
Everyone who have watched South Park knows that Lappland is home of a lapdance (As Cartman puts it). So here I’m writing this from Levi tunturi and as you can see from the picture here is snow and cold. /me like it!
Just a normal day in Geekland 2/2
October 14th, 2008 by TuukkaIf you missed last article you can read it here. I got one very good feedback about how to use Gstreamer. I played with Gstreamer a bit and found it a marvelous beast. It might even make you a good sandwich if you need one.
But sometimes I still like to have GUI. I’ll separate my post in two parts: First is about how to stream to Shoutcast/Icecast server from VLC and second is about how to do it with Gstreamer.
How I Learned to Stop Worrying and Love theVLC
VLC is what you need in playing audio or video. It’s super Geek toy. VLC does everything you can dream on and it’s somehow gludge to use
. VLC is just great! You can download it from Packman.. go now! VLC can stream to Shoutcast without a problem. If you use OGG you can stream audio and even video (thats something). So this is the way I do it:
vlc -vv yourgreatmarvelousaudiovideo.ogg \
--sout-shout-name "Name of you stream" \
--sout-shout-description "Descriptions of your stream" \
--sout-shout-genre Genre --sout-shout-url http://www.yourstream.com:8080/stream \
--sout-shout-bitrate 486--sout-shout-samplerate 44100 --sout-shout-channels 2 \
--sout-shout-quality 6 \
--sout '#duplicate{dst=std{access=shout,mux=ogg,dst=source:name@www.yourstream.com:8080/stream}}'
This has one major problem! You are forced to record OGG somewhere… otherplace? So read on to gstreamer to see how make it in one line. Good thing is if OGG is recorded on fly. If you choose to use remember: VLC just keeps streaming when it hits end (If there is more to stream). You must have something like 30 seconds gap before you start stream so you wont hit in situation when it doesn’t work anymore.
Gstreamer Does Dallas
Here it comes without any warnings:
gst-launch alsasrc ! audioconvert ! \ taginject tags="title=\"Name of you stream\",genre=\"Genre\",\ artist=\"Who is you artist?\",album=\"Best album on earth\",comment=\"If you read comments you didn't have clue? Didn't you?\"" ! \ vorbisenc name="enc" quality=0.91 ! queue ! \ oggmux name=mux ! queue ! tee name= t ! queue ! filesink location=output.ogg t. ! queue ! \ shout2send ip=www.yourstream.com:8080 username=source password=password mount=/stream streamname="Name of you stream" \ description="Description of you stream" genre="Genre"
Is that great! Megacryptic oneliner! It works… yipee! Even quality is not something like 6 it’s 0.91 (which is 168kbs). I won’t open it i’ll give you fun time to figure out how it works
. Remember to have correct plugins to make this (I think gstreamer-plugins-good is enough.. someone have better glue?).
What next?
Is there life after this. Yes there is. Users are kinda difficult to handle. How to explain what the heck is OGG when they don’t understand what the difference is between AAC, MP3 or WMA? So I’ll seek some easy ways to persuade (L)users to use OGG without they even notice
.
Just a normal day in Geekland 1/2
October 3rd, 2008 by TuukkaI was having a lot of fun with openSUSE. Then I get that feeling that didn’t had enough fun at all. I was listenin my LP-records and felt little sad about that they could fit to my mobilephone. So I decided to do little megamix (and use my DJ-Sk1lzz). So I tried audacity (little bit over kill). Gnome record (Naah.. too professional still). I wanted something that records to disk same time it comes from ALSA in Ogg/Vorbis by command line.
I searched in Freashmeat, Build and Google no fun at all. Little thinking (actually this one was long while) I had an idea that I have two easy options: Mplayer and SoX. Mplayer is fantastic. It’s more than you can imagine. FFMpeg in somehow learnable syntax and more stuff upon it. One thing made it unusable (If some one know howto I will try) it couldn’t only record from ALSA device and turn it to Ogg/Vorbis buut I found SoX could very easyly.
rec output.ogg
So SoX it will be then. Only think I noticed missing that I wanted Artist, Dates and stuff like that in Ogg-file and that couldn’t be done in SoX (or can I?). So this get more Geekish (hooray!). I launched little stdout/stdin pipe and putted oggenc to end of the command so it looked like this.
rec --no-show-progress -t wav - | oggenc - -q 6 -b 168 -c "Comment $(date +%x)" -d "$(date +%x)" \ -G "Funk" -l "The Album" -t "The Title" -a "Dj SupaGeekorous" -o outputfile-$(date +%x).ogg
Geek in me felt very happy I was having a time of my life
. Mission compilished or was it.. NO! I got Idea to stream my marvelous mix to the world with Icecast and VLC live when i’m doing it. So I think I have to try this and If you don’t nuke me down I’ll tell you how it went.
