29 Commits
Author SHA1 Message Date
kalarina 5561754a71 Release 1.0.13 2026-11-07 16:29:40 +02:00
kalarina f84df8b21e Reconnect the media controller after it disconnects 2026-11-07 16:28:01 +02:00
kalarina 197ac2784c Make stream reconnects reliable and create audio effects off the main thread
- Hold a wake lock and Wi-Fi lock while a reconnect is pending so the backoff
  does not stall with the screen off
- Raise the rebuffer threshold to 2.5 s to stop play-stall stutter on weak networks
- Reconnect at once when the default network changes during a stall
- Give up quickly on errors that will not recover (4xx, unsupported format)
- Build audio effects on a background thread to keep startup smooth
2026-11-07 16:28:01 +02:00
kalarina 237be98cf0 Cache equalizer state instead of querying audioserver on every slider move 2026-11-07 16:28:01 +02:00
kalarina 91e5467d11 Add GitHub issue and pull request templates 2026-11-05 18:44:16 +02:00
kalarina d9b12c9899 Update store and README screenshots 2026-11-03 15:56:01 +02:00
kalarina 9efb12a25f Release 1.0.12 with only the WebP interface icons on top of 1.0.11 2026-11-03 15:36:07 +02:00
kalarina 52af3a7f4c Fix station artwork resource loading in player 2026-11-03 14:45:05 +02:00
kalarina ae47b574c1 Load player artwork the same way as the station list 2026-11-03 14:09:24 +02:00
kalarina 8e815865da Load station logos the way 1.0.11 did 2026-11-03 13:53:36 +02:00
kalarina 50ac9f9886 Decode station logos directly at full size 2026-11-03 13:47:51 +02:00
kalarina fa2fda44d1 Release 1.0.12
- Load preferences and all station logos off the main thread
- Keep equalizer updates and player animations from recomposing whole screens
- Build the Android Auto browse tree once and serve it from memory
- Create only the audio and metadata renderers, ship only the app's languages
- Store interface icons as lossless WebP, drop unused code and dependencies
2026-11-03 12:42:31 +02:00
kalarina 6a819880e2 Use GPL-3.0-only license wording 2026-10-21 14:50:40 +00:00
kalarina 5fe3a0af0b Make star request platform-neutral 2026-10-20 13:01:12 +00:00
kalarina ac64478773 Add star request to README 2026-10-20 12:59:10 +00:00
kalarina 62df72f9b8 Point Obtainium links to Gitea 2026-10-16 11:59:21 +00:00
kalarina 1eae2c8493 Redesign README: store badges, release badge, install options 2026-10-16 11:50:50 +00:00
kalarina 440fbec8e3 Upload files to "assets" 2026-10-16 11:42:48 +00:00
kalarina 61fa65b080 Upload files to "assets" 2026-10-16 11:40:58 +00:00
kalarina 5bd0d96a92 Update store descriptions in six languages 2026-10-13 14:54:45 +00:00
kalarina e4a36b6cfa Remove duplicate account note from CONTRIBUTING 2026-10-12 13:37:27 +00:00
kalarina 4454a422bb Update README 2026-10-12 13:34:09 +00:00
kalarina 2900470e90 Use Gitea as the only contribution channel 2026-10-11 14:10:44 +00:00
kalarina f86d8cc70d Add contributing guide and issue/PR templates 2026-10-11 14:01:06 +00:00
kalarina 6485a51249 Restructure README 2026-10-11 13:46:30 +00:00
kalarina 1b52c5dbab Add minimum Android version to README 2026-10-11 13:41:01 +00:00
kalarina 7482217528 Remove fdroid recipe, state GPL-3.0-only, format key fingerprint
The build recipe now lives in fdroiddata, so the outdated copy in
fdroid/ is removed. README states the license as GPL-3.0-only to
match the F-Droid metadata and shows the signing certificate
fingerprint in colon-separated form.
2026-10-10 15:28:54 +00:00
kalarina e3aa92d346 Remove CHANGELOG.md and verify downloads by signing key
CHANGELOG.md was out of date (stopped at v1.0.10 under the old
Fogwawe name), so it is removed. README now tells users to verify
the APK signing certificate instead of per-file checksums and fixes
the APK file name in the adb example.
2026-10-10 15:17:26 +00:00
kalarinaandClaude Opus 5.5 be11ae190d Store all text files with LF line endings
Adds a catch-all "* text=auto eol=lf" rule so a Windows clone keeps
LF in assets and resources and release APKs built on Windows match
F-Droid's Linux build. Existing rules for gradlew, batch files and
binaries are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K8GS1YNyjzkkhpGz368nGD
2026-10-10 14:04:07 +00:00
114 changed files with 612 additions and 254 deletions
+1
View File
@@ -1,3 +1,4 @@
* text=auto eol=lf
gradlew text eol=lf gradlew text eol=lf
*.bat text eol=crlf *.bat text eol=crlf
*.jar binary *.jar binary
+27
View File
@@ -0,0 +1,27 @@
---
name: Bug report
about: Something doesn't work as expected
title: "[Bug] "
---
**What happened**
**Steps to reproduce**
1.
2.
3.
**What you expected**
**Environment**
- App version:
- Installed from: Gitea / F-Droid / Google Play
- Device and Android version:
- Station (if related):
**Screenshots or logs** (optional)
+18
View File
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea that fits the app
title: "[Feature] "
---
<!-- Please check the "Out of scope" list in CONTRIBUTING.md before opening this. -->
**What problem does this solve**
**Proposed solution**
**Alternatives you considered**
- [ ] I'd like to implement this myself
+15
View File
@@ -0,0 +1,15 @@
---
name: Station request
about: Suggest a Lithuanian radio station
title: "[Station] "
---
<!-- Only Lithuanian stations with an official public stream are accepted. -->
- Station name:
- Official website:
- Stream URL:
- Genre:
- [ ] The station is Lithuanian
- [ ] The stream is official and public
+12
View File
@@ -0,0 +1,12 @@
---
name: Translation fix
about: Report a wrong or awkward translation
title: "[Translation] "
---
<!-- Supported languages: English, Russian, German, Japanese, Lithuanian, Chinese. New languages are not accepted. -->
- Language:
- Screen or place in the app:
- Current text:
- Suggested text:
+16
View File
@@ -0,0 +1,16 @@
## What does this change
## Related issue
Closes #
## Checklist
- [ ] Discussed in an issue first (not needed for small fixes)
- [ ] `./gradlew assembleDebug` builds
- [ ] Tested on a device or emulator (Android version: )
- [ ] No ads, analytics, trackers or Google Play Services / Firebase dependencies
- [ ] New strings added to `values/strings.xml` (missing translations noted below)
- [ ] Screenshots added for UI changes
- [ ] I agree that my contribution is licensed under GPL-3.0-only
+27
View File
@@ -0,0 +1,27 @@
---
name: Bug report
about: Something doesn't work as expected
title: "[Bug] "
---
**What happened**
**Steps to reproduce**
1.
2.
3.
**What you expected**
**Environment**
- App version:
- Installed from: Gitea / GitHub / F-Droid / Google Play
- Device and Android version:
- Station (if related):
**Screenshots or logs** (optional)
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Main repository on git.skysparkle.cc
url: https://git.skysparkle.cc/kalarina/Fogwave
about: This GitHub repository is a mirror. Issues are welcome here and on Gitea.
+18
View File
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea that fits the app
title: "[Feature] "
---
<!-- Please check the "Out of scope" list in CONTRIBUTING.md before opening this. -->
**What problem does this solve**
**Proposed solution**
**Alternatives you considered**
- [ ] I'd like to implement this myself
+15
View File
@@ -0,0 +1,15 @@
---
name: Station request
about: Suggest a Lithuanian radio station
title: "[Station] "
---
<!-- Only Lithuanian stations with an official public stream are accepted. -->
- Station name:
- Official website:
- Stream URL:
- Genre:
- [ ] The station is Lithuanian
- [ ] The stream is official and public
+12
View File
@@ -0,0 +1,12 @@
---
name: Translation fix
about: Report a wrong or awkward translation
title: "[Translation] "
---
<!-- Supported languages: English, Russian, German, Japanese, Lithuanian, Chinese. New languages are not accepted. -->
- Language:
- Screen or place in the app:
- Current text:
- Suggested text:
+16
View File
@@ -0,0 +1,16 @@
## What does this change
## Related issue
Closes #
## Checklist
- [ ] Discussed in an issue first (not needed for small fixes)
- [ ] `./gradlew assembleDebug` builds
- [ ] Tested on a device or emulator (Android version: )
- [ ] No ads, analytics, trackers or Google Play Services / Firebase dependencies
- [ ] New strings added to `values/strings.xml` (missing translations noted below)
- [ ] Screenshots added for UI changes
- [ ] I agree that my contribution is licensed under GPL-3.0-only
-17
View File
@@ -1,17 +0,0 @@
# Changelog
All notable builds of Fogwave are tracked here. None of these builds have a recoverable build timestamp (reproducible Android builds normalize internal file dates), so versions are numbered in the order they were provided; `v1.0.10` is the current, official latest build.
| Version | APK | Size | SHA-256 |
|---|---|---|---|
| v1.0.10 | [`Fogwawe-v1.0.10.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.10/Fogwawe-v1.0.10.apk) | 2.90 MB | `0e5d8daa71b3b3224192e8d8fc9687bcf4d28c62269c698d0921a2c9a44ed89d` |
| v1.0.9 | [`Fogwawe-v1.0.9.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.9/Fogwawe-v1.0.9.apk) | 2.85 MB | `dc0e96e13a322b702d673e1c1a0a44c5db6fbb7ac49de69fe60a48d3005fad9b` |
| v1.0.8 | [`Fogwawe-v1.0.8.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.8/Fogwawe-v1.0.8.apk) | 2.85 MB | `1baca54152ae1fc46f6b6894f798f3eff3f122fdadb22b22a604c90ae457c840` |
| v1.0.7 | [`Fogwawe-v1.0.7.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.7/Fogwawe-v1.0.7.apk) | 4.09 MB | `8f6dea613968f3c11bc8ea345b2fc62c79d34fc14129bec2757a00065b17f545` |
| v1.0.6 | [`Fogwawe-v1.0.6.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.6/Fogwawe-v1.0.6.apk) | 17.62 MB | `f1fd8479d9996bace2ca91c134ce4a0b835ba76ce69fddad4a3a440a7c137812` |
| v1.0.5 | [`Fogwawe-v1.0.5.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.5/Fogwawe-v1.0.5.apk) | 2.60 MB | `b3a567c32f3090e7ab91990ef0adf77d5c478cd136814092c81ca93cb044e47c` |
| v1.0.4 | [`Fogwawe-v1.0.4.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.4/Fogwawe-v1.0.4.apk) | 2.58 MB | `267c6c86bfa2ec521ab9a926bd3dbf97e69c8591e6d0548e9d59c6278ab8c77d` |
| v1.0.3 | [`Fogwawe-v1.0.3.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.3/Fogwawe-v1.0.3.apk) | 2.60 MB | `a011d962890a25f173593d0920b02ffa8ead38853c7dc8102c7eb976f7248461` |
| v1.0.2 | [`Fogwawe-v1.0.2.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.2/Fogwawe-v1.0.2.apk) | 2.60 MB | `152b09794e235e81d3421a0f20437d01608c776b180442cdaf57cd958c60c0b3` |
| v1.0.1 | [`Fogwawe-v1.0.1.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.1/Fogwawe-v1.0.1.apk) | 2.85 MB | `964979e2f60f7f5369f57c5b5d636563f9be0bae0128bbe318a00eaac8ea13c7` |
| v1.0.0 | [`Fogwawe-v1.0.0.apk`](https://github.com/kalarina-bit/Fogwave/releases/download/v1.0.0/Fogwawe-v1.0.0.apk) | 2.83 MB | `9a3fc4a45326315303f636535d9e88790bf72d244a5ffc54648c1b8d1132616d` |
+65
View File
@@ -0,0 +1,65 @@
# Contributing to Fogwave
Thanks for wanting to help! This guide explains where to contribute, what fits the project and how to send changes.
## Where to contribute
Issues and pull requests go to the repository on [Gitea](https://git.skysparkle.cc/kalarina/Fogwave).
## Ways to help
- **Report a bug** — use the *Bug report* template.
- **Suggest a station** — use the *Station request* template.
- **Suggest a feature** — use the *Feature request* template; check [Out of scope](#out-of-scope) first.
- **Fix a translation** — use the *Translation fix* template or send a pull request.
- **Write code** — see [Pull requests](#pull-requests).
## Before you start
- **Small changes** (typos, obvious bugs, translation fixes): send a pull request directly.
- **Anything bigger** (new features, UI changes, new dependencies): open an issue first and wait for a go-ahead, so your work isn't wasted.
## Ground rules
- No ads, analytics, trackers, crash reporters or accounts.
- No Google Play Services, Firebase or other proprietary libraries — the app must stay buildable for F-Droid.
- New dependencies must be open source and justified in the pull request.
- Be respectful in issues and reviews.
## Out of scope
These will not be accepted:
- Stations from outside Lithuania.
- A light theme or automatic light/dark switching — Fogwave is dark only.
- New UI languages (see [Translations](#translations)).
## Stations
A new station must be Lithuanian, have an official public stream (HTTP or HTTPS) and allow playback in third-party players. Include the official website and stream URL in the request.
## Translations
Fogwave is available in exactly six languages: English, Russian, German, Japanese, Lithuanian and Chinese. Fixes to these are welcome; new languages are not accepted.
- App strings: `app/src/main/res/values-<lang>/strings.xml` (English is `values/`).
- Store listing: `fastlane/metadata/android/<locale>/`.
If your code adds new strings, add them to `values/strings.xml`. Translations for the other languages are welcome but not required — mention missing ones in the pull request.
## Pull requests
1. Fork the repository and create a branch from `main`.
2. Keep one topic per pull request.
3. Follow the existing Kotlin and Jetpack Compose style; keep comments short and in English; don't reformat unrelated code.
4. Make sure `./gradlew assembleDebug` builds, and test on a device or emulator.
5. Write short, plain commit messages in English (for example `Fix crash when stream URL is empty`).
6. Add screenshots for UI changes.
## Security
Please don't post details of security issues publicly. Open a short issue titled "Security contact" without any details, and the maintainer will reach out privately.
## License
By contributing, you agree that your contribution is licensed under the [GNU General Public License v3.0 only](LICENSE), the same as the rest of the project.
+1 -2
View File
@@ -636,8 +636,7 @@ the "copyright" line and a pointer to where the full notice is found.
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, version 3 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
+46 -56
View File
@@ -1,99 +1,89 @@
<p align="center"> <p align="center">
<img src="assets/icon-rounded.png" width="128" alt="Fogwave icon"> <img src="assets/icon-rounded.png" width="112" alt="Fogwave icon">
</p> </p>
<h1 align="center">Fogwave</h1> <h1 align="center">Fogwave</h1>
<p align="center"> <p align="center">
<a href="https://git.skysparkle.cc/kalarina/Fogwave/releases"><img src="assets/get-it-on-gitea.png" height="60" alt="Get it on Gitea"></a> <b>A calm, open-source internet radio app for Android.</b><br>
Listen to Lithuania's favorite stations in one tap.
</p> </p>
<p align="center"> <p align="center">
<img src="https://img.shields.io/github/downloads/kalarina-bit/Fogwave/latest/total?label=downloads&color=2e7d32&labelColor=1b1b1b" alt="downloads counter"> <a href="https://github.com/kalarina-bit/Fogwave/releases/latest"><img src="https://img.shields.io/github/v/release/kalarina-bit/Fogwave?style=for-the-badge&label=release&labelColor=1b1b1b&color=2e7d32" alt="Latest release"></a>
</p> </p>
**A calm, open-source internet radio app for Android.** <p align="center">
<a href="https://f-droid.org/packages/cc.skysparkle.fogwave/"><img src="assets/get-it-on%20(1).png" height="56" alt="Get it on F-Droid"></a>
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Fogwave"><img src="assets/badge_obtainium.png" height="56" alt="Get it on Obtainium"></a>
<a href="https://github.com/kalarina-bit/Fogwave/releases/latest"><img src="assets/get-it-on-github.png" height="56" alt="Get it on GitHub"></a>
<a href="https://git.skysparkle.cc/kalarina/Fogwave/releases"><img src="assets/get-it-on-gitea.png" height="56" alt="Get it on Gitea"></a>
</p>
Listen to Lithuania's favorite stations in one tap — with background playback, a built-in equalizer, and a clean, distraction-free design. <p align="center">
<img src="assets/screenshots/1-lithuanian-radio-left.png" width="160" alt="Lithuanian radio, live"><img src="assets/screenshots/2-lithuanian-radio-right.png" width="160" alt="Station list">
<img src="assets/screenshots/3-favorites.png" width="160" alt="Save your favorites">
<img src="assets/screenshots/4-listen-live.png" width="160" alt="Listen live">
</p>
## Features > [!TIP]
> If you find Fogwave useful, please consider giving it a ⭐ — it helps others discover the project.
## ✨ Features
- 📻 **10 Lithuanian stations** — ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1, Gold FM and more - 📻 **10 Lithuanian stations** — ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1, Gold FM and more
- 🎧 **Background playback** with lock-screen, notification, headphone and Bluetooth controls - 🎧 **Background playback** with lock-screen, notification, headphone and Bluetooth controls
- 🚗 **Android Auto** support - 🚗 **Android Auto** support
- 🔄 **Auto-reconnect** when the stream drops or the network comes back - 🔄 **Auto-reconnect** when the stream drops or the network comes back
- 🎚️ **Equalizer** with presets, loudness boost and dynamics processing — settings are saved - 🎚️ **Equalizer** with presets, loudness boost and dynamics processing
- ❤️ **Favorites, recently played and similar stations** matched by genre - ❤️ **Favorites, recently played and similar stations** matched by genre
- 🗂️ **Four layouts** — list, table, tiles or icons, with adjustable size - 🗂️ **Four layouts** — list, table, tiles or icons, with adjustable size
- 🌙 **Clean, elegant UI** in a dark theme - 🌙 **Dark theme**
- 🌍 Available in English, Russian, German, Japanese, Lithuanian, and Chinese - 🌍 **Six languages** — English, Russian, German, Japanese, Lithuanian and Chinese
- 🔓 **100% open source** — no ads, no tracking, no accounts - 🔓 **No ads, no tracking, no accounts**
## Screenshots ## <img src="assets/icon-install.png" width="32" alt=""> Installation
<p align="center"> - **[F-Droid](https://f-droid.org/packages/cc.skysparkle.fogwave/)** — install and update through the F-Droid client.
<img src="assets/screenshots/5-feel-closer.png" width="200" alt="Feel closer to Lithuania"> - **[Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Fogwave)** — installs the APK straight from Gitea releases and keeps it up to date.
<img src="assets/screenshots/4-stations.png" width="200" alt="Browse all stations"> - **Manually** — download the latest APK from [GitHub](https://github.com/kalarina-bit/Fogwave/releases/latest) or [Gitea](https://git.skysparkle.cc/kalarina/Fogwave/releases), allow installs from unknown sources for the app you open it with (Settings → Apps → Special access → Install unknown apps), then open the `.apk` and confirm.
<img src="assets/screenshots/1-find-station.png" width="200" alt="Find a station, then settle in">
<img src="assets/screenshots/2-your-style.png" width="200" alt="Just your style">
<img src="assets/screenshots/3-soundtrack.png" width="200" alt="Your soundtrack">
</p>
## Installation ## <img src="assets/icon-verify.png" width="32" alt=""> Verifying a download
<img src="assets/icon-install.png" width="36" align="left"> Every official APK is signed with the same key. Check it before installing:
1. Download the APK for the version you want from the [Releases page](https://github.com/kalarina-bit/Fogwave/releases).
2. On your Android device, allow installs from unknown sources for the app you use to open the file (Settings → Apps → Special access → Install unknown apps).
3. Open the downloaded `.apk` file and confirm the install.
Or via `adb` (after downloading):
```sh ```sh
adb install Fogwawe-v1.0.10.apk apksigner verify --print-certs Fogwave-v<version>.apk
``` ```
## Verifying a download The SHA-256 fingerprint of the signing certificate must be:
<img src="assets/icon-verify.png" width="36" align="left"> ```
1A:85:AF:5A:08:23:DE:D1:76:7C:07:55:41:FA:15:87:7F:6E:3B:99:9E:5E:52:CF:2B:C8:03:55:F6:63:12:7F
Compare the SHA-256 checksum against the value listed in [CHANGELOG.md](CHANGELOG.md):
```sh
sha256sum Fogwawe-v1.0.10.apk
``` ```
## Building from source `apksigner` prints the same value in lowercase without colons. On Android you can check it with [AppVerifier](https://github.com/soupslurpr/AppVerifier) (app ID `cc.skysparkle.fogwave`).
Requires JDK 17+ and Android Studio with Android SDK 37. ## <img src="assets/icon-structure.png" width="32" alt=""> Building from source
Requires JDK 17+ and Android SDK 37.
```sh ```sh
./gradlew assembleDebug ./gradlew assembleDebug
``` ```
Release builds are signed only when a keystore is supplied through the `KEYSTORE_PATH`, `STORE_PASSWORD`, `KEY_ALIAS` and `KEY_PASSWORD` environment variables. Without them the release build is unsigned, which is what F-Droid expects. Keystores are excluded by `.gitignore` — never commit them. Release builds are signed only when a keystore is supplied through the `KEYSTORE_PATH`, `STORE_PASSWORD`, `KEY_ALIAS` and `KEY_PASSWORD` environment variables; otherwise the release build is unsigned, as F-Droid expects. Never commit keystores.
For every release: bump `versionCode` and `versionName` in `app/build.gradle.kts`, add `fastlane/metadata/android/<locale>/changelogs/<versionCode>.txt`, and tag the commit as `v<versionName>` (for example `v1.0.11`). ### Releasing
## Repository structure 1. Bump `versionCode` and `versionName` in `app/build.gradle.kts`.
2. Add `fastlane/metadata/android/<locale>/changelogs/<versionCode>.txt`.
3. Tag the commit as `v<versionName>` (for example `v1.0.11`).
<img src="assets/icon-structure.png" width="36" align="left"> ## 🤝 Contributing
``` Bug reports, station suggestions, translation fixes and pull requests are welcome in the [issue tracker](https://git.skysparkle.cc/kalarina/Fogwave/issues). Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it explains what fits the project and how to send changes. To open an issue or a pull request, [create an account](https://git.skysparkle.cc/user/sign_up) on this Gitea.
.
├── app/ # Android app source (Kotlin, Jetpack Compose)
├── assets/ # README images and logos
│ └── screenshots/ # App screenshots
├── fastlane/ # F-Droid store listing, screenshots and changelogs
├── fdroid/ # Build recipe for fdroiddata
├── gradle/ # Gradle wrapper and version catalog
├── CHANGELOG.md # Per-version sizes and checksums (links to GitHub Releases)
├── LICENSE # GNU GPLv3
└── README.md
```
APK builds themselves are published as assets on the [Releases page](https://github.com/kalarina-bit/Fogwave/releases), not stored in this repository. ## 📄 License
## License [GNU General Public License v3.0 only](LICENSE).
This project is licensed under the **GNU General Public License v3.0** — see the [LICENSE](LICENSE) file for details.
+2 -2
View File
@@ -13,8 +13,8 @@ android {
applicationId = "cc.skysparkle.fogwave" applicationId = "cc.skysparkle.fogwave"
minSdk = 24 minSdk = 24
targetSdk = 36 targetSdk = 36
versionCode = 11 versionCode = 13
versionName = "1.0.11" versionName = "1.0.13"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -31,6 +31,8 @@ data class AudioEffectsState(
val dynamicsProcessingEnabled: Boolean = false val dynamicsProcessingEnabled: Boolean = false
) )
// Effect parameters are cached here: every getter on an AudioEffect is a call into audioserver,
// and the state is rebuilt on every frame while an equalizer slider is dragged.
class AudioEffectsEngine(context: Context, audioSessionId: Int) { class AudioEffectsEngine(context: Context, audioSessionId: Int) {
private val prefs: SharedPreferences = private val prefs: SharedPreferences =
context.applicationContext.getSharedPreferences("fogwave_audio_effects", Context.MODE_PRIVATE) context.applicationContext.getSharedPreferences("fogwave_audio_effects", Context.MODE_PRIVATE)
@@ -42,37 +44,53 @@ class AudioEffectsEngine(context: Context, audioSessionId: Int) {
private var loudnessEnhancer: LoudnessEnhancer? = null private var loudnessEnhancer: LoudnessEnhancer? = null
private var dynamicsProcessing: DynamicsProcessing? = null private var dynamicsProcessing: DynamicsProcessing? = null
private val presetNames = mutableListOf<String>() private var presetNames: List<String> = emptyList()
private var centerFreqsHz = IntArray(0)
private var bandLevels = IntArray(0)
private var minBandLevel = 0
private var maxBandLevel = 0
private var equalizerEnabled = prefs.getBoolean(KEY_EQ_ENABLED, false)
private var loudnessEnabled = prefs.getBoolean(KEY_LOUDNESS_ENABLED, false)
private var loudnessGain = prefs.getInt(KEY_LOUDNESS_GAIN, 0).coerceIn(0, MAX_LOUDNESS_GAIN)
private var dynamicsEnabled = prefs.getBoolean(KEY_DYNAMICS_ENABLED, false)
init { init {
try { try {
equalizer = Equalizer(0, audioSessionId).apply { equalizer = Equalizer(0, audioSessionId).apply {
for (p in 0 until numberOfPresets) { presetNames = (0 until numberOfPresets).map { getPresetName(it.toShort()) }
presetNames.add(getPresetName(p.toShort()))
} val bandCount = numberOfBands.toInt()
centerFreqsHz = IntArray(bandCount) { getCenterFreq(it.toShort()) / 1000 }
val range = bandLevelRange
minBandLevel = range[0].toInt()
maxBandLevel = range[1].toInt()
val preset = currentPresetIndex val preset = currentPresetIndex
if (preset in 0 until numberOfPresets) { if (preset in 0 until numberOfPresets) {
usePreset(preset.toShort()) usePreset(preset.toShort())
} else { } else {
for (b in 0 until numberOfBands) { for (b in 0 until bandCount) {
val saved = prefs.getInt(KEY_BAND_PREFIX + b, Int.MIN_VALUE) val saved = prefs.getInt(KEY_BAND_PREFIX + b, Int.MIN_VALUE)
if (saved != Int.MIN_VALUE) setBandLevel(b.toShort(), saved.toShort()) if (saved != Int.MIN_VALUE) setBandLevel(b.toShort(), saved.toShort())
} }
} }
enabled = prefs.getBoolean(KEY_EQ_ENABLED, false) bandLevels = IntArray(bandCount) { getBandLevel(it.toShort()).toInt() }
enabled = equalizerEnabled
} }
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "Equalizer unavailable", e) Log.e(TAG, "Equalizer unavailable", e)
equalizer = null
} }
try { try {
loudnessEnhancer = LoudnessEnhancer(audioSessionId).apply { loudnessEnhancer = LoudnessEnhancer(audioSessionId).apply {
setTargetGain(prefs.getInt(KEY_LOUDNESS_GAIN, 0)) setTargetGain(loudnessGain)
enabled = prefs.getBoolean(KEY_LOUDNESS_ENABLED, false) enabled = loudnessEnabled
} }
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "LoudnessEnhancer unavailable", e) Log.e(TAG, "LoudnessEnhancer unavailable", e)
loudnessEnhancer = null
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
@@ -134,94 +152,103 @@ class AudioEffectsEngine(context: Context, audioSessionId: Int) {
dp.setLimiterByChannelIndex(ch, limiter) dp.setLimiterByChannelIndex(ch, limiter)
} }
dp.enabled = prefs.getBoolean(KEY_DYNAMICS_ENABLED, false) dp.enabled = dynamicsEnabled
return dp return dp
} }
fun currentState(): AudioEffectsState { fun currentState(): AudioEffectsState {
val eq = equalizer val eqAvailable = equalizer != null
val bands = if (eq != null) { val bands = if (eqAvailable) {
(0 until eq.numberOfBands).map { i -> bandLevels.indices.map { i ->
val idx = i.toShort()
val range = eq.bandLevelRange
EqualizerBand( EqualizerBand(
index = i, index = i,
centerFreqHz = eq.getCenterFreq(idx) / 1000, centerFreqHz = centerFreqsHz[i],
levelMillibel = eq.getBandLevel(idx).toInt(), levelMillibel = bandLevels[i],
minLevelMillibel = range[0].toInt(), minLevelMillibel = minBandLevel,
maxLevelMillibel = range[1].toInt() maxLevelMillibel = maxBandLevel
) )
} }
} else emptyList() } else emptyList()
return AudioEffectsState( return AudioEffectsState(
equalizerAvailable = eq != null, equalizerAvailable = eqAvailable,
equalizerEnabled = eq?.enabled ?: false, equalizerEnabled = eqAvailable && equalizerEnabled,
bands = bands, bands = bands,
presets = presetNames, presets = presetNames,
currentPreset = if (eq != null) currentPresetIndex else -1, currentPreset = if (eqAvailable) currentPresetIndex else -1,
loudnessAvailable = loudnessEnhancer != null, loudnessAvailable = loudnessEnhancer != null,
loudnessEnabled = loudnessEnhancer?.enabled ?: false, loudnessEnabled = loudnessEnhancer != null && loudnessEnabled,
loudnessGainMillibel = try { loudnessGainMillibel = if (loudnessEnhancer != null) loudnessGain.toFloat() else 0f,
loudnessEnhancer?.targetGain ?: 0f
} catch (_: Exception) {
0f
},
dynamicsProcessingAvailable = dynamicsProcessing != null, dynamicsProcessingAvailable = dynamicsProcessing != null,
dynamicsProcessingEnabled = dynamicsProcessing?.enabled ?: false dynamicsProcessingEnabled = dynamicsProcessing != null && dynamicsEnabled
) )
} }
fun setEqualizerEnabled(enabled: Boolean) { fun setEqualizerEnabled(enabled: Boolean) {
val eq = equalizer ?: return
try { try {
equalizer?.enabled = enabled eq.enabled = enabled
equalizerEnabled = enabled
prefs.edit { putBoolean(KEY_EQ_ENABLED, enabled) } prefs.edit { putBoolean(KEY_EQ_ENABLED, enabled) }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
fun setBandLevel(band: Int, levelMillibel: Int) { fun setBandLevel(band: Int, levelMillibel: Int) {
val eq = equalizer ?: return
if (band !in bandLevels.indices) return
val level = levelMillibel.coerceIn(minBandLevel, maxBandLevel)
if (bandLevels[band] == level && currentPresetIndex == -1) return
try { try {
equalizer?.setBandLevel(band.toShort(), levelMillibel.toShort()) eq.setBandLevel(band.toShort(), level.toShort())
bandLevels[band] = level
currentPresetIndex = -1 currentPresetIndex = -1
prefs.edit { prefs.edit {
putInt(KEY_BAND_PREFIX + band, levelMillibel) putInt(KEY_BAND_PREFIX + band, level)
putInt(KEY_PRESET, -1) putInt(KEY_PRESET, -1)
} }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
fun setPreset(preset: Int) { fun setPreset(preset: Int) {
try {
val eq = equalizer ?: return val eq = equalizer ?: return
try {
eq.usePreset(preset.toShort()) eq.usePreset(preset.toShort())
currentPresetIndex = preset currentPresetIndex = preset
for (b in bandLevels.indices) {
bandLevels[b] = eq.getBandLevel(b.toShort()).toInt()
}
prefs.edit { prefs.edit {
putInt(KEY_PRESET, preset) putInt(KEY_PRESET, preset)
for (b in 0 until eq.numberOfBands) { for (b in bandLevels.indices) putInt(KEY_BAND_PREFIX + b, bandLevels[b])
putInt(KEY_BAND_PREFIX + b, eq.getBandLevel(b.toShort()).toInt())
}
} }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
fun setLoudnessEnabled(enabled: Boolean) { fun setLoudnessEnabled(enabled: Boolean) {
val le = loudnessEnhancer ?: return
try { try {
loudnessEnhancer?.enabled = enabled le.enabled = enabled
loudnessEnabled = enabled
prefs.edit { putBoolean(KEY_LOUDNESS_ENABLED, enabled) } prefs.edit { putBoolean(KEY_LOUDNESS_ENABLED, enabled) }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
fun setLoudnessGain(gainMillibel: Float) { fun setLoudnessGain(gainMillibel: Float) {
val le = loudnessEnhancer ?: return
val gain = gainMillibel.coerceIn(0f, MAX_LOUDNESS_GAIN.toFloat()).toInt()
if (gain == loudnessGain) return
try { try {
val gain = gainMillibel.coerceIn(0f, 2000f).toInt() le.setTargetGain(gain)
loudnessEnhancer?.setTargetGain(gain) loudnessGain = gain
prefs.edit { putInt(KEY_LOUDNESS_GAIN, gain) } prefs.edit { putInt(KEY_LOUDNESS_GAIN, gain) }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
fun setDynamicsProcessingEnabled(enabled: Boolean) { fun setDynamicsProcessingEnabled(enabled: Boolean) {
val dp = dynamicsProcessing ?: return
try { try {
dynamicsProcessing?.enabled = enabled dp.enabled = enabled
dynamicsEnabled = enabled
prefs.edit { putBoolean(KEY_DYNAMICS_ENABLED, enabled) } prefs.edit { putBoolean(KEY_DYNAMICS_ENABLED, enabled) }
} catch (_: Exception) {} } catch (_: Exception) {}
} }
@@ -237,6 +264,7 @@ class AudioEffectsEngine(context: Context, audioSessionId: Int) {
private companion object { private companion object {
const val TAG = "AudioEffectsEngine" const val TAG = "AudioEffectsEngine"
const val MAX_LOUDNESS_GAIN = 2000
const val KEY_EQ_ENABLED = "eq_enabled" const val KEY_EQ_ENABLED = "eq_enabled"
const val KEY_PRESET = "eq_preset" const val KEY_PRESET = "eq_preset"
const val KEY_BAND_PREFIX = "eq_band_" const val KEY_BAND_PREFIX = "eq_band_"
@@ -6,6 +6,10 @@ import android.content.Intent
import android.media.AudioManager import android.media.AudioManager
import android.net.ConnectivityManager import android.net.ConnectivityManager
import android.net.Network import android.net.Network
import android.net.wifi.WifiManager
import android.os.Handler
import android.os.Looper
import android.os.PowerManager
import android.os.SystemClock import android.os.SystemClock
import android.util.Log import android.util.Log
import androidx.annotation.OptIn import androidx.annotation.OptIn
@@ -17,6 +21,7 @@ import androidx.media3.common.PlaybackException
import androidx.media3.common.Player import androidx.media3.common.Player
import androidx.media3.common.util.UnstableApi import androidx.media3.common.util.UnstableApi
import androidx.media3.datasource.DefaultHttpDataSource import androidx.media3.datasource.DefaultHttpDataSource
import androidx.media3.datasource.HttpDataSource
import androidx.media3.exoplayer.DefaultLoadControl import androidx.media3.exoplayer.DefaultLoadControl
import androidx.media3.exoplayer.ExoPlayer import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory import androidx.media3.exoplayer.source.DefaultMediaSourceFactory
@@ -60,6 +65,15 @@ class FogwavePlaybackService : MediaLibraryService() {
private var connectivityManager: ConnectivityManager? = null private var connectivityManager: ConnectivityManager? = null
private var networkCallback: ConnectivityManager.NetworkCallback? = null private var networkCallback: ConnectivityManager.NetworkCallback? = null
private var defaultNetwork: Network? = null
// ExoPlayer drops its own wake and Wi-Fi locks once the player is idle after an error, so the
// backoff delay would stall while the CPU sleeps. These are held only while a reconnect is pending.
private var reconnectWakeLock: PowerManager.WakeLock? = null
private var reconnectWifiLock: WifiManager.WifiLock? = null
private val mainHandler = Handler(Looper.getMainLooper())
private var destroyed = false
private val httpDataSourceFactory: DefaultHttpDataSource.Factory by lazy { private val httpDataSourceFactory: DefaultHttpDataSource.Factory by lazy {
DefaultHttpDataSource.Factory() DefaultHttpDataSource.Factory()
@@ -71,7 +85,9 @@ class FogwavePlaybackService : MediaLibraryService() {
} }
private val loadControl = DefaultLoadControl.Builder() private val loadControl = DefaultLoadControl.Builder()
.setBufferDurationsMs(5_000, 15_000, 500, 1_000) // Quick start (0.5 s), but after a stall wait for 2.5 s of audio so a weak network does not
// turn into a play-stall-play stutter.
.setBufferDurationsMs(15_000, 50_000, 500, 2_500)
.setPrioritizeTimeOverSizeThresholds(true) .setPrioritizeTimeOverSizeThresholds(true)
.build() .build()
@@ -166,6 +182,7 @@ class FogwavePlaybackService : MediaLibraryService() {
if (retryAttempt != 0) Log.d(TAG, "Reconnect succeeded - resetting backoff") if (retryAttempt != 0) Log.d(TAG, "Reconnect succeeded - resetting backoff")
retryAttempt = 0 retryAttempt = 0
retryJob?.cancel() retryJob?.cancel()
releaseReconnectLocks()
} }
} }
@@ -179,6 +196,7 @@ class FogwavePlaybackService : MediaLibraryService() {
Log.d(TAG, "Reconnect cancelled - playWhenReady=false (reason=$reason)") Log.d(TAG, "Reconnect cancelled - playWhenReady=false (reason=$reason)")
} }
retryJob?.cancel() retryJob?.cancel()
releaseReconnectLocks()
pausedAtMs = SystemClock.elapsedRealtime() pausedAtMs = SystemClock.elapsedRealtime()
return return
} }
@@ -203,20 +221,39 @@ class FogwavePlaybackService : MediaLibraryService() {
"mediaItem=${lastRequestedItem?.localConfiguration?.uri}", "mediaItem=${lastRequestedItem?.localConfiguration?.uri}",
error error
) )
scheduleReconnect() scheduleReconnect(maxAttempts = maxRetryAttemptsFor(error))
} }
} }
private fun scheduleReconnect(immediate: Boolean = false) { // A missing stream or an unsupported format will not fix itself, so it gets only a couple of
// attempts (a stale token or a short server outage can still recover); network errors get the full backoff.
private fun maxRetryAttemptsFor(error: PlaybackException): Int {
val httpCode = (error.cause as? HttpDataSource.InvalidResponseCodeException)?.responseCode
val permanent = when (error.errorCode) {
PlaybackException.ERROR_CODE_IO_BAD_HTTP_STATUS ->
httpCode != null && httpCode in 400..499 && httpCode != 408 && httpCode != 429
PlaybackException.ERROR_CODE_IO_FILE_NOT_FOUND,
PlaybackException.ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED,
PlaybackException.ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED,
PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED,
PlaybackException.ERROR_CODE_DECODING_FORMAT_UNSUPPORTED -> true
else -> false
}
return if (permanent) MAX_PERMANENT_ERROR_RETRY_ATTEMPTS else MAX_RETRY_ATTEMPTS
}
private fun scheduleReconnect(immediate: Boolean = false, maxAttempts: Int = MAX_RETRY_ATTEMPTS) {
retryJob?.cancel() retryJob?.cancel()
if (!immediate && retryAttempt >= MAX_RETRY_ATTEMPTS) { if (!immediate && retryAttempt >= maxAttempts) {
// Give up instead of keeping the device busy forever; the error stays visible and a tap // Give up instead of keeping the device busy forever; the error stays visible and a tap
// on play starts over. // on play starts over.
Log.w(TAG, "Reconnect abandoned after $retryAttempt attempts") Log.w(TAG, "Reconnect abandoned after $retryAttempt attempts")
retryAttempt = 0 retryAttempt = 0
releaseReconnectLocks()
player.pause() player.pause()
return return
} }
acquireReconnectLocks()
val delayMs = if (immediate) 0L else retryDelaysMs.getOrElse(retryAttempt) { retryDelaysMs.last() } val delayMs = if (immediate) 0L else retryDelaysMs.getOrElse(retryAttempt) { retryDelaysMs.last() }
retryAttempt++ retryAttempt++
Log.d(TAG, "Reconnect scheduled in ${delayMs}ms (attempt=$retryAttempt)") Log.d(TAG, "Reconnect scheduled in ${delayMs}ms (attempt=$retryAttempt)")
@@ -224,6 +261,7 @@ class FogwavePlaybackService : MediaLibraryService() {
delay(delayMs) delay(delayMs)
if (!player.playWhenReady) { if (!player.playWhenReady) {
Log.d(TAG, "Reconnect skipped - no longer playWhenReady") Log.d(TAG, "Reconnect skipped - no longer playWhenReady")
releaseReconnectLocks()
return@launch return@launch
} }
restartStream() restartStream()
@@ -247,6 +285,34 @@ class FogwavePlaybackService : MediaLibraryService() {
} }
} }
@Suppress("DEPRECATION") // WIFI_MODE_FULL_HIGH_PERF is what ExoPlayer itself uses for streaming.
private fun acquireReconnectLocks() {
try {
if (reconnectWakeLock == null) {
val pm = getSystemService(Context.POWER_SERVICE) as? PowerManager
reconnectWakeLock = pm?.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Fogwave:reconnect")
?.apply { setReferenceCounted(false) }
}
// The timeout is a safety net; the lock is released as soon as the stream is back.
reconnectWakeLock?.acquire(RECONNECT_LOCK_TIMEOUT_MS)
if (reconnectWifiLock == null) {
val wm = applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
reconnectWifiLock = wm?.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Fogwave:reconnect")
?.apply { setReferenceCounted(false) }
}
val wifiLock = reconnectWifiLock
if (wifiLock != null && !wifiLock.isHeld) wifiLock.acquire()
} catch (e: Exception) {
Log.w(TAG, "Could not acquire reconnect locks", e)
}
}
private fun releaseReconnectLocks() {
try { reconnectWakeLock?.takeIf { it.isHeld }?.release() } catch (_: Exception) {}
try { reconnectWifiLock?.takeIf { it.isHeld }?.release() } catch (_: Exception) {}
}
private fun registerNetworkCallback() { private fun registerNetworkCallback() {
val cm = getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager ?: return val cm = getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager ?: return
connectivityManager = cm connectivityManager = cm
@@ -254,8 +320,15 @@ class FogwavePlaybackService : MediaLibraryService() {
// Called on a ConnectivityManager thread; ExoPlayer must only be accessed on the main thread. // Called on a ConnectivityManager thread; ExoPlayer must only be accessed on the main thread.
override fun onAvailable(network: Network) { override fun onAvailable(network: Network) {
serviceScope.launch { serviceScope.launch {
if (retryJob?.isActive == true && player.playWhenReady && player.playbackState != Player.STATE_READY) { val previous = defaultNetwork
Log.d(TAG, "Network available again - reconnecting immediately") defaultNetwork = network
if (!player.playWhenReady || player.playbackState == Player.STATE_READY) return@launch
// After a switch (e.g. Wi-Fi to mobile) a stalled load can sit on a dead socket until
// the read timeout, so reopen right away instead of waiting for the error.
val switchedWhileStalled = previous != null && previous != network &&
player.playbackState == Player.STATE_BUFFERING
if (retryJob?.isActive == true || switchedWhileStalled) {
Log.d(TAG, "Network available - reconnecting immediately")
scheduleReconnect(immediate = true) scheduleReconnect(immediate = true)
} }
} }
@@ -300,9 +373,7 @@ class FogwavePlaybackService : MediaLibraryService() {
} }
Log.d(TAG, "Audio session id for effects: ${player.audioSessionId}") Log.d(TAG, "Audio session id for effects: ${player.audioSessionId}")
audioEffectsEngine = AudioEffectsEngine(applicationContext, player.audioSessionId).also { createAudioEffectsAsync(player.audioSessionId)
AudioEffectsController.attach(it)
}
registerNetworkCallback() registerNetworkCallback()
@@ -319,6 +390,26 @@ class FogwavePlaybackService : MediaLibraryService() {
.build() .build()
} }
// Creating the effects means several calls into audioserver; done off the main thread so the
// service, which starts together with the UI, does not delay the first frames.
private fun createAudioEffectsAsync(audioSessionId: Int) {
Thread({
try {
val engine = AudioEffectsEngine(applicationContext, audioSessionId)
mainHandler.post {
if (destroyed) {
engine.release()
} else {
audioEffectsEngine = engine
AudioEffectsController.attach(engine)
}
}
} catch (e: Exception) {
Log.e(TAG, "Audio effects init failed", e)
}
}, "FogwaveEffectsInit").start()
}
override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaLibrarySession? = mediaLibrarySession override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaLibrarySession? = mediaLibrarySession
override fun onTaskRemoved(rootIntent: Intent?) { override fun onTaskRemoved(rootIntent: Intent?) {
@@ -329,7 +420,9 @@ class FogwavePlaybackService : MediaLibraryService() {
} }
override fun onDestroy() { override fun onDestroy() {
destroyed = true
retryJob?.cancel() retryJob?.cancel()
releaseReconnectLocks()
serviceScope.cancel() serviceScope.cancel()
networkCallback?.let { cb -> networkCallback?.let { cb ->
try { connectivityManager?.unregisterNetworkCallback(cb) } catch (_: Exception) {} try { connectivityManager?.unregisterNetworkCallback(cb) } catch (_: Exception) {}
@@ -349,6 +442,8 @@ class FogwavePlaybackService : MediaLibraryService() {
private const val ROOT_ID = "fogwave_root" private const val ROOT_ID = "fogwave_root"
private const val TAG = "FogwavePlaybackService" private const val TAG = "FogwavePlaybackService"
private const val MAX_RETRY_ATTEMPTS = 12 private const val MAX_RETRY_ATTEMPTS = 12
private const val MAX_PERMANENT_ERROR_RETRY_ATTEMPTS = 2
private const val RECONNECT_LOCK_TIMEOUT_MS = 2 * 60_000L
private const val LIVE_RESYNC_AFTER_MS = 30_000L private const val LIVE_RESYNC_AFTER_MS = 30_000L
} }
} }
@@ -48,6 +48,17 @@ class RadioPlayerManager(private val context: Context) {
} }
} }
// Without this a controller whose session went away stays non-null and every command is
// silently dropped, leaving the UI stuck on "connecting".
private val controllerListener = object : MediaController.Listener {
override fun onDisconnected(controller: MediaController) {
if (released || controller !== this@RadioPlayerManager.controller) return
Log.w(TAG, "MediaController disconnected")
dropController()
_playerState.value = PlayerState.Idle
}
}
// Declared after every property it touches so that nothing is read before initialization. // Declared after every property it touches so that nothing is read before initialization.
init { init {
connectToPlaybackService() connectToPlaybackService()
@@ -56,7 +67,9 @@ class RadioPlayerManager(private val context: Context) {
private fun connectToPlaybackService() { private fun connectToPlaybackService() {
if (released || controllerFuture != null) return if (released || controllerFuture != null) return
val sessionToken = SessionToken(context, ComponentName(context, FogwavePlaybackService::class.java)) val sessionToken = SessionToken(context, ComponentName(context, FogwavePlaybackService::class.java))
val future = MediaController.Builder(context, sessionToken).buildAsync() val future = MediaController.Builder(context, sessionToken)
.setListener(controllerListener)
.buildAsync()
controllerFuture = future controllerFuture = future
future.addListener({ future.addListener({
if (released) return@addListener if (released) return@addListener
@@ -83,6 +96,21 @@ class RadioPlayerManager(private val context: Context) {
}, MoreExecutors.directExecutor()) }, MoreExecutors.directExecutor())
} }
/** The controller if it is still connected; a stale one is dropped so the next call reconnects. */
private fun connectedController(): MediaController? {
val c = controller ?: return null
if (c.isConnected) return c
dropController()
return null
}
private fun dropController() {
controller?.removeListener(playerListener)
controller = null
controllerFuture?.let { MediaController.releaseFuture(it) }
controllerFuture = null
}
private fun deriveState(p: Player): PlayerState { private fun deriveState(p: Player): PlayerState {
p.playerError?.let { return PlayerState.Error(errorMessage(it)) } p.playerError?.let { return PlayerState.Error(errorMessage(it)) }
return when (p.playbackState) { return when (p.playbackState) {
@@ -108,7 +136,7 @@ class RadioPlayerManager(private val context: Context) {
fun playStation(station: RadioStation) { fun playStation(station: RadioStation) {
Log.d(TAG, "Station requested: ${station.id}") Log.d(TAG, "Station requested: ${station.id}")
currentStation = station currentStation = station
val c = controller val c = connectedController()
if (c == null) { if (c == null) {
pendingStation = station pendingStation = station
_playerState.value = PlayerState.Connecting _playerState.value = PlayerState.Connecting
@@ -127,7 +155,7 @@ class RadioPlayerManager(private val context: Context) {
} }
fun play() { fun play() {
val c = controller val c = connectedController()
when { when {
c == null || c.mediaItemCount == 0 -> currentStation?.let { playStation(it) } c == null || c.mediaItemCount == 0 -> currentStation?.let { playStation(it) }
// A failed, stopped or finished live stream has to be reopened rather than resumed. // A failed, stopped or finished live stream has to be reopened rather than resumed.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

@@ -0,0 +1 @@
• Oberflächensymbole jetzt im WebP-Format: kleinere App, gleiches Aussehen
@@ -0,0 +1,6 @@
• Zuverlässige Neuverbindung bei ausgeschaltetem Bildschirm und beim Wechsel zwischen WLAN und Mobilfunk
• Weniger Aussetzer bei schwachem Netz
• Flüssigere Equalizer-Regler und schnellerer App-Start
• Nicht erreichbare Streams werden nicht mehr minutenlang neu versucht
Neue Versionen gibt es auch auf Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
@@ -1,20 +1,16 @@
Fogwave ist ein schlichter, werbefreier Internetradio-Player für litauische Sender. <p>Nimm Litauens beliebteste Radiosender mit – ganz ohne Ballast. Mit Fogwave schaltest du einfach ein, hörst im Hintergrund und genießt ein aufgeräumtes, werbefreies Erlebnis ohne Konto und ohne Tracking.</p>
<b>Sender</b>
ZIP FM, Power Hit Radio, Power Hit Radio Gold, Rock FM, Relax FM, Lietus, M-1, M-1 Plius, Gold FM und RC.
<b>Funktionen</b>
<ul> <ul>
<li>Wiedergabe im Hintergrund mit Steuerung über Benachrichtigung, Sperrbildschirm, Headset und Bluetooth</li> <li>Höre 10 litauische Sender, darunter ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1 und Gold FM.</li>
<li>Unterstützung für Android Auto</li> <li>Hör weiter, während du andere Apps nutzt – mit Steuerung über Sperrbildschirm, Benachrichtigungen, Kopfhörer und Bluetooth.</li>
<li>Automatische Neuverbindung, wenn der Stream abbricht oder das Netz zurückkommt</li> <li>Genieße deinen Lieblingsklang mit Equalizer, gespeicherten Einstellungen, Lautstärkeverstärkung und Audio-Presets.</li>
<li>Equalizer mit Voreinstellungen und Bandregelung, Lautheitsverstärker und Dynamikbearbeitung</li> <li>Hör einfach weiter: Bricht der Stream oder das Netz ab, verbindet sich die App automatisch neu.</li>
<li>Favoriten, zuletzt gehörte und ähnliche Sender</li> <li>Nimm das Radio mit auf die Straße – mit Android-Auto-Unterstützung.</li>
<li>Vier Ansichten – Liste, Tabelle, Kacheln und Symbole – mit einstellbarer Größe</li> <li>Finde Sender auf deine Art: Favoriten, zuletzt gehörte Sender, passende Genres und vier Ansichten.</li>
<li>Englisch, Russisch, Deutsch, Litauisch, Japanisch und Chinesisch</li>
</ul> </ul>
<b>Datenschutz</b> <p>Wähle einen Sender und tippe auf Wiedergabe. Fogwave spielt im Hintergrund weiter und speichert deine Equalizer-Einstellungen für das nächste Mal. Das dunkle, aufgeräumte Design gibt es auf Englisch, Russisch, Deutsch, Japanisch, Litauisch und Chinesisch.</p>
Keine Konten, keine Werbung, keine Analyse. Der Ton kommt direkt von den Servern der Sender; Fogwave speichert oder verbreitet ihn nicht.
Sendernamen und Logos gehören ihren jeweiligen Inhabern. <p>Ob du in Litauen lebst, zu Besuch bist oder einfach litauische Musik und Radio magst – mit Fogwave hörst du ganz unkompliziert zu. Open Source, ohne Werbung, Tracking oder Konto.</p>
<p>Lade Fogwave herunter und schalte Litauen ein.</p>
@@ -1 +1 @@
Schlichtes, werbefreies Internetradio mit litauischen Sendern Litauisches Radio mit einem Tippen – entspannt und werbefrei hören.
@@ -0,0 +1 @@
• Interface icons are now WebP: the app is smaller and looks the same
@@ -0,0 +1,6 @@
• Playback reconnects reliably with the screen off and after switching between Wi-Fi and mobile data
• Less stuttering on a weak network
• Smoother equalizer sliders and faster app start
• Hopeless streams are no longer retried for minutes
New versions are also available on Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
@@ -1,20 +1,16 @@
Fogwave is a minimal, ad-free internet radio player for Lithuanian stations. <p>Bring Lithuania's favorite radio stations along, without the clutter. Fogwave makes it easy to tune in, listen in the background, and enjoy a clean, ad-free experience with no account or tracking required.</p>
<b>Stations</b>
ZIP FM, Power Hit Radio, Power Hit Radio Gold, Rock FM, Relax FM, Lietus, M-1, M-1 Plius, Gold FM and RC.
<b>Features</b>
<ul> <ul>
<li>Background playback with notification, lock-screen, headset and Bluetooth controls</li> <li>Tune in to 10 Lithuanian stations, including ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1, and Gold FM.</li>
<li>Android Auto support</li> <li>Keep listening while you use other apps, with controls on your lock screen, notifications, headphones, and Bluetooth.</li>
<li>Automatic reconnection when the stream drops or the network comes back</li> <li>Enjoy your favorite sound with an equalizer, saved settings, loudness boost, and audio presets.</li>
<li>Equalizer with presets and per-band control, loudness enhancer and dynamics processing</li> <li>Get back to listening easily with auto-reconnect when your stream or network drops.</li>
<li>Favorites, recently played and similar stations</li> <li>Take radio on the road with Android Auto support.</li>
<li>Four layouts — list, table, tiles and icons — with adjustable size</li> <li>Find stations your way with favorites, recently played stations, genre matches, and four viewing layouts.</li>
<li>English, Russian, German, Lithuanian, Japanese and Chinese</li>
</ul> </ul>
<b>Privacy</b> <p>Choose a station and press play. Fogwave keeps audio running in the background and saves your equalizer settings for your next session. Its dark, uncluttered design is available in English, Russian, German, Japanese, Lithuanian, and Chinese.</p>
No accounts, no ads, no analytics. Audio is streamed directly from each broadcaster; Fogwave does not host or redistribute it.
Station names and logos belong to their respective owners. <p>Whether you live in Lithuania, are visiting, or simply enjoy Lithuanian music and radio, Fogwave gives you a straightforward way to listen. It's open source, with no ads, tracking, or account required.</p>
<p>Download Fogwave and tune in to Lithuania.</p>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 KiB

After

Width:  |  Height:  |  Size: 784 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 1020 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 989 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

@@ -1 +1 @@
Minimal ad-free internet radio for Lithuanian stations Enjoy Lithuanian radio in one tap, with a calm, ad-free listening experience.
@@ -0,0 +1 @@
• UIアイコンをWebP形式に変更:アプリが軽くなり、見た目は同じです
@@ -0,0 +1,6 @@
• 画面オフ時や Wi-Fi とモバイルデータの切り替え時も確実に再接続
• 電波の弱い場所での途切れを軽減
• イコライザーのスライダーがなめらかになり、起動も高速化
• 再生できないストリームを何分も再試行しなくなりました
新しいバージョンは Gitea でも入手できます: https://git.skysparkle.cc/kalarina/Fogwave/releases
@@ -1,20 +1,16 @@
Fogwave は、リトアニアのラジオ局を聴くための広告なしのシンプルなインターネットラジオプレーヤーです。 <p>リトアニアで人気のラジオ局を、すっきりといつでも。Fogwaveなら簡単に選局でき、バックグラウンドで聴けて、広告なしの快適な体験を楽しめます。アカウント登録もトラッキングもありません。</p>
<b>放送局</b>
ZIP FM、Power Hit Radio、Power Hit Radio Gold、Rock FM、Relax FM、Lietus、M-1、M-1 Plius、Gold FM、RC。
<b>機能</b>
<ul> <ul>
<li>通知、ロック画面、ヘッドセット、Bluetooth から操作できるバックグラウンド再生</li> <li>ZIP FM、Power Hit Radio、Rock FM、Relax FM、M-1、Gold FMなど、リトアニアの10局を収録。</li>
<li>Android Auto に対応</li> <li>他のアプリを使いながら聴き続けられます。ロック画面、通知、ヘッドホン、Bluetoothから操作可能。</li>
<li>ストリームが途切れたときやネットワーク復帰時に自動で再接続</li> <li>イコライザー、設定の保存、ラウドネスブースト、オーディオプリセットで好みの音に。</li>
<li>プリセットと帯域ごとの調整ができるイコライザー、ラウドネスエンハンサー、ダイナミクス処理</li> <li>ストリームやネットワークが途切れても自動で再接続し、すぐに再生が戻ります。</li>
<li>お気に入り、最近の再生、類似の放送局</li> <li>Android Autoに対応し、ドライブ中もラジオを。</li>
<li>リスト・テーブル・タイル・アイコンの 4 つの表示とサイズ調整</li> <li>お気に入り、最近聴いた局、ジャンルの一致、4種類の表示レイアウトで、自分好みに局を探せます。</li>
<li>英語、ロシア語、ドイツ語、リトアニア語、日本語、中国語に対応</li>
</ul> </ul>
<b>プライバシー</b> <p>局を選んで再生するだけ。Fogwaveはバックグラウンドで再生を続け、イコライザー設定を次回まで保存します。ダークで余計なもののないデザインは、英語、ロシア語、ドイツ語、日本語、リトアニア語、中国語に対応しています。</p>
アカウント、広告、解析は一切ありません。音声は各放送局から直接配信され、Fogwave が保存・再配布することはありません。
放送局の名称とロゴは各権利者に帰属します。 <p>リトアニアに住んでいる方も、訪れている方も、リトアニアの音楽やラジオが好きな方も、Fogwaveで手軽に聴けます。オープンソースで、広告・トラッキング・アカウントは一切不要です。</p>
<p>Fogwaveをダウンロードして、リトアニアのラジオを聴きましょう。</p>

Some files were not shown because too many files have changed in this diff Show More