Closed sodface closed 7 months ago
Can you upgrade your flac package to support ogg chaining?
Can you upgrade your flac package to support ogg chaining?
Is there a version that does or are you saying patch it? I haven't really been following this ogg chaining feature but there are still open PRs I see upstream for it:
https://github.com/xiph/flac/pull/261 https://github.com/xiph/flac/pull/667
1.4.3 plus this patch. https://sourceforge.net/projects/lmsclients/files/source/flac.patch
Using the updated flac would make the symbol available. It appears the musl dl loader is not happy with the way it's currently trapped.
I think the error is caused by this. https://github.com/ralph-irving/squeezelite/blob/c751ef146265c243cdbd7c0353dd0b70ab51730c/flac.c#L346-L350 This section traps the ogg error, but does not call dlerror(). dlerror will report whatever error occurred since it's last call. Since the next call to dlerror happens when mad is loading, that's when the error shows up. So perhaps not a musl specific problem either.
You could try this patch.
diff --git a/flac.c b/flac.c
index 4667461..c4e8bb4 100644
--- a/flac.c
+++ b/flac.c
@@ -346,9 +346,12 @@ static bool load_flac() {
// ignore error for this new API
f->FLAC__stream_decoder_set_ogg_chaining = dlsym(handle, "FLAC__stream_decoder_set_ogg_chaining");
if (!f->FLAC__stream_decoder_set_ogg_chaining) {
+ if ((err = dlerror()) != NULL) {
+ LOG_INFO("dlerror: %s", err);
+ }
LOG_INFO("OggFlac chaining disabled");
}
-
+
LOG_INFO("loaded %s", name);
#elif !defined(FLAC__OGG_CHAINING)
LOG_INFO("OggFlac chaining disabled");
Yes, that seems to fix it!
[10:56:47.085080] register_dsd:908 using dsd to decode dsf,dff
[10:56:47.085208] load_faad:633 loaded libfaad.so.2
[10:56:47.085217] register_faad:663 using faad to decode aac
[10:56:47.085452] load_vorbis:349 loaded libvorbisfile.so.3
[10:56:47.085460] register_vorbis:378 using vorbis to decode ogg
[10:56:47.085607] load_opus:294 loaded libopusfile.so.0
[10:56:47.085614] register_opus:324 using opus to decode ops
[10:56:47.085748] load_flac:350 dlerror: Symbol not found: FLAC__stream_decoder_set_ogg_chaining
[10:56:47.085757] load_flac:352 OggFlac chaining disabled
[10:56:47.085764] load_flac:355 loaded libFLAC.so.12
[10:56:47.085771] register_flac:385 using flac to decode ogf,flc
[10:56:47.085777] register_pcm:483 using pcm to decode aif,pcm
[10:56:47.085895] load_mad:394 loaded libmad.so.0
[10:56:47.085902] register_mad:423 using mad to decode mp3
[10:56:47.085909] decode_init:202 include codecs: exclude codecs:
[10:56:47.085957] discover_server:800 sending discovery
[10:56:47.087415] alsa_open:425 opened device default using format: S32_LE sample rate: 44100 mmap: 1
[10:56:47.087440] alsa_open:516 buffer: 40 period: 4 -> buffer size: 1764 period size: 441
[10:56:47.101356] slimproto:942 connected
[10:56:47.101388] sendHELO:150 cap: CanHTTPS=1,Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Balance=1,Firmware=v2.0.0-1481,ModelName=SqueezeLite,MaxSampleRate=384000,dsf,dff,aac,ogg,ops,ogf,flc,aif,pcm,mp3
@paul-1 Thanks for tracking down the problem.
1486 tested and working, please close at your discretion. Thanks for the support @paul-1 and @ralph-irving !
First reported on the slimdevices forum.
I updated squeezelite to latest master (1481) and subsequently couldn't natively playback mp3. Testing previous versions, 1479 is ok and then 1480 breaks.
1479:
1480:
I'm out of my depth here, but as a reminder, Alpine uses musl libc and there is a page that details some of the differences with glibc which may or may not be relevant:
https://wiki.musl-libc.org/functional-differences-from-glibc.html#Dynamic-linker
I'd appreciate any help and standing by to test. Thanks!!