/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See the file COPYING * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2017 Frank van Maarseveen */ #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "alsa.h" #define SEQWIN 80 // gracefully handle UDP broadcast buffer games (empirically determined) /* * UDP audio packets consists of * - 16 byte header * - 1400 byte audio data, optional. * * Audio data must be provided with 48kHz frame rate effectively. Absence of * audio data will put the audio device on pause without draining the queues. */ struct play_hdr { // 16 bytes char magic[3]; // "AU" uint8_t srcid; uint16_t vol[PLAY_NVOL]; uint32_t seq; }; static int prio; static int port = 13012; static int volid; static uint32_t lastseq; static const char silence[PLAY_CHUNKBYTES]; static const char * device = "hw:CODEC"; static struct play_param param; static const char usage[] = "Usage: %s [