Go to advanced search

by DarkElvenAngel
Thu Dec 05, 2019 1:35 pm
Forum: C/C++
Topic: Looking for recommendations of an audio library
Replies: 5
Views: 259

Re: Looking for recommendations of an audio library

I've never used "miniaudio," but I have used RtAudio and it works pretty good for my purposes. Are you using RtAudio with C? I'm working on some libraries (graphics and input) of my own and they aren't ready for C++. I see RtAudio has a C wrapper. Just wondering how you are using it and what back-e...
by DarkElvenAngel
Wed Dec 04, 2019 2:20 am
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 72
Views: 5809

Re: Where can I begin learning C/C++?

I agree wholeheartedly but schools always seem to favor these odd languages over something more useful. I understand many institutions are turning to Python these days. At least Python is something useful, many things can be done with it. It's not dependent on any given platform and micro python ev...
by DarkElvenAngel
Tue Dec 03, 2019 11:14 pm
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 72
Views: 5809

Re: Where can I begin learning C/C++?

Heater, Well done, well done. I see what you did there. I agree wholeheartedly but schools always seem to favor these odd languages over something more useful. I remember my computer science teacher teaching us Turing and LOGO who if anyone uses those these days. I thought when we got into Turbo Pas...
by DarkElvenAngel
Tue Dec 03, 2019 7:06 pm
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 72
Views: 5809

Re: Where can I begin learning C/C++?

rather than the correct int main() Don't you need "int main( void )" to be correct? One thing missing from the present thread on learning C is how important it is to choose a suitable programming project to motivate the learning. In my opinion, only by writing code is it possible to learn any kind ...
by DarkElvenAngel
Mon Dec 02, 2019 7:47 pm
Forum: C/C++
Topic: Looking for recommendations of an audio library
Replies: 5
Views: 259

Re: Looking for recommendations of an audio library

Hi, I'm using Pico TTS as a text to speech engine on a rpi zero W The output is a .wav file and the results (handled by a super-cheapo bluetooth speaker) are amazingly good! Hope this helps. Dave Dave, how do you play the WAV file back? I'm looking for something to play sounds back from my programs...
by DarkElvenAngel
Mon Dec 02, 2019 3:24 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 10
Views: 383

Re: Best way to handle sprites

A (long) long time ago when the Raspberry Pi was very new, I wrote some DispmanX code to try and work out and demonstrate the API. If you are interested it is available on github - https://github.com/AndrewFromMelbourne/raspidmx That's very helpful thanks! This is all very good information hopefull...
by DarkElvenAngel
Sat Nov 30, 2019 6:12 pm
Forum: C/C++
Topic: Images display with wrong colour order
Replies: 7
Views: 256

Re: Images display with wrong colour order

So far this is working I've wrapped the image loading in a function that returns the same structure as my ppm image function. This can be passed to the drawing function to copy to frame buffer. I have proper colour order now I don't see any noticeable performance hits but this is a Pi 4 and I have n...
by DarkElvenAngel
Sat Nov 30, 2019 5:51 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 10
Views: 383

Re: Best way to handle sprites

if you dont mind it being raspberry pi specific, you should look into dispmanx that api lets you draw rgba images at any xy coordinate you want, and it can draw ontop of the framebuffer or even x11 https://github.com/raspberrypi/firmware/blob/master/opt/vc/src/hello_pi/hello_dispmanx/dispmanx.c Now...
by DarkElvenAngel
Fri Nov 29, 2019 7:49 pm
Forum: C/C++
Topic: Images display with wrong colour order
Replies: 7
Views: 256

Re: Images display with wrong colour order

I'm thinking if I loop through and place all pixels into a int that will flip the colours. I looked at the colour data from two identical images one formated as ppm and the other is PNG the difference is my loading routine uses an int array to hold the pixel data and this allows for no problem copyi...
by DarkElvenAngel
Fri Nov 29, 2019 2:53 pm
Forum: C/C++
Topic: Images display with wrong colour order
Replies: 7
Views: 256

Re: Images display with wrong colour order

You need to determine the color order of your Linux framebuffer, I am not sure whether that is the same for all Linuxes. I tried with RHEL and Raspbian, and for both framebuffer is BGRA. You can easily test yourself. login to console sudo su for((i=0;i<4000;++i)); do echo -en "\xff\x00\x00\x00"; do...
by DarkElvenAngel
Thu Nov 28, 2019 6:50 pm
Forum: C/C++
Topic: Images display with wrong colour order
Replies: 7
Views: 256

Images display with wrong colour order

Hello everyone, I'm working on loading images into my program I found an easy enough library to load many formats. I'm using stb_image.h and everything works as far as loading the images I can load PNG and JPG without issue the problem is when I copy the data to my framebuffer the red and green chan...
by DarkElvenAngel
Wed Nov 20, 2019 6:57 pm
Forum: C/C++
Topic: Looking for recommendations of an audio library
Replies: 5
Views: 259

Looking for recommendations of an audio library

Hello everyone,

I'm looking for some suggestions on audio libraries for C Programming.

I'm looking for something easy to use and not too heavy (suitable to run on any Pi)

I'd like to play back MP3 and WAV files.

I'm hoping some of you have used these libraries and can recommend one.

Thanks
by DarkElvenAngel
Sun Nov 10, 2019 10:48 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 10
Views: 383

Re: Best way to handle sprites

I'm thinking a double buffer might be the only approach to solve this issue of background changing. A buffer for the background that is copied to the main frame buffer then apply the sprites over that and use this background buffer in place of the small working buffer. This will require more memory....
by DarkElvenAngel
Sun Nov 10, 2019 9:02 pm
Forum: Advanced users
Topic: Seperate framebuffers for each HDMI
Replies: 4
Views: 237

Re: Seperate framebuffers for each HDMI

Which leave using legacy graphics mode. This will instantiate a framebuffer for each attached device, but you will lose 3D acceleration, and hence desktop speed. Comment out the fkms line in config.txt. Thanks for that it works perfectly, now I have X on my main screen and access to the framebuffer...
by DarkElvenAngel
Sun Nov 10, 2019 1:38 am
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 10
Views: 383

Re: Best way to handle sprites

blackshard83 wrote:
Sat Nov 09, 2019 11:44 pm
Of course that's an approach, but it will work well only if your "background" does never change.
I see that could be a problem since it's very possible that the background could change, how do I deal with that?
by DarkElvenAngel
Sun Nov 10, 2019 1:28 am
Forum: Advanced users
Topic: Seperate framebuffers for each HDMI
Replies: 4
Views: 237

Seperate framebuffers for each HDMI

Hello all, Finally got my raspberry Pi 4 and a DVI to HDMI converter so now I have dual screens, I thought this would give me two framebuffers. I was hoping to have X run on my primary monitor and be able to Have something else on the other. I have the max_framebuffer option set to 2 is there someth...
by DarkElvenAngel
Sat Nov 09, 2019 5:34 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 10
Views: 383

Best way to handle sprites

Hello, I'm working on a raw Linux Framebuffer library and I'm thinking to add sprites if for nothing else I can use it for a mouse cursor. I'm writing all this is C and I'm not sure how it should work. My current thinking is to take a rectangle from where the sprite will be placed and save that in a...
by DarkElvenAngel
Thu Nov 07, 2019 12:14 am
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 682

Re: Searching for Algorithms

The more modern way is to simply approximate circles and arcs using bezier routines, if exact accuracy is not required. If you look at Windows API for example it doesn't even contain a conventional arc routine it uses start and end point with bounding box https://docs.microsoft.com/en-us/windows/wi...
by DarkElvenAngel
Wed Nov 06, 2019 12:02 pm
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 682

Re: Searching for Algorithms

How could you not find Bresenhams Circle Drawing Algorithm in the page of results: https://iq.opengenus.org/bresenhams-circle-drawing-algorithm/ Or this for ellipses, including example C source: https://www.geometrictools.com/Documentation/IntegerBasedEllipseDrawing.pdf And see here: https://en.wik...
by DarkElvenAngel
Wed Nov 06, 2019 3:09 am
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 682

Searching for Algorithms

Hello All, I'm trying to track down some algorithms for drawing arcs. All I keep finding is references to graphics.h for DOS and TurboC! I'm working on my framebuffer UI library and have most shapes I need except for arcs and ellipses (I've found the mid point algorithm for that) just have not imple...
by DarkElvenAngel
Thu Oct 31, 2019 7:55 pm
Forum: Other projects
Topic: Halloween HMI
Replies: 0
Views: 335

Halloween HMI

Halloween is upon us once again, And this year I have made something with raspberry Pi, an HMI or Human Machine Interface. It consists of a Raspberry Pi 3B+ the official touch screen all in a smarty pi casefor the master. And I have a Pi 0W and a custom board for a wireless remote. I'm running custo...
by DarkElvenAngel
Tue Oct 29, 2019 3:14 am
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 3468

Re: Turn Raspberry Pi on/off with TV

Post your code, it's easier to help you if I can see it.
by DarkElvenAngel
Mon Oct 28, 2019 4:56 pm
Forum: General discussion
Topic: Show splash screen ASAP
Replies: 13
Views: 904

Re: Show splash screen ASAP

Did you try the guide I posted? That will get a splash image in much faster than Plymouth. You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth. I have an older guild to achieve this here https://www.raspberrypi.o...
by DarkElvenAngel
Sun Oct 27, 2019 6:52 pm
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 3468

Re: Turn Raspberry Pi on/off with TV

It turns out that a monitor plugged into the HDMI port is required for the gpio-shutdown overlay to work. I did some testing today, and moved my RPi into the living room and connected it to my TV, then it worked fine. I then shut it down, disconnected the monitor, and tried again, and it worked fin...
by DarkElvenAngel
Sun Oct 27, 2019 1:10 am
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 3468

Re: Turn Raspberry Pi on/off with TV

Well I'm running kernel 4.19.57-7v+

And my config.txt entry reads

Code: Select all

dtoverlay=gpio-shutdown
I have the button connected to the gpio header and I press it and it shuts down.

Gpio header

Code: Select all

::|:::::::::::::::::         [USB PORTS
  ^ power button across here 5 and 6

Go to advanced search