Skip to content

Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.

Let automatic quality follow the connection it is on

Lelonio4b1376236ade
diff --git a/app/src/main/java/dev/lelonio/square/data/QualityStore.kt b/app/src/main/java/dev/lelonio/square/data/QualityStore.kt
index 6ef6938..c1548c2 100644
--- a/app/src/main/java/dev/lelonio/square/data/QualityStore.kt
+++ b/app/src/main/java/dev/lelonio/square/data/QualityStore.kt
@@ -51,9 +51,42 @@ class QualityStore(context: Context) {
fun bitrateKbps(): Int {
val chosen = _quality.value
if (chosen != Quality.Auto) return chosen.kbps
- return if (isMetered()) Quality.Medium.kbps else Quality.High.kbps
+ return automatic()
}
+ /**
+ * What automatic means: how fast the connection actually is.
+ *
+ * It used to mean "is this connection metered", which answers a question
+ * about the bill rather than about the link. A limited wi-fi is unmetered
+ * and can still be slower than the stream, which is exactly the case where
+ * the setting matters: 320 kbps over a link that cannot carry it is a track
+ * that stalls, and the app went on asking for it because the connection was
+ * free.
+ *
+ * The system's own downstream estimate decides, with room above each step:
+ * a 320 kbps stream needs about 40 kB/s and nothing else on the phone is
+ * idle, so asking for roughly three times the stream keeps the buffer ahead
+ * of the decoder. Where there is no estimate — some networks report
+ * nothing — the old question is still worth asking, and metered falls back
+ * to the middle step.
+ */
+ fun automatic(): Int {
+ val capabilities = capabilities()
+ val kbps = capabilities?.linkDownstreamBandwidthKbps ?: 0
+ if (kbps <= 0) {
+ return if (isMetered()) Quality.Medium.kbps else Quality.High.kbps
+ }
+ return when {
+ kbps < LOW_CEILING_KBPS -> Quality.Low.kbps
+ kbps < MEDIUM_CEILING_KBPS -> Quality.Medium.kbps
+ else -> Quality.High.kbps
+ }
+ }
+
+ /** The estimate the choice above is made from, for the settings to show. */
+ fun linkKbps(): Int = capabilities()?.linkDownstreamBandwidthKbps ?: 0
+
/**
* Whether the connection is one the user pays by the megabyte.
*
@@ -62,12 +95,25 @@ class QualityStore(context: Context) {
* such is not.
*/
private fun isMetered(): Boolean {
- val manager = app.getSystemService(ConnectivityManager::class.java) ?: return false
- val capabilities = manager.getNetworkCapabilities(manager.activeNetwork) ?: return false
+ val capabilities = capabilities() ?: return false
return !capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)
}
+ private fun capabilities(): NetworkCapabilities? {
+ val manager = app.getSystemService(ConnectivityManager::class.java) ?: return null
+ return manager.getNetworkCapabilities(manager.activeNetwork)
+ }
+
private companion object {
+ /**
+ * Below this, ask for the smallest file; below the next, the middle one.
+ *
+ * Three times the stream itself, near enough: 96 kbps of audio wants
+ * 300 of link, 160 wants 600. Under those the buffer never gets ahead.
+ */
+ const val LOW_CEILING_KBPS = 300
+ const val MEDIUM_CEILING_KBPS = 700
+
const val FILE_NAME = "square_quality"
const val KEY_QUALITY = "quality"
}
diff --git a/app/src/main/java/dev/lelonio/square/playback/BandwidthWatch.kt b/app/src/main/java/dev/lelonio/square/playback/BandwidthWatch.kt
new file mode 100644
index 0000000..5ca2672
--- /dev/null
+++ b/app/src/main/java/dev/lelonio/square/playback/BandwidthWatch.kt
@@ -0,0 +1,130 @@
+package dev.lelonio.square.playback
+
+import android.util.Log
+import dev.lelonio.square.data.Quality
+
+/**
+ * What the connection can actually carry, judged by listening rather than asking.
+ *
+ * The system's own estimate answers a different question: it reports the speed
+ * of the radio link, which stays high behind a router that is throttling, a
+ * captive network that is shaping, or a plan that has run out of fast data. A
+ * phone can sit on a 300 Mbps wi-fi and receive 200 kbps, and the setting that
+ * exists precisely for that case never noticed.
+ *
+ * So this watches what happens to the music. Two facts, both free:
+ *
+ * A **stall** is the honest one. If the sound stops while the player still
+ * means to be playing, the buffer ran dry: whatever anyone estimated, it was
+ * too much. One stall steps down immediately.
+ *
+ * A **slow load** is the early warning. The time between asking for a track and
+ * hearing it is mostly the time spent fetching the first seconds of it, so a
+ * load that takes longer than a track's worth of patience says the link is
+ * behind before the music has had to stop.
+ *
+ * Coming back up is deliberately reluctant: several tracks in a row have to
+ * load quickly and play through before the quality rises, because a link that
+ * has just failed to carry 320 will happily fail again, and a listener notices
+ * oscillation far more than they notice one step of bitrate.
+ *
+ * Nothing here rebuilds anything. The engine reads its bitrate when a track
+ * loads, so a decision costs a message and is heard on the next song.
+ */
+class BandwidthWatch(
+ private val onStep: (Int) -> Unit,
+) {
+ /** The step in use, in kbps: one of [Quality]'s three fixed values. */
+ var current: Int = Quality.High.kbps
+ private set
+
+ private var loadStartedAt = 0L
+ private var loadingUri: String? = null
+
+ /** Tracks that have loaded quickly and played through since the last fall. */
+ private var goodRun = 0
+
+ /** Where the ladder starts, when playback begins with no history. */
+ fun start(from: Int) {
+ current = from
+ goodRun = 0
+ }
+
+ /** The engine has begun loading [uri]. */
+ fun loading(uri: String, now: Long = System.currentTimeMillis()) {
+ if (loadingUri == uri) return
+ loadingUri = uri
+ loadStartedAt = now
+ }
+
+ /** [uri] is now playing: whatever it took to get here is the measurement. */
+ fun playing(uri: String, now: Long = System.currentTimeMillis()) {
+ val started = loadStartedAt
+ if (loadingUri != uri || started == 0L) return
+ loadingUri = null
+ val took = now - started
+ if (took >= SLOW_LOAD_MS) {
+ Log.i(TAG, "load took ${took}ms, stepping down")
+ stepDown()
+ } else {
+ goodRun++
+ if (goodRun >= GOOD_TRACKS_BEFORE_RISING) stepUp()
+ }
+ }
+
+ /**
+ * The music stopped while it meant to be playing.
+ *
+ * Reported by whoever is watching the position rather than measured here:
+ * the player is the only thing that knows the difference between a buffer
+ * that ran dry and a listener who pressed pause.
+ */
+ fun stalled() {
+ Log.i(TAG, "the buffer ran dry, stepping down")
+ stepDown()
+ }
+
+ private fun stepDown() {
+ goodRun = 0
+ val next = when (current) {
+ Quality.High.kbps -> Quality.Medium.kbps
+ Quality.Medium.kbps -> Quality.Low.kbps
+ else -> return
+ }
+ apply(next)
+ }
+
+ private fun stepUp() {
+ goodRun = 0
+ val next = when (current) {
+ Quality.Low.kbps -> Quality.Medium.kbps
+ Quality.Medium.kbps -> Quality.High.kbps
+ else -> return
+ }
+ apply(next)
+ }
+
+ private fun apply(kbps: Int) {
+ if (kbps == current) return
+ current = kbps
+ Log.i(TAG, "asking for $kbps kbps from the next track")
+ onStep(kbps)
+ }
+
+ private companion object {
+ const val TAG = "SquareBandwidth"
+
+ /**
+ * A load slower than this is taken as a link that cannot keep up.
+ *
+ * Generous on purpose: it also covers the access point answering, the
+ * key exchange and the first seconds of audio, and none of that is
+ * instant even on a good connection. What it must not do is fire on a
+ * link that is merely ordinary.
+ */
+ const val SLOW_LOAD_MS = 6_000L
+
+ /** How many quick, unbroken tracks it takes to try the step above. */
+ const val GOOD_TRACKS_BEFORE_RISING = 4
+ }
+}
diff --git a/app/src/main/java/dev/lelonio/square/playback/LibrespotPlayer.kt b/app/src/main/java/dev/lelonio/square/playback/LibrespotPlayer.kt
index 1a7ae1c..a517926 100644
--- a/app/src/main/java/dev/lelonio/square/playback/LibrespotPlayer.kt
+++ b/app/src/main/java/dev/lelonio/square/playback/LibrespotPlayer.kt
@@ -148,6 +148,48 @@ class LibrespotPlayer(
private val handler = android.os.Handler(looper)
+ /**
+ * The quality the listener asked for, which decides whether the one below
+ * is allowed to have an opinion.
+ */
+ private val quality =
+ (context.applicationContext as dev.lelonio.square.SquareApplication).quality
+
+ /**
+ * Follows what the connection can actually carry; see [BandwidthWatch].
+ *
+ * Only while the setting is automatic. On a fixed choice the listener has
+ * said which file they want and a stall is their business, not ours.
+ */
+ private val bandwidth = BandwidthWatch { kbps ->
+ if (quality.quality.value == dev.lelonio.square.data.Quality.Auto) {
+ runCatching { dev.lelonio.square.nativecore.NativeBridge.setBitrate(kbps) }
+ }
+ }
+
+ /**
+ * Fires when the music should have reported progress and did not.
+ *
+ * Position arrives once a second from the decoding loop, so silence there
+ * while the player still means to be playing is the buffer having run dry.
+ * It is the one measurement of a connection that cannot be argued with.
+ */
+ private val stallWatch = Runnable {
+ // Not while a track is being fetched: the decoding loop reports nothing
+ // during a load, so a slow one looks exactly like a buffer that ran dry
+ // and was being counted twice — once as a slow load, once as a stall.
+ if (loadInFlight) return@Runnable
+ if (playWhenReady && playbackState == Player.STATE_READY) bandwidth.stalled()
+ }
+
+ /** True between a track being asked for and that same track playing. */
+ private var loadInFlight = false
+
+ private fun expectProgress() {
+ handler.removeCallbacks(stallWatch)
+ if (playWhenReady) handler.postDelayed(stallWatch, STALL_AFTER_MS)
+ }
+
/**
* The other device's playback, when the account is playing on one.
*
@@ -1061,10 +1103,16 @@ class LibrespotPlayer(
when (type) {
"loading" -> {
playbackState = Player.STATE_BUFFERING
+ if (uri.isNotEmpty()) bandwidth.loading(uri)
+ loadInFlight = true
+ handler.removeCallbacks(stallWatch)
}
"playing" -> {
playbackState = Player.STATE_READY
playWhenReady = true
+ if (uri.isNotEmpty()) bandwidth.playing(uri)
+ loadInFlight = false
+ expectProgress()
if (!skipInFlight) positionMs = eventPositionMs
// Here as well as in handleSetPlayWhenReady: a pause can arrive
// from the notification, from a headset button or from another
@@ -1074,10 +1122,15 @@ class LibrespotPlayer(
"paused" -> {
playbackState = Player.STATE_READY
playWhenReady = false
+ // A pause is not a stall.
+ handler.removeCallbacks(stallWatch)
if (!skipInFlight) positionMs = eventPositionMs
onPlaybackActive(false)
}
"position" -> {
+ // Progress arrived, so the stream is keeping up: the watch is
+ // wound again rather than left to fire.
+ expectProgress()
// The old track goes on reporting until the new one starts.
// Taking those would run the bar forward on a song that is no
// longer the one on screen.
@@ -1116,10 +1169,22 @@ class LibrespotPlayer(
return
}
- "end_of_track", "unavailable" -> {
+ "end_of_track" -> {
takeOverForQueued()
return
}
+
+ // A track the engine could not load, after it has already tried
+ // again a few times. Only ever acted on for the track that is
+ // actually playing: the same event is sent when the *next* track
+ // fails to preload, and taking that as "move on" skipped the song
+ // the listener was in the middle of because a later one was slow to
+ // arrive.
+ "unavailable" -> {
+ val current = queue.items.getOrNull(queue.currentIndex)?.uri
+ if (uri.isEmpty() || uri == current) takeOverForQueued()
+ return
+ }
else -> return
}
// Whether the music is here or somewhere else can change without any
@@ -1189,6 +1254,14 @@ class LibrespotPlayer(
.build()
private companion object {
+ /**
+ * How long the music may go without reporting progress before the
+ * buffer is taken to have run dry.
+ *
+ * Progress arrives once a second, so three is a gap and not a jitter.
+ */
+ const val STALL_AFTER_MS = 3_500L
+
/**
* How long skips are gathered for before the engine is told.
*
diff --git a/app/src/main/java/dev/lelonio/square/playback/PlaybackService.kt b/app/src/main/java/dev/lelonio/square/playback/PlaybackService.kt
index 2d099bf..50568a4 100644
--- a/app/src/main/java/dev/lelonio/square/playback/PlaybackService.kt
+++ b/app/src/main/java/dev/lelonio/square/playback/PlaybackService.kt
@@ -168,6 +168,11 @@ class PlaybackService : MediaLibraryService() {
quality.quality.drop(1).collect { reconfigureEngine("quality") }
}
+ // The link estimate is the opening guess only. What corrects it is the
+ // music itself, in BandwidthWatch: a rebuild for every change of
+ // network was a second of silence for an answer that is often wrong,
+ // and the engine can now be told a new bitrate without one.
+
// Which stretcher does speed and pitch. Unlike the bitrate this one is
// switchable while playing: it is a property of the output, not of the
// session.
@@ -511,6 +516,11 @@ class PlaybackService : MediaLibraryService() {
scope.launch {
val ok = withContext(Dispatchers.IO) {
runCatching {
+ android.util.Log.i(
+ TAG,
+ "quality: asking for ${'$'}{quality.bitrateKbps()} kbps" +
+ " (link estimate ${'$'}{quality.linkKbps()} kbps)",
+ )
NativeBridge.setQuality(quality.bitrateKbps(), crossfade.durationMs())
}
.onFailure { android.util.Log.e(TAG, "could not rebuild the player: $it") }
@@ -533,6 +543,7 @@ class PlaybackService : MediaLibraryService() {
*/
private var rebuilding = false
+
/**
* Re-runs [connectEngine] on demand.
*
@@ -596,7 +607,13 @@ class PlaybackService : MediaLibraryService() {
// generated playlists carry the language in the cover's
// URL, so the tiles came back in English.
language = appLanguage(),
- bitrateKbps = quality.bitrateKbps(),
+ bitrateKbps = quality.bitrateKbps().also {
+ android.util.Log.i(
+ TAG,
+ "quality: starting at ${'$'}it kbps" +
+ " (link estimate ${'$'}{quality.linkKbps()} kbps)",
+ )
+ },
// Off is zero, which is upstream librespot's own behaviour.
crossfadeMs = crossfade.durationMs(),
listener = engine,
diff --git a/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt b/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt
index f67b9f7..7ac94e2 100644
--- a/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt
+++ b/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt
@@ -627,6 +627,20 @@ private fun QualitySection() {
selected = quality == chosen,
) { store.set(quality) }
}
+ // What automatic is deciding, and from what. A setting that answers
+ // "it depends" should say what it depends on.
+ if (chosen == Quality.Auto) {
+ RowDivider()
+ val link = store.linkKbps()
+ InfoRow(
+ stringResource(R.string.quality_link),
+ if (link > 0) {
+ stringResource(R.string.quality_link_value, link, store.automatic())
+ } else {
+ stringResource(R.string.quality_link_unknown, store.automatic())
+ },
+ )
+ }
RowDivider()
Text(
stringResource(R.string.quality_auto_note) + " " +
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index c3466ed..7f9884a 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -221,7 +221,7 @@
<string name="quality_high">Hoch</string>
<string name="quality_medium">Mittel</string>
<string name="quality_low">Niedrig</string>
- <string name="quality_auto_note">Volle Qualität im WLAN, eine Stufe darunter bei getakteten Verbindungen.</string>
+ <string name="quality_auto_note">Automatisch beginnt bei der Schätzung der Verbindung und folgt dann der Musik: ein Titel, der stockt oder spät startet, senkt sie eine Stufe, mehrere schnelle hintereinander heben sie wieder.</string>
<string name="quality_restarts">Beim Ändern wird der laufende Titel neu geladen.</string>
<string name="premium_required">Square braucht Spotify Premium. Ein kostenloses Konto kann sich anmelden, aber Spotify streamt nicht an einen Client wie diesen.</string>
<string name="new_playlist">Neue Playlist</string>
@@ -288,4 +288,7 @@
<string name="delete_playlist_title">Diese Playlist löschen?</string>
<string name="delete_playlist_message">%1$s verschwindet von allen Geräten dieses Kontos, und es gibt keinen Weg zurück.</string>
<string name="glass_indicator">Aktiver Tab</string>
+ <string name="quality_link">Verbindung</string>
+ <string name="quality_link_value">%1$d kbps, also Ton mit %2$d kbps</string>
+ <string name="quality_link_unknown">unbekannt, also Ton mit %1$d kbps</string>
</resources>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 14cbef9..7d2e4b3 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -221,7 +221,7 @@
<string name="quality_high">Alta</string>
<string name="quality_medium">Media</string>
<string name="quality_low">Baja</string>
- <string name="quality_auto_note">Calidad plena con wi-fi, un paso menos con datos medidos.</string>
+ <string name="quality_auto_note">Automática parte de la estimación de la conexión y luego sigue a la música: una canción que se corta o que tarda en empezar la baja un paso, y varias rápidas seguidas la vuelven a subir.</string>
<string name="quality_restarts">Al cambiarla, la canción en curso se vuelve a cargar.</string>
<string name="premium_required">Square necesita Spotify Premium. Una cuenta gratuita puede entrar, pero Spotify no transmite a un cliente como este.</string>
<string name="new_playlist">Nueva lista</string>
@@ -288,4 +288,7 @@
<string name="delete_playlist_title">¿Eliminar esta lista?</string>
<string name="delete_playlist_message">%1$s desaparecerá de todos los dispositivos de esta cuenta, y no hay vuelta atrás.</string>
<string name="glass_indicator">Pestaña activa</string>
+ <string name="quality_link">Conexión</string>
+ <string name="quality_link_value">%1$d kbps, así que audio a %2$d kbps</string>
+ <string name="quality_link_unknown">desconocida, así que audio a %1$d kbps</string>
</resources>
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 429ddac..10a74f5 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -221,7 +221,7 @@
<string name="quality_high">Haute</string>
<string name="quality_medium">Moyenne</string>
<string name="quality_low">Basse</string>
- <string name="quality_auto_note">Qualité maximale en wi-fi, un cran en dessous sur une connexion facturée.</string>
+ <string name="quality_auto_note">Automatique part de l\'estimation de la connexion puis suit la musique : un morceau qui se coupe ou qui tarde à démarrer la fait descendre d\'un cran, et plusieurs morceaux rapides la font remonter.</string>
<string name="quality_restarts">La changer recharge le titre en cours.</string>
<string name="premium_required">Square demande Spotify Premium. Un compte gratuit peut se connecter, mais Spotify ne diffuse pas vers un client comme celui-ci.</string>
<string name="new_playlist">Nouvelle playlist</string>
@@ -288,4 +288,7 @@
<string name="delete_playlist_title">Supprimer cette playlist ?</string>
<string name="delete_playlist_message">%1$s disparaîtra de tous les appareils de ce compte, sans retour possible.</string>
<string name="glass_indicator">Onglet actif</string>
+ <string name="quality_link">Connexion</string>
+ <string name="quality_link_value">%1$d kbps, donc audio à %2$d kbps</string>
+ <string name="quality_link_unknown">inconnue, donc audio à %1$d kbps</string>
</resources>
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index feb9bbb..049aaf8 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -236,7 +236,7 @@
<string name="quality_high">उच्च</string>
<string name="quality_medium">मध्यम</string>
<string name="quality_low">कम</string>
- <string name="quality_auto_note">वाई-फ़ाई पर पूरी गुणवत्ता, मीटर वाले कनेक्शन पर एक कदम नीचे।</string>
+ <string name="quality_auto_note">स्वचालित कनेक्शन के अनुमान से शुरू होता है और फिर संगीत का अनुसरण करता है: कोई गाना अटके या देर से शुरू हो तो एक कदम नीचे, और लगातार कई तेज़ गाने फिर से ऊपर।</string>
<string name="quality_restarts">इसे बदलने पर जो चल रहा है वह फिर से लोड होता है।</string>
<string name="premium_required">Square को Spotify Premium चाहिए। मुफ़्त खाता लॉग इन तो कर सकता है, पर Spotify ऐसे क्लाइंट को स्ट्रीम नहीं देता।</string>
<string name="new_playlist">नई प्लेलिस्ट</string>
@@ -303,4 +303,7 @@
<string name="delete_playlist_title">यह प्लेलिस्ट हटाएँ?</string>
<string name="delete_playlist_message">%1$s इस खाते के हर डिवाइस से चली जाएगी, और वापस लाने का कोई तरीका नहीं है।</string>
<string name="glass_indicator">सक्रिय टैब</string>
+ <string name="quality_link">कनेक्शन</string>
+ <string name="quality_link_value">%1$d kbps, इसलिए %2$d kbps ऑडियो</string>
+ <string name="quality_link_unknown">अज्ञात, इसलिए %1$d kbps ऑडियो</string>
</resources>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 57f7755..2342a10 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -222,7 +222,7 @@
<string name="quality_high">Alta</string>
<string name="quality_medium">Media</string>
<string name="quality_low">Bassa</string>
- <string name="quality_auto_note">Qualità piena sul wi-fi, un gradino sotto con la rete a consumo.</string>
+ <string name="quality_auto_note">Automatica parte dalla stima della connessione e poi segue la musica: un brano che si inceppa o che tarda a partire la fa scendere di un gradino, e diversi brani rapidi di fila la fanno risalire.</string>
<string name="quality_restarts">Cambiandola, la canzone in corso viene ricaricata.</string>
<string name="premium_required">Square richiede Spotify Premium. Un account free riesce ad accedere, ma Spotify non trasmette a un client come questo.</string>
<string name="new_playlist">Nuova playlist</string>
@@ -289,4 +289,7 @@
<string name="delete_playlist_title">Eliminare questa playlist?</string>
<string name="delete_playlist_message">%1$s sparirà da ogni dispositivo di questo account, e non si può tornare indietro.</string>
<string name="glass_indicator">Tab attiva</string>
+ <string name="quality_link">Connessione</string>
+ <string name="quality_link_value">%1$d kbps, quindi audio a %2$d kbps</string>
+ <string name="quality_link_unknown">sconosciuta, quindi audio a %1$d kbps</string>
</resources>
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 6791cba..d6dc206 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -221,7 +221,7 @@
<string name="quality_high">Alta</string>
<string name="quality_medium">Média</string>
<string name="quality_low">Baixa</string>
- <string name="quality_auto_note">Qualidade máxima no wi-fi, um degrau abaixo em ligação tarifada.</string>
+ <string name="quality_auto_note">Automática parte da estimativa da ligação e depois segue a música: uma faixa que trava ou que demora a começar baixa um degrau, e várias rápidas seguidas voltam a subir.</string>
<string name="quality_restarts">Ao mudá-la, a faixa em curso é recarregada.</string>
<string name="premium_required">O Square precisa de Spotify Premium. Uma conta gratuita consegue entrar, mas o Spotify não transmite para um cliente como este.</string>
<string name="new_playlist">Nova playlist</string>
@@ -288,4 +288,7 @@
<string name="delete_playlist_title">Eliminar esta playlist?</string>
<string name="delete_playlist_message">%1$s vai desaparecer de todos os dispositivos desta conta, e não há forma de voltar atrás.</string>
<string name="glass_indicator">Separador ativo</string>
+ <string name="quality_link">Ligação</string>
+ <string name="quality_link_value">%1$d kbps, portanto áudio a %2$d kbps</string>
+ <string name="quality_link_unknown">desconhecida, portanto áudio a %1$d kbps</string>
</resources>
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index f8f1ff0..256f49e 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -236,7 +236,7 @@
<string name="quality_high">Yüksek</string>
<string name="quality_medium">Orta</string>
<string name="quality_low">Düşük</string>
- <string name="quality_auto_note">Wi-Fi\'de tam kalite, sayaçlı bağlantıda bir kademe düşük.</string>
+ <string name="quality_auto_note">Otomatik, bağlantının tahminiyle başlar ve sonra müziği izler: takılan ya da geç başlayan bir parça bir kademe düşürür, arka arkaya birkaç hızlı parça yeniden yükseltir.</string>
<string name="quality_restarts">Bunu değiştirmek çalan parçayı yeniden yükler.</string>
<string name="premium_required">Square, Spotify Premium gerektirir. Ücretsiz hesap giriş yapabilir ama Spotify böyle bir istemciye yayın vermez.</string>
<string name="new_playlist">Yeni çalma listesi</string>
@@ -303,4 +303,7 @@
<string name="delete_playlist_title">Bu çalma listesi silinsin mi?</string>
<string name="delete_playlist_message">%1$s bu hesaptaki tüm cihazlardan kaybolacak ve geri dönüşü yok.</string>
<string name="glass_indicator">Etkin sekme</string>
+ <string name="quality_link">Bağlantı</string>
+ <string name="quality_link_value">%1$d kbps, yani %2$d kbps ses</string>
+ <string name="quality_link_unknown">bilinmiyor, yani %1$d kbps ses</string>
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7af7c3e..2a96725 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -242,7 +242,7 @@
<string name="quality_high">High</string>
<string name="quality_medium">Medium</string>
<string name="quality_low">Low</string>
- <string name="quality_auto_note">Full quality on wi-fi, one step down on a metered connection.</string>
+ <string name="quality_auto_note">Automatic starts from the connection\'s own estimate and then follows the music: a track that stalls or is slow to start drops it a step, and several quick ones in a row raise it again.</string>
<string name="quality_restarts">Changing this reloads what is playing.</string>
<string name="premium_required">Square needs Spotify Premium. A free account can sign in, but Spotify does not stream to a client like this one.</string>
<string name="new_playlist">New playlist</string>
@@ -309,4 +309,7 @@
<string name="delete_playlist_title">Delete this playlist?</string>
<string name="delete_playlist_message">%1$s will be gone from every device on this account, and there is no way back.</string>
<string name="glass_indicator">Active tab</string>
+ <string name="quality_link">Connection</string>
+ <string name="quality_link_value">%1$d kbps, so %2$d kbps audio</string>
+ <string name="quality_link_unknown">unknown, so %1$d kbps audio</string>
</resources>