Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux binaries #3

Open
steve-1507 opened this issue Jan 14, 2024 · 18 comments
Open

Linux binaries #3

steve-1507 opened this issue Jan 14, 2024 · 18 comments

Comments

@steve-1507
Copy link

Would it be possible to provide binaries for Linux too? I know I could compile them myself, but I don't want to install a thousand tools and IDEs and dependencies. So can you please add a standard bin for Linux that can then be added to the apt / dnf / pacman repositories.

@mariiaan
Copy link
Owner

From a programming perspective, there is no problem. It would be quite easy adding linux support to the source. However currently, I am not satisfied with the way it handles audio playback. I am gonna clean up that and then, I'll be including linux-x64 binaries under release, thanks for your opinion.

@steve-1507
Copy link
Author

steve-1507 commented Jan 15, 2024 via email

@steve-1507
Copy link
Author

So just for fun I tried to run it via Wine, and it draws around 2 frames per second. you can literally watch it go line by line
and btw, Grüße aus Bayern :)

@mariiaan
Copy link
Owner

Hm yeah, I never tried that, just ran it under a windows VM and it worked pretty good, ik that doesn't have anything to do with wine.
However, I recently had some time for this project, and I got so far rewriting the audio engine so that it would work under linux. I only gotta clean up some code and abstract away some os-related console functions, and then it's ready to go.
Grüße aus NRW :D

@steve-1507
Copy link
Author

steve-1507 commented Feb 21, 2024 via email

@mariiaan
Copy link
Owner

Yeah sure, thank you too. You're already contributing by opening issues.

@steve-1507
Copy link
Author

steve-1507 commented Feb 21, 2024 via email

@mariiaan
Copy link
Owner

Hello, I made some changes to the linprep branch for using this on linux. If you want to try it out, clone the code on that branch and either build with make --makefile linux.Makefile (see the makefile for packages you need to install) or (what I currently recommend because this branch is a hot mess, including it's code quality (had to change like everything ffmpeg related because they wanna change the whole API in every update)) just use the "cmdpla" binary file which is in the root directory, ik it's kinda sketchy (I hate putting binary files in my repositories)

It's compiled for amd64 so it should run on every modern 64-Bit System which is not ARM.

For me, everything is working except anything which has to do with colours (need to look into it but I guess the ncurses library seems to prevent ANSI colour escape codes)
And the frame rate seems pretty low (about ~15FPS for me, independent on the output resolution so it seems to be a terminal emulator? problem). This does not seem to be a direct issue of the program though (I did some performance monitoring, the main while loop for decoding and printing out seems to run at an iteration execution speed of 3ms which should result in ~333 FPS)

Anyway, there is lots of work to do including:

  • fixing the colours
  • looking into the FPS limit?
  • Cleaning up the code (get rid of thousands of #ifdef linux pp statements and making some kind of abstract classes for those functions)

Maybe you'll find out something, but I mainly share this so uk I'm not lazy
(tmr is AP1 for my Ausbildung so will have more time after that)

@steve-1507
Copy link
Author

I'm trying to compile a working binary, but need to resolve some dependencies. Sorry for the late reply

@mariiaan
Copy link
Owner

no worries, the only dependencies i think are needed are build-essentials, g++ and those listed in the linux makefile (in a comment at the top of the file)

@mariiaan
Copy link
Owner

mariiaan commented Mar 5, 2024

I have noticed a slight issue when compiling on a different linux-arm64 pc. Depending on your ffmpeg distribution, you might need to add "-l/usr/include/ffmpeg" to cflags in linux.Makefile
However other than that, it compiles on a fresh system.

@steve-1507
Copy link
Author

I had some difficulties with the libraries. Running make --makefile linux.Makefile returns an error since it can't find any library. You are including the libraries, right? Do they have to be in specific folders or how do I make the libs visible for compilation?

@mariiaan
Copy link
Owner

god, why didn't I see that, sorry about that.
As specified in the makefile comment, you need to install the following packages:
ncurses libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev

Depending on your distribution, you need to add "-l/usr/include/ffmpeg" to CFLAGS after "-Ilib/include/"

@steve-1507
Copy link
Author

So I was able to compile a binary, but noticed some issues:
FFmpeg throws an error when the file to be played isn't in the current directory
Trying to enable color just displays ANSI codes, both in virtual TTY and a terminal emulater (Konsole)
dithering doesn't seem to work

However, framerates are far better, and this is a massive improvement over trying to run the Windows version via Wine.

@mariiaan
Copy link
Owner

mariiaan commented May 8, 2024

Yeah there are some oddities.
I tried running it on ubuntu/built in terminal and it did so with a framerate of ~25FPS (virtualized).
I also tried with many different console emulators but there were no changes.
However, when I ran it on my hosts arch, it actually ran in the desired Framerate (even (capped) up to 120FPS). I thought this was odd and when I tried running it on a virtualized arch, it still did so fine. This probably confuses me the most. But in any cases, it still seems acceptable.

I am still yet to find the reason why the ANSI codes are not working, but that doesn't seem like a huge deal.

The thing with the ffmpeg crash is probably also due to my crappy implementation of an asynchronous video decoder. Back when I initally wrote this, it was my first time using ffmpeg as a library, so I'll fix that aswell.

Thanks for getting back to me and helping out this project!

@steve-1507
Copy link
Author

steve-1507 commented May 8, 2024 via email

@mariiaan
Copy link
Owner

mariiaan commented May 8, 2024

holy shit. I expected wine to have at least like 5 fps but it seems like it doesn't even have 0.25 fps. that's actually hilarious.
It seems like a big improvement running at the intended refresh rate of the video.
There still seems to be a lot of flickering involved.

About earlier, you mentioned dithering would not work. Have you tried text dithering with key 'T'?
Because that did work on my test system.

Thanks for sharing the videos!

@steve-1507
Copy link
Author

steve-1507 commented May 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants