Browse Source

squeezelite: Move to new source repo, upgrade to 1.8.4-743, refresh patches

Signed-off-by: Ted Hess <thess@kitschensync.net>
lilik-openwrt-22.03
Ted Hess 9 years ago
parent
commit
b4fb194299
5 changed files with 124 additions and 106 deletions
  1. +5
    -5
      sound/squeezelite/Makefile
  2. +104
    -86
      sound/squeezelite/patches/010-select_broadcast_interface.patch
  3. +6
    -6
      sound/squeezelite/patches/020-no_mpg123.patch
  4. +1
    -1
      sound/squeezelite/patches/030-fix_musl_compatibilty.patch
  5. +8
    -8
      sound/squeezelite/patches/040-clear_dynlink_errors.patch

+ 5
- 5
sound/squeezelite/Makefile View File

@ -8,17 +8,17 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=squeezelite
PKG_VERSION:=1.8
PKG_RELEASE=2
PKG_VERSION:=1.8.4-743
PKG_RELEASE=1
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE.txt
PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://code.google.com/p/squeezelite/
PKG_SOURCE_URL:=https://github.com/ralph-irving/squeezelite.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8b8dfe6918ebe45ade5f3d9b68d453d7b8128d99
PKG_SOURCE_VERSION:=e37ed17fed9e11a7346cbe9f1e1deeccc051f42e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@ -32,7 +32,7 @@ define Package/squeezelite/default
CATEGORY:=Sound
TITLE:=Headless squeezebox emulator
PROVIDES:=squeezelite
URL:=https://code.google.com/p/squeezelite/
URL:=https://github.com/ralph-irving/squeezelite
DEPENDS:= +alsa-lib +SQUEEZELITE_RESAMPLE:libsoxr
MENU:=1
endef


+ 104
- 86
sound/squeezelite/patches/010-select_broadcast_interface.patch View File

@ -1,6 +1,6 @@
--- a/main.c
+++ b/main.c
@@ -69,6 +69,7 @@ static void usage(const char *argv0) {
@@ -78,6 +78,7 @@ static void usage(const char *argv0) {
#if IR
" -i [<filename>]\tEnable lirc remote control support (lirc config file ~/.lircrc used if filename not specified)\n"
#endif
@ -8,8 +8,8 @@
" -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n"
" -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n"
" -n <name>\t\tSet the player name\n"
@@ -197,6 +198,8 @@ int main(int argc, char **argv) {
char *modelname = NULL;
@@ -233,6 +234,8 @@ int main(int argc, char **argv) {
extern bool pcm_check_header;
char *logfile = NULL;
u8_t mac[6];
+ char *iface = NULL;
@ -17,15 +17,15 @@
unsigned stream_buf_size = STREAMBUF_SIZE;
unsigned output_buf_size = 0; // set later
unsigned rates[MAX_SUPPORTED_SAMPLERATES] = { 0 };
@@ -233,6 +236,7 @@ int main(int argc, char **argv) {
log_level log_ir = lWARN;
#endif
@@ -271,6 +274,7 @@ int main(int argc, char **argv) {
int maxSampleRate = 0;
+ memset(mac, 0, sizeof(mac));
char *optarg = NULL;
int optind = 1;
int i;
@@ -240,8 +244,6 @@ int main(int argc, char **argv) {
@@ -278,8 +282,6 @@ int main(int argc, char **argv) {
#define MAXCMDLINE 512
char cmdline[MAXCMDLINE] = "";
@ -34,7 +34,7 @@
for (i = 0; i < argc && (strlen(argv[i]) + strlen(cmdline) + 2 < MAXCMDLINE); i++) {
strcat(cmdline, argv[i]);
strcat(cmdline, " ");
@@ -249,7 +251,7 @@ int main(int argc, char **argv) {
@@ -287,7 +289,7 @@ int main(int argc, char **argv) {
while (optind < argc && strlen(argv[optind]) >= 2 && argv[optind][0] == '-') {
char *opt = argv[optind] + 1;
@ -43,7 +43,7 @@
#if ALSA
"UV"
#endif
@@ -334,6 +336,9 @@ int main(int argc, char **argv) {
@@ -382,6 +384,9 @@ int main(int argc, char **argv) {
case 'f':
logfile = optarg;
break;
@ -53,7 +53,7 @@
case 'm':
{
int byte = 0;
@@ -556,6 +561,11 @@ int main(int argc, char **argv) {
@@ -667,6 +672,11 @@ int main(int argc, char **argv) {
winsock_init();
#endif
@ -65,18 +65,18 @@
stream_init(log_stream, stream_buf_size);
if (!strcmp(output_device, "-")) {
@@ -599,7 +609,7 @@ int main(int argc, char **argv) {
@@ -710,7 +720,7 @@ int main(int argc, char **argv) {
exit(1);
}
- slimproto(log_slimproto, server, mac, name, namefile, modelname);
+ slimproto(log_slimproto, server, bcast_addr, mac, name, namefile, modelname);
- slimproto(log_slimproto, server, mac, name, namefile, modelname, maxSampleRate);
+ slimproto(log_slimproto, server, bcast_addr, mac, name, namefile, modelname, maxSampleRate);
decode_close();
stream_close();
--- a/squeezelite.h
+++ b/squeezelite.h
@@ -374,7 +374,7 @@ typedef enum { EVENT_TIMEOUT = 0, EVENT_
@@ -403,7 +403,7 @@ typedef enum { EVENT_TIMEOUT = 0, EVENT_
char *next_param(char *src, char c);
u32_t gettime_ms(void);
@ -85,18 +85,18 @@
void set_nonblock(sockfd s);
int connect_timeout(sockfd sock, const struct sockaddr *addr, socklen_t addrlen, int timeout);
void server_addr(char *server, in_addr_t *ip_ptr, unsigned *port_ptr);
@@ -426,7 +426,7 @@ void buf_init(struct buffer *buf, size_t
@@ -459,7 +459,7 @@ void buf_init(struct buffer *buf, size_t
void buf_destroy(struct buffer *buf);
// slimproto.c
-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname);
+void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t *mac, const char *name, const char *namefile, const char *modelname);
-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate);
+void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate);
void slimproto_stop(void);
void wake_controller(void);
--- a/slimproto.c
+++ b/slimproto.c
@@ -107,7 +107,7 @@ void send_packet(u8_t *packet, size_t le
@@ -119,7 +119,7 @@ void send_packet(u8_t *packet, size_t le
}
}
@ -105,7 +105,7 @@
const char *base_cap = "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION;
struct HELO_packet pkt;
@@ -730,7 +730,7 @@ void wake_controller(void) {
@@ -782,7 +782,7 @@ void wake_controller(void) {
wake_signal(wake_e);
}
@ -114,7 +114,7 @@
struct sockaddr_in d;
struct sockaddr_in s;
char *buf;
@@ -746,7 +746,7 @@ in_addr_t discover_server(void) {
@@ -798,7 +798,7 @@ in_addr_t discover_server(void) {
memset(&d, 0, sizeof(d));
d.sin_family = AF_INET;
d.sin_port = htons(PORT);
@ -123,16 +123,16 @@
pollinfo.fd = disc_sock;
pollinfo.events = POLLIN;
@@ -777,7 +777,7 @@ in_addr_t discover_server(void) {
@@ -829,7 +829,7 @@ in_addr_t discover_server(void) {
#define FIXED_CAP_LEN 256
#define VAR_CAP_LEN 128
-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname) {
+void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t *mac, const char *name, const char *namefile, const char *modelname) {
-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate) {
+void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate) {
struct sockaddr_in serv_addr;
static char fixed_cap[FIXED_CAP_LEN], var_cap[VAR_CAP_LEN] = "";
bool reconnect = false;
@@ -795,7 +795,7 @@ void slimproto(log_level level, char *se
@@ -849,7 +849,7 @@ void slimproto(log_level level, char *se
}
if (!slimproto_ip) {
@ -141,7 +141,7 @@
}
if (!slimproto_port) {
@@ -870,7 +870,7 @@ void slimproto(log_level level, char *se
@@ -924,7 +924,7 @@ void slimproto(log_level level, char *se
// rediscover server if it was not set at startup
if (!server && ++failed_connect > 5) {
@ -152,7 +152,7 @@
} else {
--- a/utils.c
+++ b/utils.c
@@ -21,11 +21,11 @@
@@ -22,11 +22,11 @@
#include "squeezelite.h"
#if LINUX || OSX || FREEBSD
@ -167,7 +167,7 @@
#include <net/if_dl.h>
#include <net/if_types.h>
#endif
@@ -33,15 +33,11 @@
@@ -44,15 +44,11 @@
#if WIN
#include <iphlpapi.h>
#endif
@ -185,42 +185,34 @@
// logging functions
const char *logtime(void) {
static char buf[100];
@@ -99,67 +95,101 @@ u32_t gettime_ms(void) {
@@ -114,58 +110,101 @@ u32_t gettime_ms(void) {
#endif
}
-// mac address
-#if LINUX
-#if LINUX && !defined(SUN)
-// search first 4 interfaces returned by IFCONF
-void get_mac(u8_t mac[]) {
- char *utmac;
- struct ifconf ifc;
- struct ifreq *ifr, *ifend;
- struct ifreq ifreq;
- struct ifreq ifs[4];
-
- mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
-
- int s = socket(AF_INET, SOCK_DGRAM, 0);
-
- ifc.ifc_len = sizeof(ifs);
- ifc.ifc_req = ifs;
-
- if (ioctl(s, SIOCGIFCONF, &ifc) == 0) {
- ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq));
-
- for (ifr = ifc.ifc_req; ifr < ifend; ifr++) {
- if (ifr->ifr_addr.sa_family == AF_INET) {
-
- strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
- if (ioctl (s, SIOCGIFHWADDR, &ifreq) == 0) {
- memcpy(mac, ifreq.ifr_hwaddr.sa_data, 6);
- if (mac[0]+mac[1]+mac[2] != 0) {
- break;
- }
+// Get broadcast address for interface (given or first available)
+// Return MAC address if none given
+#if LINUX || OSX || FREEBSD
+
- utmac = getenv("UTMAC");
- if (utmac)
- {
- if ( strlen(utmac) == 17 )
- {
- if (sscanf(utmac,"%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",
- &mac[0],&mac[1],&mac[2],&mac[3],&mac[4],&mac[5]) == 6)
- {
- return;
- }
- }
+in_addr_t get_iface_info(log_level level, char *iface, u8_t *mac) {
+ struct ifaddrs *addrs, *ifa;
+ struct sockaddr *sdl;
@ -240,11 +232,12 @@
+ {
+ if( strlen(iface) > sizeof(ifname) )
+ return -1;
+
+ strncpy(ifname, iface, sizeof(ifname));
+ have_ifname = 1;
+ }
+
}
- mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
+ if (getifaddrs(&addrs) == 0) {
+ //iterate to find corresponding ethernet address
+ for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
@ -256,7 +249,8 @@
+ {
+ continue;
+ }
+
- int s = socket(AF_INET, SOCK_DGRAM, 0);
+ if (!have_ifname)
+ {
+ // We have found a valid interface name. Keep it.
@ -267,39 +261,22 @@
+ {
+ // This is not the interface we're looking for.
+ continue;
}
}
- }
- }
+ }
+ }
- close(s);
-}
-#endif
- ifc.ifc_len = sizeof(ifs);
- ifc.ifc_req = ifs;
-#if OSX || FREEBSD
-void get_mac(u8_t mac[]) {
- struct ifaddrs *addrs, *ptr;
- const struct sockaddr_dl *dlAddr;
- const unsigned char *base;
-
- mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
-
- if (getifaddrs(&addrs) == 0) {
- ptr = addrs;
- while (ptr) {
- if (ptr->ifa_addr->sa_family == AF_LINK && ((const struct sockaddr_dl *) ptr->ifa_addr)->sdl_type == IFT_ETHER) {
- dlAddr = (const struct sockaddr_dl *)ptr->ifa_addr;
- base = (const unsigned char*) &dlAddr->sdl_data[dlAddr->sdl_nlen];
- memcpy(mac, base, min(dlAddr->sdl_alen, 6));
- if (ioctl(s, SIOCGIFCONF, &ifc) == 0) {
- ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq));
+ // Check address family.
+ if ((ifa->ifa_addr->sa_family == AF_INET) &&
+ (((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr != 0))
+ {
+ // Get broadcast address and MAC address
+ bcast_addr = ((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr;
break;
}
- ptr = ptr->ifa_next;
+ break;
+ }
+ else
+ {
+ // Address is not IPv4
@ -307,8 +284,17 @@
+ have_ifname = 0;
+ }
+
}
+
+ }
- for (ifr = ifc.ifc_req; ifr < ifend; ifr++) {
- if (ifr->ifr_addr.sa_family == AF_INET) {
-
- strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
- if (ioctl (s, SIOCGIFHWADDR, &ifreq) == 0) {
- memcpy(mac, ifreq.ifr_hwaddr.sa_data, 6);
- if (mac[0]+mac[1]+mac[2] != 0) {
- break;
- }
+ // Find MAC address matching interface
+ if (!have_mac && (bcast_addr != 0)) {
+ for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
@ -318,13 +304,14 @@
+ ptr = (unsigned char *)sdl->sa_data;
+ memcpy(mac, ptr + 10, 6);
+ have_mac = 1;
+ }
+ }
+ }
}
}
}
+
freeifaddrs(addrs);
+ freeifaddrs(addrs);
}
+
- close(s);
+ LOG_INFO("Interface: %s, broadcast: %08X, macaddr = %02x:%02x:%02x:%02x:%02x:%02x",
+ ifname, bcast_addr, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+
@ -333,6 +320,37 @@
#endif
+
#if SUN
void get_mac(u8_t mac[]) {
struct arpreq parpreq;
@@ -232,30 +271,6 @@ void get_mac(u8_t mac[]) {
}
#endif
-#if OSX || FREEBSD
-void get_mac(u8_t mac[]) {
- struct ifaddrs *addrs, *ptr;
- const struct sockaddr_dl *dlAddr;
- const unsigned char *base;
-
- mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
-
- if (getifaddrs(&addrs) == 0) {
- ptr = addrs;
- while (ptr) {
- if (ptr->ifa_addr->sa_family == AF_LINK && ((const struct sockaddr_dl *) ptr->ifa_addr)->sdl_type == IFT_ETHER) {
- dlAddr = (const struct sockaddr_dl *)ptr->ifa_addr;
- base = (const unsigned char*) &dlAddr->sdl_data[dlAddr->sdl_nlen];
- memcpy(mac, base, min(dlAddr->sdl_alen, 6));
- break;
- }
- ptr = ptr->ifa_next;
- }
- freeifaddrs(addrs);
- }
-}
-#endif
-
#if WIN
#pragma comment(lib, "IPHLPAPI.lib")
void get_mac(u8_t mac[]) {

+ 6
- 6
sound/squeezelite/patches/020-no_mpg123.patch View File

@ -20,7 +20,7 @@
LINKALL_IR = -llirc_client
--- a/decode.c
+++ b/decode.c
@@ -146,8 +146,8 @@ void decode_init(log_level level, const
@@ -147,8 +147,8 @@ void decode_init(log_level level, const
// try mad then mpg for mp3 unless command line option passed
if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
(!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
@ -33,7 +33,7 @@
--- a/main.c
+++ b/main.c
@@ -35,7 +35,8 @@
@@ -39,7 +39,8 @@
#else
#define CODECS_DSD ""
#endif
@ -45,7 +45,7 @@
--- a/squeezelite.h
+++ b/squeezelite.h
@@ -140,7 +140,7 @@
@@ -155,7 +155,7 @@
#if LINUX
#define LIBFLAC "libFLAC.so.8"
#define LIBMAD "libmad.so.0"
@ -54,7 +54,7 @@
#define LIBVORBIS "libvorbisfile.so.3"
#define LIBTREMOR "libvorbisidec.so.1"
#define LIBFAAD "libfaad.so.2"
@@ -154,7 +154,7 @@
@@ -169,7 +169,7 @@
#if OSX
#define LIBFLAC "libFLAC.8.dylib"
#define LIBMAD "libmad.0.dylib"
@ -63,7 +63,7 @@
#define LIBVORBIS "libvorbisfile.3.dylib"
#define LIBTREMOR "libvorbisidec.1.dylib"
#define LIBFAAD "libfaad.2.dylib"
@@ -167,7 +167,7 @@
@@ -182,7 +182,7 @@
#if WIN
#define LIBFLAC "libFLAC.dll"
#define LIBMAD "libmad-0.dll"
@ -72,7 +72,7 @@
#define LIBVORBIS "libvorbisfile.dll"
#define LIBTREMOR "libvorbisidec.dll"
#define LIBFAAD "libfaad2.dll"
@@ -180,7 +180,7 @@
@@ -195,7 +195,7 @@
#if FREEBSD
#define LIBFLAC "libFLAC.so.11"
#define LIBMAD "libmad.so.2"


+ 1
- 1
sound/squeezelite/patches/030-fix_musl_compatibilty.patch View File

@ -1,6 +1,6 @@
--- a/output_alsa.c
+++ b/output_alsa.c
@@ -862,8 +862,11 @@ void output_init_alsa(log_level level, c
@@ -911,8 +911,11 @@ void output_init_alsa(log_level level, c
LOG_INFO("memory locked");
}


+ 8
- 8
sound/squeezelite/patches/040-clear_dynlink_errors.patch View File

@ -1,6 +1,6 @@
--- a/faad.c
+++ b/faad.c
@@ -593,6 +593,8 @@ static bool load_faad() {
@@ -594,6 +594,8 @@ static bool load_faad() {
return false;
}
@ -11,7 +11,7 @@
a->NeAACDecOpen = dlsym(handle, "NeAACDecOpen");
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -590,6 +590,8 @@ static bool load_ff() {
@@ -620,6 +620,8 @@ static bool load_ff() {
return false;
}
@ -33,7 +33,7 @@
f->FLAC__stream_decoder_new = dlsym(handle, "FLAC__stream_decoder_new");
--- a/ir.c
+++ b/ir.c
@@ -167,10 +167,10 @@ static void *ir_thread() {
@@ -168,10 +168,10 @@ static void *ir_thread() {
UNLOCK_I;
wake_controller();
}
@ -46,7 +46,7 @@
return 0;
}
@@ -184,6 +184,8 @@ static bool load_lirc() {
@@ -185,6 +185,8 @@ static bool load_lirc() {
return false;
}
@ -57,7 +57,7 @@
i->lirc_readconfig = dlsym(handle, "lirc_readconfig");
--- a/mad.c
+++ b/mad.c
@@ -364,7 +364,9 @@ static bool load_mad() {
@@ -365,7 +365,9 @@ static bool load_mad() {
LOG_INFO("dlerror: %s", dlerror());
return false;
}
@ -70,7 +70,7 @@
m->mad_synth_init = dlsym(handle, "mad_synth_init");
--- a/mpg.c
+++ b/mpg.c
@@ -221,7 +221,9 @@ static bool load_mpg() {
@@ -222,7 +222,9 @@ static bool load_mpg() {
LOG_INFO("dlerror: %s", dlerror());
return false;
}
@ -83,7 +83,7 @@
m->mpg123_rates = dlsym(handle, "mpg123_rates");
--- a/resample.c
+++ b/resample.c
@@ -250,6 +250,8 @@ static bool load_soxr(void) {
@@ -251,6 +251,8 @@ static bool load_soxr(void) {
return false;
}
@ -94,7 +94,7 @@
r->soxr_create = dlsym(handle, "soxr_create");
--- a/vorbis.c
+++ b/vorbis.c
@@ -286,6 +286,8 @@ static bool load_vorbis() {
@@ -287,6 +287,8 @@ static bool load_vorbis() {
}
}


Loading…
Cancel
Save