Go to advanced search

by flatmax
Tue Jun 13, 2017 10:31 am
Forum: C/C++
Topic: Tutorial contents - Multithreading using gtkIOStream
Replies: 0
Views: 504

Tutorial contents - Multithreading using gtkIOStream

gtkIOStream is a set of C++ headers which enable you to multithread in a very trivial manner. The nice thing about gtkIOStream is that this component is only a header file, this makes distribution easier, as you don't need to link against foreign libraries. gtkIOStream threading is partially platfor...
by flatmax
Tue Jun 13, 2017 10:20 am
Forum: C/C++
Topic: Tutorial 2 - Multithreading using gtkIOStream
Replies: 2
Views: 582

Re: Tutorial 2 - Multithreading using gtkIOStream

To compile the program we execute the following g++ -Igtkiostream/include -pthread ThreadVars.C -o ThreadVars we then run the program $ ./ThreadVars Thread class : I will have 3 sleeps Thread class : I will sleep for 2 seconds each time Thread's counter has 3 sleeps left I awoke, decrementing cnt to...
by flatmax
Tue Jun 13, 2017 10:06 am
Forum: C/C++
Topic: Tutorial 2 - Multithreading using gtkIOStream
Replies: 2
Views: 582

Re: Tutorial 2 - Multithreading using gtkIOStream

On the command line, edit the file ThreadVars.C geany ThreadVars.C Enter or cut and paste the following into the file. #include <Thread.H> #include <unistd.h> #include <stdlib.h> /** This class inherits the ThreadedMethod class. * The virtual method threadMain must be defined here. */ class Threaded...
by flatmax
Tue Jun 13, 2017 9:38 am
Forum: C/C++
Topic: Tutorial 2 - Multithreading using gtkIOStream
Replies: 2
Views: 582

Tutorial 2 - Multithreading using gtkIOStream

Multithreading is a term used for running your code in parallel. gtkIOStream is a set of C++ headers which enable you to multithread in a very trivial manner. Tutorial contents can be found here . If you haven't set up your system you should refer to Tutorial 0 which will lead you through installati...
by flatmax
Fri Jun 09, 2017 2:04 pm
Forum: Gaming
Topic: Raspberry Pi Arcade Bartop
Replies: 1
Views: 1037

Re: Raspberry Pi Arcade Bartop

I can't believe no one has answered your questions about your awesome enthusiasm for pixel and sound byte perfect retro gaming ... I used to use MAME, and for that I used to use the Ultimark interface board. However, as you have rightly pointed out there are plenty of GPIOs on the Pi and you probabl...
by flatmax
Fri Jun 09, 2017 1:49 pm
Forum: Graphics, sound and multimedia
Topic: Audio Analyser using Sound CARD and Raspberry Pi
Replies: 4
Views: 1294

Re: Audio Analyser using Sound CARD and Raspberry Pi

OK - yes, once you set up SPDIF, it should show up as just another ALSA device (JAAD). So there should be a nice simple fast track for you :)

Matt
by flatmax
Fri Jun 09, 2017 1:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Raspberry PI2 I2S ADC
Replies: 6
Views: 5153

Re: Raspberry PI2 I2S ADC

Hi there, To setup your ADC, you will want to implement a machine driver for ALSA or use the simple I2S driver configured in the device tree overlay you will make. There is a very long I2S thread on this forum which can assist you ... they are constantly having successes there :) Check the supported...
by flatmax
Fri Jun 09, 2017 1:29 pm
Forum: Graphics, sound and multimedia
Topic: Audio Stream Low Latency
Replies: 13
Views: 9868

Re: Audio Stream Low Lantency

Yes, RTP is based on UDP networking which is very low level and implemented almost everywhere.

Matt
by flatmax
Thu Jun 08, 2017 11:52 am
Forum: C/C++
Topic: Tutorial 1 - Multithreading using gtkIOStream
Replies: 2
Views: 1219

Re: Tutorial 1 - Multithreading using gtkIOStream

To compile this program, we execuate a very similar command to that from Tutorial 0, however we change the source and output file names. g++ -Igtkiostream/include -pthread SimpleThreads.C -o SimpleThreads You should see no output and the file SimpleThreads which is a binary executable should have ap...
by flatmax
Thu Jun 08, 2017 11:17 am
Forum: C/C++
Topic: Tutorial 1 - Multithreading using gtkIOStream
Replies: 2
Views: 1219

Re: Tutorial 1 - Multithreading using gtkIOStream

One the command line open geany ready to edit the file SimpleThreads.C : geany SimpleThreads.C Type or paste the following code into it : // include what we need #include <Thread.H> #include <unistd.h> #include <stdlib.h> /** This class inherits the ThreadedMethod class. * The virtual method threadM...
by flatmax
Thu Jun 08, 2017 11:03 am
Forum: C/C++
Topic: Tutorial 1 - Multithreading using gtkIOStream
Replies: 2
Views: 1219

Tutorial 1 - Multithreading using gtkIOStream

Multithreading is a term used for running your code in parallel. gtkIOStream is a set of C++ headers which enable you to multithread in a very trivial manner. gtkIOStream threading is partially platform independent because it lets you use either pthreads OR glib threads. The default however is pthre...
by flatmax
Wed Jun 07, 2017 1:25 pm
Forum: Staffroom, classroom and projects
Topic: Traffic Lights with Sound Sensor for noisy class
Replies: 3
Views: 4046

Re: Traffic Lights with Sound Sensor for noisy class

Yep - doable. The trick would be to calibrate the sound level. For that you may need a sound level meter of some sort which isn't on the Pi. The idea would be to do the following : 1] Use a sound card with a microphone either USB or GPIO. 2] Either write some software to implement a sound level mete...
by flatmax
Wed Jun 07, 2017 1:08 pm
Forum: Graphics, sound and multimedia
Topic: Audio Stream Low Latency
Replies: 13
Views: 9868

Re: Audio Stream Low Lantency

HI there, One solution for low latency audio streaming is to use the RTP protocol. We have dealt with this problem on the Audio Injector forum in the topic "Streaming from the input". The solution proposed there is to use avconv to output the RTP protocol. The RTP protocol is a UDP network protocol ...
by flatmax
Wed Jun 07, 2017 12:18 pm
Forum: HATs and other add-ons
Topic: Audio injector zero is live !
Replies: 4
Views: 1615

Re: Audio injector zero is live !

This project has won a "projects we love" badge from the Kickstarter crew ... come along and join the fun here !

https://www.kickstarter.com/projects/12 ... aspberry-p
by flatmax
Wed Jun 07, 2017 10:54 am
Forum: C/C++
Topic: Tutorial 0 - Multithreading using gtkIOStream
Replies: 8
Views: 1852

Re: Tutorial 0 - Multithreading using gtkIOStream

Lets break down the compile line and show the output you should expect from running this program. The compile line we used was : g++ -Igtkiostream/include -pthread gtkiostream/test/ThreadTest.C -o ThreadTest We can break it down like so : g++ this is the GNU compiler for C++ -Igtkiostream/include te...
by flatmax
Wed Jun 07, 2017 10:47 am
Forum: C/C++
Topic: Tutorial 0 - Multithreading using gtkIOStream
Replies: 8
Views: 1852

Re: Tutorial 0 - Multithreading using gtkIOStream

Lets setup gtkiostream in your home directory ... Install the C++ compiler and git to fetch the gtkiostream sources : sudo apt-get install g++ git Fetch gtkiostream (we will use the git repo) : git clone https://github.com/flatmax/gtkiostream.git Lets build the ThreadTest file which ships with gtkio...
by flatmax
Wed Jun 07, 2017 10:28 am
Forum: C/C++
Topic: Tutorial 0 - Multithreading using gtkIOStream
Replies: 8
Views: 1852

Tutorial 0 - Multithreading using gtkIOStream

Multithreading is a term used for running your code in parallel. gtkIOStream is a set of C++ headers which enable you to multithread in a very trivial manner. The nice thing about gtkIOStream is that this component is only a header file, this makes distribution easier, as you don't need to link agai...
by flatmax
Wed Jun 07, 2017 10:13 am
Forum: Graphics programming
Topic: STICKY: Tutorial 3 - Programming GTK GUIs using gtkIOStream
Replies: 11
Views: 9206

Re: Tutorial 3 - Programming GTK GUIs using gtkIOStream

Here is the resulting GUI :
FrameExample.png
FrameExample GUI
FrameExample.png (9.51 KiB) Viewed 7205 times
by flatmax
Wed Jun 07, 2017 10:12 am
Forum: Graphics programming
Topic: STICKY: Tutorial 3 - Programming GTK GUIs using gtkIOStream
Replies: 11
Views: 9206

Re: Tutorial 3 - Programming GTK GUIs using gtkIOStream

Sure, for the frame thing... #include <gtkInterface.H> #include <Labels.H> #include <Box.H> #include <Frame.H> int main(int argc, char *argv[]){ gtk_init( &argc, &argv ); // init GTK GtkInterface topWindow; // Create the top box Labels labs; // Instantiate the Labels class and load three labels labs...
by flatmax
Tue Jun 06, 2017 12:57 pm
Forum: Graphics, sound and multimedia
Topic: Audio Analyser using Sound CARD and Raspberry Pi
Replies: 4
Views: 1294

Re: Audio Analyser using Sound CARD and Raspberry Pi

Hi there, You can find a short list of some available cards here . Personally I like programming in C++ and use either Jackd or ALSA. For Jackd, there is an example audio processing client here . All you have to do is change the TestJackClient::processAudio method to what you want it to do ... that ...
by flatmax
Tue Jun 06, 2017 9:30 am
Forum: Python
Topic: Play four sounds on four speakers with a raspberry pi
Replies: 6
Views: 1165

Re: Play four sounds on four speakers with a raspberry pi

Oh not sure what you mean.
You could use gedit and save the file as ~/.asoundrc

The ~ expands to your home directory, where for the default pi user, that is /home/pi
by flatmax
Tue Jun 06, 2017 9:30 am
Forum: Media centres
Topic: Music media center with wireless speaker
Replies: 4
Views: 1469

Re: Music media center with wireless speaker

There are lots !

Allconnect is ok, I like it.

Matt
by flatmax
Mon Jun 05, 2017 12:23 pm
Forum: Media centres
Topic: Music media center with wireless speaker
Replies: 4
Views: 1469

Re: Music media center with wireless speaker

Does your speaker support DLNA ? If it does, then here is one scenario : 1] Setup a dlna server on your pi ( such as minidlna - if it will work for you then sudo apt-get install minidlna) and configure the server as required. 2] Use an app on your phone - a dlna controller - to ask the Pi to send au...
by flatmax
Sun Jun 04, 2017 12:51 pm
Forum: Graphics, sound and multimedia
Topic: Pulse audio and surround
Replies: 2
Views: 1855

Re: Pulse audio and surround

Thanks KTB - you're a legend !

Matt
by flatmax
Sun Jun 04, 2017 12:49 pm
Forum: Python
Topic: Play four sounds on four speakers with a raspberry pi
Replies: 6
Views: 1165

Re: Play four sounds on four speakers with a raspberry pi

We are working on something similar with the audio injector Octo sound card. You can see the discussion here : http://www.flatmax.org/phpbb/viewtopic.php?f=9&t=2095 The idea is to give each of the speakers you want to play to a different device which all mix down using the ALSA dmix plug. You have t...

Go to advanced search