Skip to content
Rymembra Docs GitHub

Docs

Your devices over the internet

A PC shows a QR code, the phone scans it, and from then on the two find each other on their own — at home and away: each shows the other's music in its own library, plays it — on mobile data too — and can download it. There is no Rymembra server: the transport is iroh (QUIC between two ed25519 keys), direct when it can be, through a relay when it cannot.

Linking devices and the unified library#

Source core/rymembra-lontano/src/lib.rs core/rymembra-lontano/src/collegamento.rs core/rymembra-lontano/src/protocollo.rs core/rymembra-lontano/src/nodo.rs core/rymembra-lontano/src/errori.rs core/rymembra-app/src/dispositivi.rs core/rymembra-app/src/library/condivisa.rs core/rymembra-app/src/db/schema/039_dispositivi.sql apps/desktop/src-tauri/src/lontano/mod.rs apps/desktop/src-tauri/src/lontano/filo.rs apps/desktop/src-tauri/src/lontano/ospite.rs apps/desktop/src-tauri/src/lontano/servizio.rs apps/desktop/src-tauri/src/lontano/sfoglia.rs apps/desktop/src-tauri/src/lontano/specchio.rs core/rymembra-app/src/specchio.rs apps/desktop/src-tauri/src/lontano/scarico.rs apps/desktop/src-tauri/src/lontano/identita.rs apps/desktop/src/lontano.ts apps/desktop/src/parti/Dispositivi.tsx apps/desktop/src/origine.ts apps/desktop/src/parti/PilloleOrigine.tsx apps/desktop/src/parti/StrisciaSpecchio.tsx apps/desktop/src/ConfermaSpecchio.tsx core/rymembra-lontano/src/flusso.rs core/rymembra-insieme/src/presa.rs core/rymembra-insieme/src/tempi.rs apps/desktop/src-tauri/src/lontano/insieme.rs apps/desktop/src-tauri/src/media/lontane.rs apps/desktop/src-tauri/gen/android/app/src/main/java/io/github/federicobaratti/rymembra/Copertine.kt

Off by default. Settings › Devices › «Reachable from the internet» starts the node; switched off there is no socket and no packet. Switching it off closes the node at once (Nodo::chiudi), even while a command still holds it — a link waiting for the other side's yes, a read of the other device's catalog or of a file — which then ends with lontano.spento: nothing is accepted any more and the QR stops being valid. The socket itself is released when that command lets go of the node, which it now does at once. On Windows the node runs as long as Rymembra does, tray included. The first time it starts, Windows Security asks whether to let Rymembra accept connections on public and private networks — Windows asks this of any program that opens a port — and the question stays in front of the window until it is answered. Refusing does not break the link: the relay is reached with an outgoing connection, which that question does not cover. On Android it runs while the app is on screen or playing, and goes to sleep two minutes after neither is true: the phone is reachable only then — unless «Stay active in the background» is on (Settings › Devices, off by default).

Staying active in the background (Android)

«Stay active in the background» starts a foreground service, Presenza (type connectedDevice: interaction with other devices over a network), with a minimal notification — «Rymembra is active · connected to <PC>» and a «Turn off» button. While it runs the process stays alive after the app is swiped away from the recent apps, and the node never goes to sleep (daemon.attivo, a fact of this phone: it never travels in a profile or a backup). It does not turn «Reachable from the internet» on: that stays a separate yes. It costs battery, because the relay's keepalives keep the connection open all day, and the setting says so.

A foreground service does not exempt an app from Doze: with the screen off and the phone still, Android suspends the network of apps that are still under battery optimization, so the PCs may not find the phone. The setting therefore shows a button that opens Android's own page (ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS) where Rymembra is taken out of battery optimization; the direct request (REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) is not used, because Google Play restricts it. Some manufacturers add a second saver that closes background apps anyway: the setting names them. The core no longer waits for the app's screen: the service itself starts it (Ponte.avviaIlNucleo, see «The core without a window» below), so a process the system has closed comes back with the service, the node and the player, and the notification says «Rymembra is starting» until the core is up — «Rymembra is resting», with the invitation to open the app, only if the core does not start at all (the library could not be opened, say): opening the app then starts the core again from scratch, and a service that asks again (the car) retries too, never more than once every twenty seconds and never by itself. If the library is still not there after that, the app shows its error and the notification says «Rymembra did not start properly» — a process that is already running does not reopen the library by itself, so the retry is to force stop the app and open it again. A core that falls over halfway is not rebuilt either — it would double the player and the link — and the app shows «Rymembra did not start properly» in place of its screens until it is force stopped.

The first time after the update that brings it, a card offers «Stay active in the background» — «Do you want Rymembra to stay active in the background? That way Android Auto always finds it ready, and the devices you link can always reach it.», then the battery cost, as the switch says it — with «Yes», «No, thanks» and «Later». The reasons hold for someone with no PC linked yet, who sees the card too. It is the same card and the same answer (ui.proposta.sottofondo) as the PC's offer to start with Windows, shown only once, never during the first-run setup or the tour. The tour never runs on the phone, so the card does not wait for it (propostaPuoComparire in guida.ts): it waits for the first-run setup and for the «What's new» window, and shows after them. «Yes» runs the very command of the switch, so it asks for notifications too; if «Reachable from the internet» is still off it says so, because the service alone opens nothing to the internet. «No, thanks» turns nothing on. «Later» hides the card until the app process ends and remembers no answer (it is kept in memory by the core, proposta_sottofondo_rimanda).

Starting with the car (Android)

«Start with the car» (Settings › Devices, under «Stay active in the background», off by default) makes Rymembra start by itself when the phone is connected to Android Auto, in place of the last app used, with the queue it had saved. It needs the background service, which is the one watching: Presenza observes CarConnection (Car App Library, androidx.car.app) and CONNECTION_TYPE_PROJECTION is Android Auto. It acts only when the car becomes connected — the first reading is a starting point, so switching the option on inside the car, or the service coming back there, never starts the music — and only if there is a remembered track and nothing is playing. The audio focus is asked for before the «resume» gesture, which takes the same road as the play key; if Android does not grant it, nothing starts — a call in progress, another app that will not give it up or, from Android 17, the restriction on audio asked for from the background, which the code cannot tell apart (AUDIOFOCUS_REQUEST_FAILED is the same for all three) and the log lists together. Turning the background service off turns the option off with it (daemon.auto, also a fact of this phone and never part of a profile or a backup). The car's Bluetooth is not watched.

Google Play's quality guidelines for media apps in cars say the app must not autoplay on startup or without a user-initiated action to select the app or its media (MA-1), and the playback documentation says it must not start playing when Android Auto connects. An explicit option, off by default, lowers the risk but a review may contest it, so the whole feature sits behind one build constant, PARTENZA_CON_AUTO (defaultConfig in build.gradle.kts): where it is false nobody observes the car and the switch is not drawn.

The media-button receiver follows the same rule. Media3 hands the system's resume card and a headset's or car's play key to the app only when a MediaButtonReceiver is declared and enabled, and that receiver starts the music service in the foreground — which Android closes after a few seconds if nothing plays, as it would with the core not running. So RicevitoreTasti (a thin subclass of Media3's) is declared disabled and Presenza enables it (setComponentEnabledSetting) only while the background service is on, and even then it starts nothing when the core is not up, because a component's state survives a reboot, and the service, on a phone where the power-on receiver did not run yet or the setting is off, does not.

The core without a window (Android)

The core — library, player, the car's session, the link to the other devices, scrobbling — is built from the pieces that need no window, and a Nucleo (nucleo.rs) owns them, one per process. Tauri cannot start without an activity (its plugins register on one, and without it wry::dispatch panics), so on Android the core is started in one of two ways: by the activity, as before, or by a service, with no activity at all — Presenza when the background setting is on, the power-on receiver after a reboot, and the car's wake-up (Nucleo.sveglia) even with the setting off. A process starts the core once: the first to claim it starts it, and a window born later joins it (Nucleo::reclama_l_avvio), registering the same state objects in Tauri, so the commands see one library, one player, one queue. Only the core starts from a service: the backup, the sync, the enrichment, the maintenance, the analysis, the folder watch, the update check and the tray belong to the window, because on every power-on they would be battery and disk spent for no one; for the same reason a file in a cloud folder plays only after the app has been opened once.

Two mechanisms make it safe. Android's ndk-context (read by the audio, by iroh's DNS and by netdev) can be set only once per process, and a second set aborts the process (ndk-context-0.1.1/src/lib.rs:82-88): Kotlin, which alone knows whether an activity was ever born, tells the service whether it may set it, and MainActivity releases the service's context before super.onCreate of the first activity, so tao finds it empty. Between the release and tao's own set the context is empty for at most about half a second, once per process; whoever opens the audio stream waits for a gate (rymembra_android::aspetta_il_contesto, at most two seconds) and a catch_unwind turns a late panic into an ordinary "could not open" error, and the player retries once. The power-on receiver (AvvioAccensione) listens to BOOT_COMPLETED — after the first unlock, because the library, the preferences and the Keystore live in credential-encrypted storage — and to MY_PACKAGE_REPLACED, which the system sends only to the app it has just replaced (an update stops the process, and without it the service stayed off until the app was opened); it starts Presenza only when the setting is on; connectedDevice is one of the types Android 15 lets a boot receiver start.

A «resume» from the car, the notification or a media key that arrives while the first audio engine is still opening — right after the core starts — waits for it, up to ten seconds, instead of failing with «can't play it right now». The wait happens before the gesture takes its turn in the queue of gestures, so a pause pressed meanwhile is not held back and cancels the pending resume: the last key pressed wins.

Linking with a QR code

  1. On the PC, «Show QR code». The code carries rymembra://collega/<base64url>: version, the PC's public key (32 bytes), a random token (16 bytes), up to four direct addresses, the custom relay, if any, and the name the PC gives itself (at most 64 bytes; version 1 links, without it, are still read). Next to the QR the PC shows its fingerprint: the first 60 bits of its key in three groups of four Crockford characters (K7QX 3MPA Z9TD, collegamento::impronta). «Copy link» gives the same text, for two PCs.
  2. On the phone, «Scan» (CameraX and ZXing, no Play Services), or the system camera, which opens Rymembra through the rymembra://collega link. On a PC, «Paste link». All three paths open the same question before anything connects: «Link to “PC”?», with the name presented as the other device's own choice and the fingerprint read from the link, to be compared with the one next to the QR. Someone who opened a link from a web page has no QR of their own to compare it with, and the question says to cancel.
  3. Neither showing a QR nor linking turns on «Reachable from the internet» by itself: with the switch off, a separate question asks first (lontano.spento from the core otherwise).
  4. The scanner connects on the rymembra/associa/1 ALPN and presents the token with its name and platform. The QR is used up at that moment and leaves the PC's screen (Evento::InvitoFinito). The PC asks «A device wants to link», with the name it declares and the fingerprint of its key — Refuse first, with the focus — and answers with its own presentation. While it waits, the phone shows its own fingerprint, for the PC side to compare, and can «Stop waiting» (Nodo::annulla_collegamento): its connection closes, and the PC withdraws the question (Ospite::ritirata).
  5. Both write the other in dispositivi. From then on the rymembra/lontano/1 ALPN admits that key, and only keys written there and not revoked.

The token is good once and for 10 minutes (VALIDITA_INVITO), and each device key gets at most 10 attempts a minute while a QR is shown (TENTATIVI_AL_MINUTO; with no QR an attempt is closed before it is counted). The limit is per key, not shared: someone on the same network who knows the node's key from mDNS cannot use up the attempts of the device actually scanning the code. A wrong token does not end the QR — with 128 random bits there is nothing to guess — so a stranger cannot make every code «expired» either. A new QR cancels the previous one, and the comparison is constant-time. The request to link is read with a 16 KiB limit, before the token is checked (MASSIMA_ASSOCIA); requests from linked devices are limited to 64 KiB (MASSIMA_DOMANDA), opened or not. Whoever knocks must open the stream of its request within 10 s of the handshake (ATTESA_FLUSSO_ASSOCIA), or the connection is closed: the token limit is per key, and a key costs nothing to change. Answers are read in two steps, never through serde's own enum reader, which keeps the whole object in memory before choosing the variant (about 150 MiB for a presence with an extra field of 8 MiB of zeros): first only the tipo, then the limit of that kind on the opened JSON — a presence 16 KiB (MASSIMA_TESTA_PRESENZA), a «done», a refusal or the head of a byte answer 1 KiB, data up to 8 MiB — and only then the variant (testa_entro). For data the opened JSON also has a weight of at most 560 Ki (MASSIMI_NODI_DATI): a value of an array, an entry of an object or a container counts one, because a value costs 32 bytes and 0, takes two bytes of text, and an object counts five (PESO_DI_UN_OGGETTO), because it is a tree map that costs far more to hold; the worst answer accepted takes about 65 MiB. A byte answer is never longer than what the request asked — a piece up to 2 MiB, a cover 1 MiB (Domanda::byte_attesi) — and the head says so before a byte is allocated. A QR that stops being valid — used, expired — disappears from the screen, with «New QR code» in its place, and whoever tries it is told «QR expired». The associa ALPN is closed whenever no QR is on screen: leaving the page that shows it — another section, Settings closed, the window sent to the tray — cancels the QR, and so does a «Show QR code» that answers after the page has gone or the window has been hidden.

The gate is checked again on every request, not only when a connection opens: a key that is no longer linked gets lontano.nonAssociato and loses all its connections. The node keeps every connection of every key — incoming and outgoing, library and «Listen together» — and «Forget», a «forget me» from the other side, or a key dropped from the list close all of them, «Listen together» streams already open included. A device gets at most 8 requests served at a time (DOMANDE_INSIEME), across all its connections, and at most 4 live connections (MASSIME_CONNESSIONI): a fifth closes the oldest. Besides writes (60 a minute), presence announcements are limited to 30 a minute per device (ANNUNCI_AL_MINUTO; over it the sender hears lontano.irraggiungibile and the window's thread is not woken), and a device that sends 30 wrong questions in a minute — too long, not JSON, of the wrong shape, or never arriving; a stream the other side cancels does not count — is ignored until its count drops (SBAGLIATE_AL_MINUTO): its new streams are closed unread and without taking a seat, and it is not disconnected. The node gives the diary at most 20 lines a minute (RIGHE_DI_DIARIO_AL_MINUTO) and says how many it left out, so a stream of failing requests cannot rotate the whole history away. The window's mailbox (lontano::filo) holds 512 messages: when it is full what the thread redoes by itself is dropped and counted, and a «stop», a waiting reread or a device that no longer answers still gets through. An answer is written in pieces of 64 KiB, each with 30 s (ATTESA_SCRITTURA): a device that does not read its answers loses the seat after 30 s instead of keeping it for good. A received listen with the same track and the same start as one already in the history is not an error and is not written again, but its key counts toward the 120 an hour. «Forget» removes the device here and tells the other, which marks it revoked. A device that has been forgotten is no longer asked for anything from this side either, not even the next block of a track of it that was playing. «Forget», a «forget me» received and a new link take effect at once, also while a scan keeps the library busy: the change is kept in memory until the library has it written, and no read of the library undoes it in the meantime; on exit, a change still unwritten gets 2 s more. «Forget» also drops, here, the «Listen together» trust that the QR had given to the key the device declared, unless it had been blocked by hand, which stays blocked; the side that is told only marks the device revoked, because a key it merely declared must not let it take trust away from another PC.

Finding each other

Each node publishes its home relay under its key in n0's DNS (dns.iroh.link, pkarr), and optionally in the BitTorrent mainline DHT; on the same network mDNS is enough. Names are resolved with the system's DNS servers only (on Android those of the active network, read from LinkProperties), never falling back to public resolvers, and the node makes no plain-HTTP captive-portal check. The addresses last seen are kept in dispositivi.indirizzi and given to iroh as a first hint. iroh tries the direct path first — hole punching, UPnP/NAT-PMP/PCP through the router — and falls back to the relay, which sees only encrypted bytes and the two keys. The relay is n0's public ones unless Settings › Devices › Relay names one. Once started, the node keeps a connection to every linked device, retrying with a backoff from 5 s to 5 min (PRIMA_PAUSA, ULTIMA_PAUSA); opening the Devices page, or the page of a device that does not answer, retries at once (Nodo::riprova_adesso). Many requests at once to a device without a connection share one dial. The presence it exchanges is the name, the version and whether «Listen together» is on and hosting, pushed again as soon as hosting starts or stops; what the other device says of itself arrives as plain text, at most 64 characters per field (Presenza::nei_tetti). A device whose connection drops stays in view for 8 s (GRAZIA), so a network change does not empty its page. A device reached through the relay shows «via relay»; the diary notes every change of path, direct or relay, with the round trip and without addresses.

The unified library

With devices linked, their music is one library with this one. Each track a linked device shares becomes a row of tracks with the path lontano://<device key>/<id there>, written by a reconciler (lontano/specchio.rs, specchio/*) that asks the owner for its catalog in buckets of 500 ids and rereads only the buckets whose hash changed; a track present on several devices is shown once, with the best copy. Home, Library, Search, Artists and playlists see these rows like any other. The filter «All · This device · <name>» (in Library, in Search on the phone, in the Library header on the computer; origine.ts) tells the core where to read from (Origine): «All» is the unified library, «This device» every row of this machine, a device's name every row of that device. The sidebar's «Devices» group, More › Your devices and Settings › Devices › «Show in library» open the library already filtered. A row of another device has the device's icon beside the title; if the device does not answer the row is grey (aria-disabled, «<PC> is not reachable»): it keeps the focus, the menu, the heart and the stars (they wait in the outbox), but a tap plays nothing and says who does not answer — a notice, not an error — and the lists the window plays itself — Play on an album, an artist or a playlist — skip grey rows (a selection or a whole view played from a row does not: a grey row reached there fails to open and the player says so). The first link shows «Reading <PC>'s library… 12,000/50,000» (the lontano:specchio event) while the library stays usable; a device whose Rymembra cannot send its catalog (it does not declare catalogo) shows «Update Rymembra on <name> to see its music»; rows the owner stops sending wait for a yes («<PC> no longer shares 1,340 tracks») before they go — «Keep them» takes nothing away and is remembered by the core, per device and with the number of rows kept (dispositivi::ricorda_lasciati, the lontano.lasciati setting, outside the profile and the backup like every lontano.* key), so the question does not come back at the same figure, not even after a restart, and does come back when the figure changes; «Remove» forgets it, and so does «Forget» — and «Forget» says first how many playlists would lose tracks, and how many listens of your history would go: the playlist entries and the listens of tracks you also have here pass to your copy (specchio::archivio::altre_copie: same track_key, then the owner's content key), the others are lost with the device (frasiDelDimentica in lontano.ts). Removing rows — «Remove», a grace period that runs out, «Forget» — also takes them out of the saved queue, the «where you were» mark and the queue «Undo» would put back, in the same transaction (playback::sgombra_il_salvato) and then in the player: tracks.id is not AUTOINCREMENT, and a new track would take the id. «Forget» is in two steps: the device's rows are hidden at once — marked as gone, so nothing shows, plays or counts them, and the local tracks behind them show again — and then deleted in blocks of 2,000, each in a hold of the library lock of its own (comincia_a_dimenticare, dimentica_un_blocco); if the app closes in the middle, the next start finishes it (dispositivi_a_meta), and a device linked again in the middle stops the blocks. Only files on local and network folders are shared — no cloud folders, no catalog tracks (library/condivisa.rs) — and the owner's play count and like are shown read-only.

The owner reads its library for these answers — and the node's own thread reads its settings and devices — on a read-only SQLite connection of its own, opened for each request (stato::leggi_a_parte), and not behind the library mutex: in WAL a reader neither waits for a writer nor stops it, so a scan, the sound analysis or the enrichment running there — after a first scan, for hours — does not stall the answer. With the journal fallen back to TRUNCATE the answer waits for the mutex at most 5 s (ATTESA_LETTURA); a library still busy then answers lontano.irraggiungibile, which the other side retries, and the owner writes «[lontano] a request not served: the library is busy» in its diary, with the code and SQLite's cause and nothing about the request. Recording a listen is a write and always takes the mutex, with the same 5 s and the same diary line.

A row of another device plays as a stream (apri_riga_lontana in riproduzione/mod.rs): the bytes are read in 256 KiB blocks (DaLontano), and the file's version (size and date, read from the owner's disk) is fixed by the first block and shared by every opening of the same row — a file changed under the reader stops with lontano.fileCambiato instead of mixing two versions. Nothing is cached. Which copy plays is decided when it plays: the best one that answers, and with «Mobile data: No» on a metered network the one on this device. Autoplay, radio and smart playlists skip the devices that do not answer (the same presence list as Android Auto) and, on a metered network without «Yes», every other device (origine_che_suona: «Mobile data: No» or «Ask» leave only the rows of this device, and a copy here that «All» hides behind a better one on the PC shows again). The saved queue is only player.queue: the rows of the unified library are ordinary rows. The covers of other devices' tracks are saved in the local cover store (320 px) and replaced by the full-size one when the same file is scanned here. What comes from another device is not trusted like a tag: at most 1 MiB, only JPEG, PNG or WebP (decision D-32, also for «Listen together»), at most 1024 px a side read from the header before decoding, 32 MiB of decoder memory, and two decodes at a time in the whole process (covers::con_immagine_estranea) — a progressive 8192×8192 JPEG fits in 0.4 MiB and used to cost 577 MiB. The store keeps at most 256 MiB of them (SPAZIO_MASSIMO_ESTRANEE); beyond that new ones are neither asked for nor saved and the row keeps no picture until room is made («Forget» on the device removes its covers). A request for a cover does not stay «in flight» if the work falls over. The window asks for them when it shows a row; the system cards — Android Auto and its queue, the notification, the lock screen, the Windows media card — do not go through the window, so when the store has no cover for a row of another device they ask for it themselves, once per cover and in the background, with the same function (copertina_di_una_riga; media/lontane.rs: one request in flight per cover, nothing again for a minute if the device does not answer, a card published without the cover meanwhile) and publish the card again when it arrives; in the car queue only the covers already in the store and the next track's are asked for. The cache folder copertine-lontane holds only the covers of an «Ascolta insieme» session: at every start the files and folders earlier versions left there (flat <device>-<hash>.jpg files, <device>/ folders, the zeros folder of a session that died) are removed, once, if no session is running (lontano::sfoglia::ripulisci_le_copertine_di_prima), and nothing outside that folder is touched; «Forget» and «forget me» still delete a leftover copertine-lontane/<device>/. The covers of an «Ascolta insieme» session (insieme-<uid>, in memory) reach the system cards — the Windows media card and, on the phone, the notification, the lock screen and Android Auto — through a reserved folder of the copertine-lontane cache: the first time a card needs one it is written as <64 zeros>/<hash of the cover's token>.jpg (the hash, not the token, which is a read permission and must not end up in a content address that any media controller can read), and the folder is emptied when the session ends (insieme/su_file.rs). Only bytes that are a JPEG, PNG or WebP by their signature are kept and shown; every answer of rymembra-cover says X-Content-Type-Options: nosniff.

«Download here» — in the menu of a row, of an album card, or on an album page — copies the rows of other devices into this device's download folder (the same as catalog downloads), as <Artist>/<Album>/<NN - Title>.<ext> with the names cleaned like there: one queue and one thread per device, so a slow PC does not make the others wait, one file at a time in 2 MiB windows (MASSIMO_PEZZO), written as <name>.<ext>.<device>.part — the first eight characters of the sender's key, so two queues never write the same file — and renamed only when complete and synced. The name is taken at the end with an exclusive create, so a file that appeared meanwhile is never replaced: the same size means «already there» and the part is dropped, a different file stays and the new one takes « (2)». What the other device declares in its first answer is not taken on its word: the size must be close to the one in its catalog (at most half again and 16 MiB more, at least half), never zero and never above 8 GiB (TETTO_PER_FILE, also when the catalog knows no size); the file is then brought to that length before the first byte, so on NTFS a full disk says fs.diskFull at once instead of halfway through a track (on Android the file is sparse and the same error comes at the write), a longer answer does not grow the file, and a file that ends before its total is not a written track. Before a track, the parts left by an earlier stop of that device in the folder it is about to write to are removed. The progress strip shows one track at a time and «Cancel» stops them all. From 50 tracks up — an artist's whole page, a big playlist or selection — it asks first (SOGLIA_CONFERMA_SCARICO): a dialog says how many tracks would really go and how much space they take, with «Download» and «Cancel» (the focused one), using the owner's sizes from the mirror (lontano_scarica_anteprima, read-only, the same rows and the same rules as the queue; «at least» when the size of some is not known, no figure when none is). The request goes in blocks of 5000 (MASSIMI_PER_VOLTA), so an artist with more tracks than that is not refused. A file already there with the same size is skipped; a different one keeps its name and the new one takes « (2)». Only the audio extensions the scan reads are written (SUPPORTED_EXTENSIONS): a «track» the other device lists as .exe, .lnk, .url or desktop.ini is refused with fs.extensionRefused, and the notice at the end of the queue says so. When the last thread ends the download folder is scanned once, and the tracks become this device's own. Tracks of a CD image are not downloaded in this version. On Android a dataSync foreground service with its notification («3 of 12 · title», ScaricoInCorso) keeps the process alive with the screen off until the queues end.

A listen that counts is recorded on the owner: it goes to dispositivi_ascolti here and is sent as soon as the owner answers, with a key that makes a repeat harmless; the owner records it as its own play and scrobbles it. Nothing is counted on the device that played. The owner does not take it on trust: a start in the future counts as now, whether it counts is decided by the owner's own duration of the track, at most 120 listens an hour are accepted from each device (beyond that the sender keeps them queued and retries), and a late listen goes into the history with its own time without moving «last played» or the statistics clock back.

Listen together away from home

Linking with the QR also pairs the two devices for «Listen together»: each tells the other its X25519 key in the handshake — the presentation each side sends, Presentazione.chiave_insieme, when it asks and when it accepts — and not in the link, which carries only the QR owner's public key, the token, the addresses, the relay and the name; both write the key in insieme_pari — no four-digit code. The key is the one the other device declares, so the QR never unblocks a PC blocked by hand and never renames one already there (insieme::fidato_dal_qr); «Forget» takes the trust away again. A linked device whose presence says it is hosting becomes a neighbor of the «Listen together» thread (Vicinato::trovato_lontano), marked «via internet» in the panel; one that the LAN discovery also sees stays on the LAN. Joining, inviting, asking to enter and a member's own tracks then work as at home.

Underneath, rymembra-insieme speaks to a Presa — a byte stream with deadlines, try_clone and shutdown, implemented for TcpStream — and addresses a peer by Dove: Lan(ip:port) or Lontano(key). A Lontano connection is opened by the Strada that the app gives the network (lontano/insieme.rs): a QUIC connection of its own on the rymembra/insieme/1 ALPN, admitted only between linked keys, whose single bi-stream becomes a blocking Flusso. The Noise handshake runs inside it unchanged, against the paired key. Internet connections get wider timings (Tempi::via_internet: connect 15 s, handshake 10 s, silence 30 s, forwarded reads 20 s, the heartbeat unchanged); the host's caps count per device key instead of per IP; a member's clock keeps samples up to a 400 ms round trip instead of 100 ms.

Mobile data

On Android a metered network (isActiveNetworkMetered) gates playing and downloading another device's tracks, and joining, accepting, inviting or admitting in a «Listen together» session over the internet: with «Mobile data: Ask» (the default) the first gesture asks once, «Yes» allows it, «No» refuses with lontano.reteAConsumo. Only a gesture that starts from the window can be asked (the commands suona, radio, riprendi, alterna, prossimo, precedente and coda_vai, the same ones ipc.ts wraps in conIlSiDeiDatiMobili: their thread carries ConLaPagina); where nobody can answer — media keys, the notification, Android Auto, the track that follows, autoplay, radio, smart playlists — «Ask» counts as «No»: a track that exists only on another device is skipped (si_salta includes lontano.reteAConsumo and lontano.irraggiungibile, up to three in a row) instead of stopping the music, and a copy on this device is played at once. Presence and lists always pass. Windows never considers its network metered.

See also: Listen together on the LAN, Synchronization and calibration, What counts as a listen, Playing a catalog stream