Dynamic PCM switching in ALSA with multi room audio sync support

Aperta
#443 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
c, linux

Direzione di ricerca

The issue is a design question about switching PCM outputs without reopening the device while keeping snd_pcm_delay() latency stable, and it names no file or test. Start by reading the PCM API entry points that snd_pcm_delay() relies on, then decide what a working prototype would have to prove. It has no agreed scope, and no comments, so a newcomer should first ask the maintainers whether a change is wanted.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Challenges:
The PCM device is already opened by applications, making it difficult to switch to a new output seamlessly. Since most Music Service SDKs initialize the PCM device at startup, re-initializing it would require users to manually reopen their streaming app and re-select the device, negatively impacting the user experience.

Requirement:
User can switch between different audio output options (Line Out, Optical, USB Out, Bluetooth, etc.) at any time. The transition to a new output should be seamless, whether the user is currently playing a song from any music sources. Playback should resume on the newly selected output without requiring the user to manually reopen the content provider app and restart playback from the beginning.

Problems:

  1. Reopening the PCM
    Most music services open and configure the PCM device during initialization. Changing the PCM device (e.g., switching from Line Out to Optical Out) requires reopening it, which forces music services to reinitialize. This may require the end user to relaunch the respective app, reselect the device, and restart playback, impacting the user experience.
  2. Multiroom Sync
    Many music services that support multiroom synchronization rely on Linux ALSA APIs like snd_pcm_delay() to estimate the kernel buffer fill level and synchronize audio playback across devices. Any new approach to meet the requirements, should not disrupt this synchronization.

I've tried virtual loopback, PulseAudio, and a customized dswitch plugin. While all these methods enable dynamic PCM switching, I couldn't achieve stable long-term latency on the same PCM. Any guidance or suggestions on achieving stable long-term latency along with dynamic PCM switching would be greatly appreciated.

Lingua principale
C
Stelle
501
Fork
227
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di alsa-project/alsa-lib

Tutte le issue di alsa-project/alsa-lib

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.