Skip to content

Commit

Permalink
small_bugfix (#255)
Browse files Browse the repository at this point in the history
- ***Breaking changes***: requires `Glow Worm Luciferin` firmware (v5.18.2).   
- The priority of UDP packets in wireless mode has been increased to signal to the router that Luciferin traffic requires lower latency than standard packets.
- If the microcontroller is temporarily disconnected from the WiFi network, Firefly Luciferin is now able to reconnect much faster without restarting the screen capture.
- Added a 'bottom' capture option for [satellites](https://github.com/sblantipodi/firefly_luciferin/wiki/Surround-lighting-with-satellites) when the LEDs are configured to use a bottom gap.
- The [save state](https://github.com/sblantipodi/firefly_luciferin/wiki/Remote-Access#luciferin-web-interface) has been restructured. Auto-save has been disabled to prevent wear on the microcontroller's memory. Closes [#249](#249).
- Arch Linux package. Note: AUR package is built from the official sources but it's currently maintained by @Ape. Closes [#246](#246). Thanks @Ape for this.
- Libasound2t64 dependency prevents correct installation on some Linux distros. Closes [#253](#253).
- Properly handle expired restore token on Wayland. Closes [#259](#259). Thanks @Ape for the PR.
- Logging improvements. Closes [#260](#260). Thanks @Ape for the PR.
- Proper config path on Linux. Config file and logs has been moved in XDG_CONFIG_HOME (~/.config/FireflyLuciferin). Old config files will be automatically moved to the new path. Closes [#261](#261). 
- The snap version was crashing at startup when there were temporary files created by other instances of Firefly Luciferin on the system. Fixed.
  • Loading branch information
sblantipodi authored Jan 4, 2025
1 parent 2f8571e commit 2786dcc
Show file tree
Hide file tree
Showing 129 changed files with 402 additions and 255 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ body:
attributes:
label: Fiefly Luciferin config file
description: Please copy and paste your Firefly Luciferin config file.
placeholder: You can find your config file in ~Documents\FireflyLuciferin\FireflyLuciferin.yaml file. Please remove your MQTT password if you don't want to share it
placeholder: You can find your config file in ~(Documents or .config)\FireflyLuciferin\FireflyLuciferin.yaml file. Please remove your MQTT password if you don't want to share it
render: shell
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks
placeholder: You can find your logs in your ~Documents\FireflyLuciferin\logs folder
placeholder: You can find your logs in your ~(Documents or .config)\FireflyLuciferin\logs folder
render: shell
- type: textarea
id: steps-reproduce
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
path: FireflyLuciferinSetup.exe

linux_build_parallel:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -105,6 +105,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv firefly* FireflyLuciferinLinux.deb;
- name: Deps fix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
dpkg-deb -R FireflyLuciferinLinux.deb firetoedit
sed -i 's/libasound2t64/libasound2/g' "firetoedit/DEBIAN/control"
sed -i 's/Unknown/[email protected]/g' "firetoedit/DEBIAN/control"
dpkg-deb -b firetoedit FireflyLuciferinLinux.deb
cat firetoedit/DEBIAN/control
rm -rf firetoedit
- name: Creating artifact from BIN file
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-24.04' }}
permissions:
# required for all workflows
security-events: write
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
create_draft_release:
env:
commitmsg: ${{ github.event.head_commit.message }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set env
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:

linux_build_parallel:
needs: [create_draft_release]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set env
Expand Down Expand Up @@ -130,6 +130,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv firefly* FireflyLuciferinLinux.deb;
dpkg-deb -R FireflyLuciferinLinux.deb firetoedit
sed -i 's/libasound2t64/libasound2/g' "firetoedit/DEBIAN/control"
sed -i 's/Unknown/[email protected]/g' "firetoedit/DEBIAN/control"
dpkg-deb -b firetoedit FireflyLuciferinLinux.deb
cat firetoedit/DEBIAN/control
rm -rf firetoedit
gh release upload "${{ env.RELEASE_VERSION }}" FireflyLuciferinLinux.deb
- name: Adding Linux asset to the release (RedHat flavour)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@main
with:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ If you like **Firefly Luciferin**, give it a star, or fork it and contribute!
- Have a question? [**Get answered on the community**](https://discord.gg/aXf9jeN).

## Quick start
You can build the software from the source or if you prefer you can **download the installer from [here](https://github.com/sblantipodi/firefly_luciferin/releases)**.
`Firefly Luciferin` uses `Java 14` to create the native installer, this means that you don't have to install Java or other libraries separately.

You can **download the installer for Windows or Linux [here](https://github.com/sblantipodi/firefly_luciferin/releases)
**.
The Linux version is also available on [Flathub](https://flathub.org/apps/org.dpsoftware.FireflyLuciferin)
and [Snap Store](https://github.com/sblantipodi/firefly_luciferin/issues/207)

This software can run on any Desktop PC using **Windows or Linux**. MacOS support will be added later.
To get the full `Bias Lighting` experience you need a microcontroller (ex. ESP8266, ESP32) running [Glow Worm Luciferin](https://github.com/sblantipodi/glow_worm_luciferin) firmware. You can connect the microcontroller to the PC via USB or via wirelss (MQTT server is optional).
Expand Down
56 changes: 26 additions & 30 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,32 @@ a {

### In this release

- ***Breaking changes***: requires `Glow Worm Luciferin` firmware (v5.18.2).
- The priority of UDP packets in wireless mode has been increased to signal to the router that Luciferin traffic
requires lower latency than standard packets.
- If the microcontroller is temporarily disconnected from the WiFi network, Firefly Luciferin is now able to reconnect
much faster without restarting the screen capture.
- Added a 'bottom' capture option
for [satellites](https://github.com/sblantipodi/firefly_luciferin/wiki/Surround-lighting-with-satellites) when the
LEDs are configured to use a bottom gap.
- The [save state](https://github.com/sblantipodi/firefly_luciferin/wiki/Remote-Access#luciferin-web-interface) has been
restructured. Auto-save has been disabled to prevent wear on the microcontroller's memory.
Closes [#249](https://github.com/sblantipodi/firefly_luciferin/issues/249).
- Arch Linux package. Note: AUR package is built from the official sources but it's currently maintained by @Ape.
Closes [#246](https://github.com/sblantipodi/firefly_luciferin/issues/246). Thanks @Ape for this.
- Libasound2t64 dependency prevents correct installation on some Linux distros.
Closes [#253](https://github.com/sblantipodi/firefly_luciferin/issues/253).
- Properly handle expired restore token on Wayland.
Closes [#259](https://github.com/sblantipodi/firefly_luciferin/issues/259). Thanks @Ape for the PR.
- Logging improvements. Closes [#260](https://github.com/sblantipodi/firefly_luciferin/pull/260). Thanks @Ape for the
PR.
- Proper config path on Linux. Config file and logs has been moved in XDG_CONFIG_HOME (~/.config/FireflyLuciferin). Old
config files will be automatically moved to the new path.
Closes [#261](https://github.com/sblantipodi/firefly_luciferin/pull/261).
- The snap version was crashing at startup when there were temporary files created by other instances of Firefly Luciferin on the system. Fixed.

### In the previous releases:

- ***Breaking changes***: requires `Glow Worm Luciferin` firmware (v5.17.8).
- **Capture pipeline has been optimized for DX12 on Windows.** Previously, under heavy GPU load, capture framerates would drop significantly, causing occasional LED stuttering. Now, the pipeline has been restructured to better utilize hardware resources, completely eliminating stuttering. This change, along with the previous SIMD extension released with the previous version of Firefly Luciferin, makes Luciferin one of the most optimized and fastest software for bias lighting available at the moment.
- **New effects and improvements to the existing ones.**
Expand All @@ -46,34 +72,4 @@ a {
- Linux Wayland didn't ask you which screen to record when the recording permission expired. Fixed.
- [Power saving](https://github.com/sblantipodi/firefly_luciferin/wiki/Power-saving-features) mode is not interrupted by small changes on the screen like icons changing state in the system tray or incoming notifications.

### In the previous releases:

- ***Breaking changes***: requires `Glow Worm Luciferin` firmware (v5.16.7).
- **Luciferin now has specific support for [AVX CPU extensions](https://github.com/sblantipodi/firefly_luciferin/wiki/Very-fast-capture#cpu-acceleration-using-avx-simd-extensions).**
AMD and Intel are investing a lot of resources in improving their CPU extensions. Next-generation CPUs contain various
optimizations related to `Advanced Vector Extensions (AVX)` which are `Single Instruction, Multiple Data (SIMD)`
extensions to the x86 instruction set architecture for microprocessors.
AVX 512 and AVX 256 offer significant performance improvements and resource optimization benefits.
- USB/Serial communication has been redesigned:
- Improved USB device recognition under Linux.
- Serial devices may cause an infinite loop due to buggy COM port enumeration. Fixed.
- [Tray icon](https://github.com/sblantipodi/firefly_luciferin/wiki/Tray-icon-shortcuts) has been improved with new
shortcuts.
- Added a workaround for an existing Windows issue that causes tray menu to stay behind the
taskbar. [Closes #229](https://github.com/sblantipodi/firefly_luciferin/issues/229).
- Fixed an issue that prevented Firefly Luciferin from detecting Glow Worm Luciferin devices when the computer was
connected to a VPN.
- Firefly Luciferin infinitely starts itself after PC standby / wake
up. [Closes #228](https://github.com/sblantipodi/firefly_luciferin/issues/228).
- There are microcontrollers that has built/in LED. This LED can stay on and be annoying, it now follows
the [device reset](https://github.com/sblantipodi/firefly_luciferin/wiki/Device-reset) behaviour.
- Fixed an issue that prevented Linux version to show the UI
when [debug level](https://github.com/sblantipodi/firefly_luciferin/wiki/Debug) is set to DEBUG.
- Fixed an issue that prevented Hyprland to show the UI.
- Fixed an issue that caused incorrect color reproduction on non-standard screen resolutions.
- Fixed an issue that prevented the Glow Worm Luciferin Light Firmware from properly turning off the LED strip when
closing Firefly Luciferin.
- Java/JavaFX 23, libs update, code refactor to avoid using deprecated methods, CI/CD pipeline improvements.
- [Arduino Bootstrapper](https://github.com/sblantipodi/arduino_bootstrapper/releases) update (v.1.18.2).

[Click here for the complete changelog of previous versions.](https://github.com/sblantipodi/firefly_luciferin/releases)
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<jackson.version>2.18.2</jackson.version>
<lombok.version>1.18.36</lombok.version>
<mapstruct.version>1.6.3</mapstruct.version>
<jna.version>5.15.0</jna.version>
<jna.version>5.16.0</jna.version>
<gstreamer.version>1.4.0</gstreamer.version>
<paho.version>1.2.5</paho.version>
<logback.version>1.5.12</logback.version>
<logback.version>1.5.15</logback.version>
<slf4j.version>2.0.16</slf4j.version>
<xtaudio.version>2.0</xtaudio.version>
<dbus.java.version>5.1.0</dbus.java.version>
Expand Down
60 changes: 39 additions & 21 deletions src/main/java/org/dpsoftware/FireflyLuciferin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -68,7 +68,6 @@
@Getter
public class FireflyLuciferin extends Application {

// Image processing
private final ImageProcessor imageProcessor;
private final GrabberManager grabberManager;
private final PowerSavingManager powerSavingManager;
Expand Down Expand Up @@ -181,15 +180,9 @@ public static void main(String[] args) {
}
moveToStandardDocsFolder();
if (args != null && args.length > 0) {
log.info("Starting instance #: {}", args[0]);
if (args.length > 1) {
log.info("Profile to use: {}", args[1]);
}
MainSingleton.getInstance().whoAmI = Integer.parseInt(args[0]);
MainSingleton.getInstance().spawnInstances = false;
CommonUtility.sleepMilliseconds(Constants.SPAWN_INSTANCE_WAIT_START_DELAY);
} else {
log.info("Starting default instance");
}
MainSingleton.getInstance().profileArgs = Constants.DEFAULT;
if (args != null && args.length > 1) {
Expand All @@ -206,18 +199,16 @@ public static void main(String[] args) {
*/
static void moveToStandardDocsFolder() {
String path = InstanceConfigurer.getConfigPath();
if (NativeExecutor.isWindows()) {
String oldDocPath = InstanceConfigurer.getStandardConfigPath();
File newDirWithConfigFile = new File(path + File.separator + Constants.CONFIG_FILENAME);
File oldDir = new File(oldDocPath);
if (newDirWithConfigFile.exists() && oldDir.exists() && !path.equals(oldDocPath)) {
if (oldDir.exists()) StorageManager.deleteDirectory(oldDir);
log.info("Deleting old config file");
}
if (oldDir.exists() && !newDirWithConfigFile.exists() && !path.equals(oldDocPath)) {
StorageManager.copyDir(oldDocPath, path);
NativeExecutor.restartNativeInstance();
}
String oldDocPath = InstanceConfigurer.getOldConfigPath();
File newDirWithConfigFile = new File(path + File.separator + Constants.CONFIG_FILENAME);
File oldDir = new File(oldDocPath);
if (newDirWithConfigFile.exists() && oldDir.exists() && !path.equals(oldDocPath)) {
if (oldDir.exists()) StorageManager.deleteDirectory(oldDir);
log.info("Deleting old config file");
}
if (oldDir.exists() && !newDirWithConfigFile.exists() && !path.equals(oldDocPath)) {
StorageManager.copyDir(oldDocPath, path);
NativeExecutor.restartNativeInstance();
}
}

Expand Down Expand Up @@ -245,8 +236,17 @@ public static void checkForNightMode() {
*/
private void setRuntimeLogLevel() {
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
log.info("** Log level -> {} **", MainSingleton.getInstance().config.getRuntimeLogLevel());
log.debug("** Log level -> {} **", MainSingleton.getInstance().config.getRuntimeLogLevel());
loggerContext.getLogger(Constants.LOG_LEVEL_ROOT).setLevel(Level.toLevel(MainSingleton.getInstance().config.getRuntimeLogLevel()));
if (JavaFXStarter.startupArgs != null && JavaFXStarter.startupArgs.length > 0) {
log.info("Starting instance #: {}", JavaFXStarter.startupArgs[0]);
if (JavaFXStarter.startupArgs.length > 1) {
log.info("Profile to use: {}", JavaFXStarter.startupArgs[1]);
}
} else {
log.info("Starting default instance");
}
logEnvironment();
}

/**
Expand Down Expand Up @@ -605,4 +605,22 @@ private void clean() {
}
}

/**
* Log the environment in use
*/
private void logEnvironment() {
if (NativeExecutor.isLinux()) {
if (NativeExecutor.isFlatpak()) {
log.debug("Running on Linux using Flatpak sandbox");
} else if (NativeExecutor.isSnap()) {
log.debug("Running on Linux using Snap sandbox");
} else {
log.debug("Running on Linux");
}
} else if (NativeExecutor.isWindows()) {
log.debug("Running on Windows");
}
log.info("Traffic Class for the UDP socket: 0x{}", Integer.toHexString(MainSingleton.getInstance().config.getUdpTrafficClass()).toUpperCase());
}

}
5 changes: 4 additions & 1 deletion src/main/java/org/dpsoftware/JavaFXStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -35,12 +35,15 @@
*/
public class JavaFXStarter {

static String[] startupArgs = null;

/**
* Let's play!
*
* @param args args[0] contains the child number [1,2,3] to spawn, args[1] contains the profile to use
*/
public static void main(String... args) {
startupArgs = args;
// Don't log in this class, log is not initialized yet.
System.setProperty(Constants.LUCIFERIN_PLACEHOLDER, InstanceConfigurer.getConfigPath());
FireflyLuciferin.main(Objects.requireNonNull(args));
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/org/dpsoftware/LEDCoordinate.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -77,12 +77,6 @@ public static getStartEndLeds getGetStartEndLeds(Satellite sat) {
start = 1;
end = MainSingleton.getInstance().ledNumber;
} else {
// If bottom row is splitted and sat uses BOTTOM zone force to BOTTOM_LEFT
if (CommonUtility.isSplitBottomRow(MainSingleton.getInstance().config.getSplitBottomMargin())) {
if (sat.getZone().equals(Enums.SatelliteZone.BOTTOM.getBaseI18n())) {
sat.setZone(Enums.SatelliteZone.BOTTOM_LEFT.getBaseI18n());
}
}
String correctedColor = sat.getZone();
if (sat.getZone().equals(Enums.SatelliteZone.TOP_RIGHT.getBaseI18n()) || sat.getZone().equals(Enums.SatelliteZone.TOP_LEFT.getBaseI18n())) {
correctedColor = Enums.SatelliteZone.TOP.getBaseI18n();
Expand All @@ -93,7 +87,8 @@ public static getStartEndLeds getGetStartEndLeds(Satellite sat) {
}
}
String finalCorrectedColor = correctedColor;
List<Integer> filteredList = ledMatrix.entrySet().stream()
List<Integer> filteredList;
filteredList = ledMatrix.entrySet().stream()
.filter(e -> e.getValue().getZone().equals(finalCorrectedColor))
.map(Map.Entry::getKey)
.toList();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dpsoftware/MainSingleton.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dpsoftware/NativeExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dpsoftware/audio/AudioLoopback.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright © 2020 - 2024 Davide Perini (https://github.com/sblantipodi)
Copyright © 2020 - 2025 Davide Perini (https://github.com/sblantipodi)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 2786dcc

Please sign in to comment.