diff --git a/Makefile.m1 b/Makefile.m1 index 0c132a4..4ca5fd5 100644 --- a/Makefile.m1 +++ b/Makefile.m1 @@ -1,7 +1,7 @@ # OSX 11.0+ arm64 only -OPTS = -DPORTAUDIO -DALAC -DOPUS -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -I./includem1 -I./includem1/opus -I./includem1/alac -arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 +OPTS = -DPORTAUDIO -DALAC -DOPUS -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -I./includem1 -I./includem1/opus -I./includem1/alac -arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 -LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -L./libm1 +LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 -L./libm1 LDADD = -lportaudio -lpthread -ldl -lm -framework CoreVideo -framework VideoDecodeAcceleration -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon diff --git a/flac.c b/flac.c index 8475c04..65ea4c8 100644 --- a/flac.c +++ b/flac.c @@ -123,6 +123,10 @@ *want = bytes; + // if there's nothing in the stream buffer, libFLAC will continuously call this function as quickly as possible. slow it down. + if (!bytes && !end) + usleep(1000); + return end ? FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM : FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; } diff --git a/opus.c b/opus.c index ee75476..1b80006 100644 --- a/opus.c +++ b/opus.c @@ -230,7 +230,6 @@ if (stream.state <= DISCONNECT) { LOG_INFO("partial decode"); UNLOCK_O_direct; - UNLOCK_S; return DECODE_COMPLETE; } else { LOG_INFO("no frame decoded"); diff --git a/output.c b/output.c index 99d4cc4..a5044fe 100644 --- a/output.c +++ b/output.c @@ -391,7 +391,7 @@ output.idle_to = (u32_t) idle; /* Skip test_open for stdout, set default sample rates */ - if ( output.device[0] == '-' ) { + if ( output.device[0] == '-' || user_rates ) { for (i = 0; i < MAX_SUPPORTED_SAMPLERATES; ++i) { output.supported_rates[i] = rates[i]; } @@ -400,12 +400,6 @@ if (!test_open(output.device, output.supported_rates, user_rates)) { LOG_ERROR("unable to open output device: %s", output.device); exit(0); - } - } - - if (user_rates) { - for (i = 0; i < MAX_SUPPORTED_SAMPLERATES; ++i) { - output.supported_rates[i] = rates[i]; } } diff --git a/output_alsa.c b/output_alsa.c index 125a737..edbbf42 100644 --- a/output_alsa.c +++ b/output_alsa.c @@ -297,6 +297,9 @@ if (snd_pcm_hw_params_test_rate(pcm, hw_params, ref[i], 0) == 0) { rates[ind++] = ref[i]; } + else { + LOG_DEBUG("sample rate %u not supported", ref[i]); + } } } diff --git a/output_pa.c b/output_pa.c index 96b135d..facbba0 100644 --- a/output_pa.c +++ b/output_pa.c @@ -214,6 +214,7 @@ #endif switch (err) { case paInvalidSampleRate: + LOG_DEBUG("sample rate %u not supported", ref[i]); continue; #if WIN #ifndef PA18API diff --git a/pcm.c b/pcm.c index 83d4e61..ac609f6 100644 --- a/pcm.c +++ b/pcm.c @@ -63,7 +63,7 @@ #define MAX_DECODE_FRAMES 4096 static u32_t sample_rates[] = { - 11025, 22050, 32000, 44100, 48000, 8000, 12000, 16000, 24000, 96000, 88200, 176400, 192000, 352800, 384000, 705600, 768000 + 11025, 22050, 32000, 44100, 48000, 8000, 12000, 16000, 24000, 96000, 88200, 176400, 192000, 352800, 384000, 705600, 768000, 1411200, 1536000 }; static u32_t sample_rate; diff --git a/squeezelite.h b/squeezelite.h index c86392c..e70d9a1 100644 --- a/squeezelite.h +++ b/squeezelite.h @@ -26,7 +26,7 @@ #define MAJOR_VERSION "1.9" #define MINOR_VERSION "9" -#define MICRO_VERSION "1386" +#define MICRO_VERSION "1392" #if defined(CUSTOM_VERSION) #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION) @@ -617,8 +617,8 @@ #define MONO_RIGHT 0x02 #define MONO_LEFT 0x01 -#define MAX_SUPPORTED_SAMPLERATES 18 -#define TEST_RATES = { 768000, 705600, 384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 22500, 16000, 12000, 11025, 8000, 0 } +#define MAX_SUPPORTED_SAMPLERATES 20 +#define TEST_RATES = { 1536000, 1411200, 768000, 705600, 384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 22500, 16000, 12000, 11025, 8000, 0 } struct outputstate { output_state state;