Need general advice on writing software for an embedded system [closed] - multithreading

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 days ago.
Improve this question
I am a beginner software engineer for embedded systems (STM32 microcontroller, C programming language). I understand the basics, but I have little experience. So I have big troubles understanding the actual implementation of such concepts as:
Device drivers, protocols and interaction between different levels of the stack of protocols. Let's say I have to implement UART driver and MODBUS protocol. I have UART read and write routines and a circular buffer. I constantly receive bytes and read them using low-level UART device driver and put these bytes in a circular buffer. But how does the upper level interpret and decode MODBUS message? How do I find the starting byte of MODBUS packet? Where do I do it in a program (main loop or separate thread)?
Avoiding race conditions and providing thread safety.
Ensuring proper timing of multithread application.
Basically, what I need is a link or a textbook with some general theory on a topic, tips/patterns/good practices/techniques. But most importantly, some clear examples implementing a stack of protocols and drivers.
Thank you.
Obviously I tried to Google and found a couple of good links, but I don't know how to make a proper query.

Related

High level mp3 player library under linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I need to add some mp3 file playing functionality to my Linux based embedded application. Until now I used a system call (mpg123 -qm list of mp3 files). But now I don't have all the elements of the playlist, but get the next one only when I'm ready with the previous one. With mpg123 it means that I have some stupid noise between the tracks, as I always have to restart the mpg123 binary.
I was looking around for some libraries and found libmad, lame, sdl and co. But they seem to be a bit overcomplicated at first to handle. I found the fmod (http://www.fmod.org/index.php/download) library easy to use. But it's available only in binary format, which doesn't fit my ARM-based target (not to mention the licensing problems). Does anybody know about any similar, open source library capable of playing mp3 files similar to fmod?
mpg123 has an API, perhaps you could use that instead of calling the binary?
OK, finally with the help of houbysoft's hint i found a solution which uses libmpg123 and libao, here, and with some tuning i managed to get pretty smooth file-by-file playing. Thx for the hint!

Capturing video in Linux from a frame buffer in C/C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I would like to ask you to recommend me a C/C++ library to capture video.
I am getting frames from a camera at 16 bits per pixel (RGB), and I would like to save those frames in a video format in an efficient way to be able to look at it in the future.
Would you please recommend me a good C/C++ library that I can use under Linux please?
A Google search gives me a lot of libraries, and I am really not sure which one does a good job and is widely used. I would greatly appreciate your help.
Thank you very much.
As far as I know -- the predominat library is Video4Linux -- however I have not tried it myself, but the list of applications using/supporting it is impressive.
Addition:
For Multi media Encoding GStreamer is probably one of the most used frameworks.

Bluetooth mouse/keyboard emulation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm having a hard time finding a software that would emulates a Bluetooth keyboard (and/or mouse) that follows HID standard.
I've already found one, but I couldn't get it working: http://mulliner.org/bluetooth/xkbdbthid.php
I'm only interested in a solution that uses HID standard so that other machines can immediately recognize the soft as Bluetooth hid device, without the need of any pre-installed softwares. (Running under Windows or Linux if possible.)
Would it be possible to write a code in java to emulate Bluetooth hid devices?
Any help would be very appreciated, thanks!
It's been a while since you asked the question, but I'm going to add this answer anyway, it may help you or someone else.
I'm also interested in Bluetooth HID emulation, ideally from within some Java/Android code. However, I came across this Python-based script/project:
http://code.google.com/p/hidemulator
I've not tried this code myself, but from what I can see, the script is reasonably easy to follow. It currently only supports the PS3's six-axis controller, but maybe you (or I, if I ever get the time) could adapt the Nokia project's Keyboard and Mouse routines into the Python script (or convert it to Java/Groovy, which is my ultimate goal ;-) ).
Cheers
Rich
It's not you are searching for but for Android devices.
AndroHid
http://code.google.com/p/androhid/
You need rooted device.
Unfortunately it doesn't work on my Nexus S - Cyanogen 9
btkbdd does this for Linux with Bluez. See: https://github.com/lkundrak/virtkbd/blob/master/btkbdd.pod

Best open source project for audio signal processing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Need to find if there is a open source project for audio signal processing, just as we have openCV for image processing.
Thanks
In my course for the more technical part, we were introduced to signal processing, we had to use Octave with the audio package and gnu plot for plotting.
For the fun part of the course used MaxMSP/Jitter which is a commercial project,
but there's always PureData which is opensource and the Jitter equivalent would be PD Gem, but just for audio signal processing you should be fine with PureData.
In short, if you're into the number crunching bit, Octave should be fine.
We also did the image processing in Octave too, it's two dimensions as opposed to one(sound), but it's still signal processing. You can apply a high-pass or a low pass filter to an image too, you can try an echo/delay on images for fun if you like.
Pure Data is a bit different, since you patch cords instead of typing lots of code, but it's pretty fun and one of the advantages is that you can make changes live, while your patch/program is running which makes it great for fast prototyping.
Straying a bit from audio signal processing, if you're into generative music, you should have a look at some opensource projects like ChucK, SuperCollider, ixi
or fluxus...some do cool stuff with Haskell.
Update
On the c++ side you can also check out Dr. Mick Grierson's Maximilian library which also includes a nice little addon for OpenFrameworks
It's also worth checking out Sonic Visualiser and Vamp Plugins (a lot of nice goodies there)
HTH

Good framework for the game of Go (weiqi, baduk)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I enjoy the game of Go (also known as weiqi in China or baduk in Korea). I want to create a program (an evaluation function) to play it.
I would prefer if the framework handled two important tasks:
Handle rules for the game, including captures, ko rules, and final scoring.
Handle communication between a server like KGS and my program.
Also, my home machines run Linux or Mac OS X; I cannot use any only-Windows platforms.
Thank you!
GNU Go is a great open source Go program. Its evaluation function is well-documented and it provides an easy way to output the explanation for every move the program made. You can either replace the evaluation function from scratch with your own, or tinker with the existing one.
Open Go is an open source tool with code for communicating using the Go Modem Protocol. I believe that's what you need for the second part of your question.
This is an old question, but for people out there interested in an Android implementation of Go (Baduk/Weiqi) take a look at my project on https://github.com/amgreg/AndroidGo
It's a simple validator with a user-interface attached. Drawbacks are: No AI; no scoring; no server connection.

Resources