Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support ARMv6 #179

Closed
GioF71 opened this issue Mar 10, 2023 · 33 comments
Closed

[Feature] Support ARMv6 #179

GioF71 opened this issue Mar 10, 2023 · 33 comments
Assignees
Labels
enhancement New feature or request

Comments

@GioF71
Copy link
Owner

GioF71 commented Mar 10, 2023

    Hello, i just tried to install this onto an old Raspberry Pi B+ without success. Is it possible to get this image compatible to ARM v6?

Originally posted by @CrimsonAC in #175 (comment)

@GioF71 GioF71 self-assigned this Mar 10, 2023
@GioF71 GioF71 added the enhancement New feature or request label Mar 10, 2023
@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

Can you try the image tagged as feature-f179b01-bullseye-squeezelite-1.9.8?
giof71/squeezelite:feature-f179b01-bullseye-squeezelite-1.9.8
Thanks

GioF71 added a commit that referenced this issue Mar 10, 2023
@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

Uhm not quite sure that this will be working, just let me work on it a little more.

@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

Sorry, can you tell me what does this command output?

uname -m

@CrimsonAC
Copy link

Sure. On my Pi B+ it outputs: armv61

I just pulled the image and was able to start the container. It seems to work, but i can't test ist completely because i think i have to configure a little bit to hear output through the Hifiberry Amp2.

Thanks for your work!

@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

I am happy to know that this works. Let me know if I can help with the configuration.
In order to build this version properly, I have two issues:

  1. No pulseaudio version for the sourceforce binary in the armel architecture: see here
    I currently have no way to skip building the sourceforce version by architecture
  2. Even accepting that a pulse version is missing as a sourceforge binary, when I build for the architecture linux/arm/v6, the uname -m command returns armv7l instead of the expected armv61 for some reasons I don't understand, so I cannot select the correct url to download. The downloaded version would probably not work.

This leaves me with two choices:

  1. Keep the armv6 version on a separate branch, build this branch only for armv6 and totally skip the sourceforce build
  2. Completely change to build process, downloading sourceforge versions anyway. So that would mean:

2a) Add a variable named PREFER_SOURCEFORGE_BINARY, which will run the sourceforge binary, if available. It will generally be the case, apart for the armv6 images
2b) Drop the -sourceforge images of course.

The initial obvious choice should be option 1, but I don't like to have to maintain two branches, so I will try to accomodate the situation down the road.

@CrimsonAC
Copy link

Oh dear, I'm sorry that i have caused such trouble with my request.
I know the crooks that come with keeping multiple branches up to date. So i can understand that 2 is the better solution for the future.

For the armv6 version on a Pi B+ with a Hifiberry Amp+ i can confirm that it works.
I have configured the sound devices in the /boot/config.txt on the host and after rebooting and restarting the container everything works fine.

GioF71 added a commit that referenced this issue Mar 10, 2023
GioF71 added a commit that referenced this issue Mar 10, 2023
@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

Glad to know it works.
However, you can probably avoid to change that config.txt at system level and just configure the container.
If you are willing to try that, please post the output of

aplay -l

If this works I will gladly add a preset for your card for easy configuration

GioF71 added a commit that referenced this issue Mar 10, 2023
GioF71 added a commit that referenced this issue Mar 10, 2023
GioF71 added a commit that referenced this issue Mar 10, 2023
GioF71 added a commit that referenced this issue Mar 10, 2023
@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

I also should have fixed the build process (not solution 2 yet), you might want to try the tag latest-armv6.
See here.

@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

These modifications are available in branch armv6

@CrimsonAC
Copy link

I don't know if it's possible to just configure the container.

aplay -l on my unmodified config.txt looks like this:
**** List of PLAYBACK Hardware Devices **** card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0

The Hifiberry Amp+ seems not to be present that way.
After disabling the default audio devices and adding the Amp+ via
dtoverlay=hifiberry-amp
the output looks like this:
**** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713.1-001b-0 [HifiBerry AMP HiFi tas5713.1-001b-0] Subdevices: 1/1 Subdevice #0: subdevice #0

@GioF71
Copy link
Owner Author

GioF71 commented Mar 10, 2023

Ok, so it's probably ok to leave it as it is :-)
Did you also configure the default audio device using raspi-config? That might explain something, like how can squeezelite play to that card instead of the built-in audio device?
Anyway if you want to try with the overlay but without changing the default audio device, you might want to add the variable SQUEEZELITE_AUDIO_DEVICE=hw:CARD=sndrpihifiberry,DEV=0
Unfortunately I don't have the same card to try

@GioF71
Copy link
Owner Author

GioF71 commented Mar 11, 2023

Hello, I have reviewed the build process and created a distinct workflow for sourceforge versions, which will not include a armv6 version.
So this way the regular version can include arm/v6, and the good news is that you can use the latest tag which should include a valid armv6 version.
Hope this works for you!

@CrimsonAC
Copy link

Hello, i will try the new container out next week and report back.

To your question from yesterday. I did not change anything else beforehand. I installed a fresh Pi OS, installed docker and pulled the image. And since the Hifiberry did not show up in aplay -l i did a little Goolge reasearch and found the solution with the /boot/config.txt

@CrimsonAC
Copy link

Pulling the image for armv6 with just giof71/squeezelite:latest is working fine.
I still have probably some configuration problems, but that has nothing to do with the image itself.

I witness a little bit of stuttering when a stream starts.
It doesn't matter if it is the start of a new song or for example after scanning through the track.
The first few milliseconds are stuttering.

I already tried different buffer sizes (1024, 4096, 8192), but it had no real effect.
Bigger buffers seem to be a little worse, which is kinda strange.

In the past i just used a pre-built image called Squeezeplug from Max2Play. I had no stuttering with that setup.
I cannot see the differences in the configuration of Squeezelite or ALSA itself, because i don't know where to look for them.
In the Squeezeplug web interface i can see additional ALSA Settings set like this: 80:4:: but i have no idea what that means.

Cheers

@GioF71
Copy link
Owner Author

GioF71 commented Mar 15, 2023

Hello @CrimsonAC, glad to hear that the image works... can you post you compose/run file?
Do similar configuration work properly on other platforms?

Thanks

@CrimsonAC
Copy link

My docker compose looks like this right now:
---
version: "3.3"

services:
squeezelite-hifiberry:
image: giof71/squeezelite:latest
container_name: squeezelite-hifiberry
devices:
- /dev/snd:/dev/snd
environment:
- SQUEEZELITE_NAME=Test_Squeete
- SQUEEZELITE_SERVER_PORT=192.168.2.10
restart: unless-stopped

I already tried with buffers:
- SQUEEZELITE_BUFFER_SIZE=4096

And also tried sampling rates out of desparation :)
- SQUEEZELITE_RATES="44100-192000"

What do you mean by 'similar configurations on other platforms'?
If i have tried the same setup on another Pi B+, to test another armv6 but to delete a possible hardware problem?
Or if i tested a Hifiberry Amp+ with that container but for example on a Pi 3?

I have not done that yet, but i could try soon.

@GioF71
Copy link
Owner Author

GioF71 commented Mar 15, 2023

Sorry, I meant with a different device using architecture arm/v7, arm64, amd64
Your configuration is very basic. Can you post the logs of the container?
Also, you might want to enable some sort of logging with a variable: SQUEEZELITE_LOG_CATEGORY_ALL
Possible values are info, debug or sdebug.

@CrimsonAC
Copy link

Ok, I've tried a few things now.
Squeezelite-Container on Pi B+ with Hifiberry Amp+ -> stuttering on track start or after scanning through track
Squeezelite-Container on Pi Zero (still armv6, right?) with Hifiberry MiniAmp -> same behaviour as above
Squeezelite-Container on Pi 3 (armv8/64) with Hifiberry MiniAmp -> works flawlessly

But the Pi B+ and Pi Zero work flawlessly as well with that aforementioned Max2Play Image.
Since i think it has to do with building up that buffer fast enough, maybe the armv6 Pi are to slow for dockerized stuff, or the other image has some optimizations for the Pi or the Squeezelite-Software for the older boards. I don't know.

Here are the container logs from the stuttering Pi Zero. They go on and on kinda indefinately. I scrolled down to a point where i guess all initialization work is done and it starts playing the track, since the kind of output repeats itself.

Setting default value for SQUEEZELITE_MODE: [ALSA]
Setting default value for STARTUP_DELAY_SEC: [0]
About to sleep for 0 second(s)
Ready to start.
Using ALSA mode
=== BEGIN Available audio devices ===
Output devices:
null - Discard all samples (playback) or generate zero samples (capture)
lavrate - Rate Converter Plugin Using Libav/FFmpeg Library
samplerate - Rate Converter Plugin Using Samplerate Library
speexrate - Rate Converter Plugin Using Speex Resampler
jack - JACK Audio Connection Kit
oss - Open Sound System
pulse - PulseAudio Sound Server
upmix - Plugin for channel upmix (4,6,8)
vdownmix - Plugin for channel downmix (stereo) with a simple spacialization
hw:CARD=sndrpihifiberry,DEV=0 - snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 - Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0 - snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 - Hardware device with all software conversions
default:CARD=sndrpihifiberry - snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 - Default Audio Device
sysdefault:CARD=sndrpihifiberry - snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 - Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0 - snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 - Direct sample mixing device
usbstream:CARD=sndrpihifiberry - snd_rpi_hifiberry_dac - USB Stream Output

=== END-- Available audio devices ===

=== BEGIN Loading presets ===
Loading built-in Presets...
Loading preset [no-dsd.exclude-codecs]=[dsd]
Loading preset [goldilocks.upsampling]=[v::4:28:95:105:45]
Loading preset [extremus.upsampling]=[v::3.05:28:99.7:100:45]
Loading preset [goldilocks_96k.rates]=[96000:200]
Loading preset [goldilocks_96k.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_2x_only.rates]=[88200,96000:200]
Loading preset [goldilocks_2x_only.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_4x_only.rates]=[176400,192000:200]
Loading preset [goldilocks_4x_only.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_8x_only.rates]=[352800,384000:200]
Loading preset [goldilocks_8x_only.upsampling]=[v::4:28:95:105:45]
Loading preset [rates_96k.rates]=[96000:200]
Loading preset [rates_up_to_96k.rates]=[44100-96000:200]
Loading preset [rates_up_to_192k.rates]=[44100-192000:200]
Loading preset [rates_up_to_384k.rates]=[44100-384000:200]
Loading preset [rates_up_to_768k.rates]=[44100-768000:200]
Loading preset [rates_2x_only.rates]=[88200,96000:200]
Loading preset [rates_4x_only.rates]=[176400,192000:200]
Loading preset [rates_8x_only.rates]=[352800,384000:200]
Loading preset [rates_16x_only.rates]=[705600,768000:200]
Loading preset [archimago-goldilocks.upsampling]=[v::4:28:95:105:45]
Loading preset [archimago-extremus.upsampling]=[v::3.05:28:99.7:100:45]
Loading preset [goldilocks_up_to_96k.rates]=[44100-96000:200]
Loading preset [goldilocks_up_to_96k.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_up_to_192k.rates]=[44100-192000:200]
Loading preset [goldilocks_up_to_192k.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_up_to_384k.rates]=[44100-384000:200]
Loading preset [goldilocks_up_to_384k.upsampling]=[v::4:28:95:105:45]
Loading preset [goldilocks_up_to_768k.rates]=[44100-768000:200]
Loading preset [goldilocks_up_to_768k.upsampling]=[v::4:28:95:105:45]
Loading preset [dac.device]=["hw:CARD=DAC"]
Loading preset [x20.device]=["hw:CARD=x20"]
Loading preset [aune-s6-sw.device]=["hw:CARD=DAC"]
Loading preset [aune-s6.device]=["hw:CARD=DAC"]
Loading preset [aune-s6.mixer-device]=["hw:CARD=DAC"]
Loading preset [aune-s6.volume-control]=["S6 USB DAC Output"]
Loading preset [aune-x1s.device]=["hw:CARD=DAC"]
Loading preset [fiio-e18.device]=["hw:CARD=DACE18"]
Loading preset [gustard-u12-sw.device]=["hw:CARD=x20"]
Loading preset [gustard-u12.device]=["hw:CARD=x20"]
Loading preset [gustard-u12.mixer-device]=["hw:CARD=x20"]
Loading preset [gustard-u12.volume-control]=["xCORE USB Audio 2.0 Output"]
Loading preset [gustard-x12-sw.device]=["hw:CARD=x20"]
Loading preset [gustard-x12.device]=["hw:CARD=x20"]
Loading preset [gustard-x12.mixer-device]=["hw:CARD=x20"]
Loading preset [gustard-x12.volume-control]=["xCORE USB Audio 2.0 Output"]
Loading preset [gustard-x12-goldilocks.device]=["hw:CARD=x20"]
Loading preset [gustard-x12-goldilocks.mixer-device]=["hw:CARD=x20"]
Loading preset [gustard-x12-goldilocks.volume-control]=["xCORE USB Audio 2.0 Output"]
Loading preset [gustard-x12-goldilocks.rates]=[44100-384000:200]
Loading preset [gustard-x12-goldilocks.upsampling]=[v::4:28:95:105:45]
Loading preset [gustard-x16.device]=["hw:CARD=G20"]
Loading preset [hifiberry-dac-plus.device]=["hw:CARD=sndrpihifiberry"]
Loading preset [ifi-zen-dac.device]=["hw:CARD=Audio"]
Loading preset [peachtree-dacit.device]=["hw:CARD=DAC"]
Loading preset [pi-headphones.device]=["hw:CARD=Headphones"]
Loading preset [topping-d10-sw.device]=["hw:CARD=D10"]
Loading preset [topping-d10.device]=["hw:CARD=D10"]
Loading preset [topping-d10.mixer-device]=["hw:CARD=D10"]
Loading preset [topping-d10.volume-control]=["D10 "]
Loading preset [topping-dx5.device]=["hw:CARD=DX5"]
Loading preset [topping-dx5.device]=["hw:CARD=E30"]
Loading preset [yulong-d200.device]=["hw:CARD=DAC"]
Finished loading built-in presets
No additional preset file found
There are [62] available presets
=== END-- Loading presets ===
Initializing command line: [/app/bin/squeezelite]
No presets have been specified
Variable SQUEEZELITE_SERVER_PORT has been specified: 192.168.2.10
Variable SQUEEZELITE_NAME has been specified: miniamp-test
Variable SQUEEZELITE_MODEL_NAME has not been specified
Variable SQUEEZELITE_TIMEOUT has not been specified, using default 2
Variable SQUEEZELITE_MAC_ADDRESS not specified
Variable SQUEEZELITE_AUDIO_DEVICE has not been specified
Variable SQUEEZELITE_MIXER_DEVICE has not been specified
Variable SQUEEZELITE_DELAY has not been specified, using default 500
Variable SQUEEZELITE_PARAMS has not been specified
Variable SQUEEZELITE_VOLUME_CONTROL not specified
Variable SQUEEZELITE_LINEAR_VOLUME not specified
Variable SQUEEZELITE_CODECS has not been specified
Variable SQUEEZELITE_EXCLUDE_CODECS has not been specified
Variable SQUEEZELITE_RATES not specified
Variable SQUEEZELITE_PRIORITY has not been specified
Variable SQUEEZELITE_UPSAMPLING not specified
Variable SQUEEZELITE_BUFFER_SIZE not specified
Variable SQUEEZELITE_STREAM_AND_OUTPUT_BUFFER_SIZE (DEPRECATED) not specified
Variable SQUEEZELITE_UNMUTE not specified
Variable SQUEEZELITE_VISUALIZER not specified
User mode disabled
Command Line: [/app/bin/squeezelite -s 192.168.2.10 -n miniamp-test -C 2 -D 500 -d all=sdebug]
[08:25:30.924598] stream_init:448 init stream
[08:25:30.946402] stream_init:449 streambuf size: 2097152
[08:25:30.972548] output_init_alsa:940 init output
[08:25:30.974246] output_init_alsa:979 requested alsa_buffer: 40 alsa_period: 4 format: any mmap: 1
[08:25:30.976373] output_init_common:353 outputbuf size: 3528000
[08:25:30.978889] output_init_common:377 idle timeout: 2000
[08:25:31.258774] output_init_common:425 supported rates: 768000 705600 384000 352800 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000
[08:25:31.261443] output_init_alsa:1004 unable to lock memory: Cannot allocate memory
[08:25:31.263045] output_init_alsa:1012 glibc detected using mallopt
[08:25:31.277446] output_init_alsa:1030 unable to set output sched fifo: Operation not permitted
[08:25:31.280150] decode_init:153 init decode
[08:25:31.283798] register_dsd:908 using dsd to decode dsf,dff
[08:25:31.286510] register_ff:797 using ffmpeg to decode alc
[08:25:31.288235] register_ff:781 using ffmpeg to decode wma,wmap
[08:25:31.290320] register_faad:663 using faad to decode aac
[08:25:31.291319] register_vorbis:380 using vorbis to decode ogg
[08:25:31.293465] register_flac:332 using flac to decode ogf,flc
[08:25:31.293883] register_pcm:483 using pcm to decode aif,pcm
[08:25:31.294205] register_mad:423 using mad to decode mp3
[08:25:31.294356] decode_init:194 include codecs: exclude codecs:
[08:25:31.295043] slimproto:893 connecting to 192.168.2.10:3483
[08:25:31.306895] slimproto:932 connected
[08:25:31.307909] sendHELO:148 mac: 02:42:ac:12:00:02
[08:25:31.308128] sendHELO:150 cap: CanHTTPS=1,Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=v1.9.8-1317,ModelName=SqueezeLite,MaxSampleRate=768000,dsf,dff,alc,wma,wmap,aac,ogg,ogf,flc,aif,pcm,mp3
[08:25:31.319650] process:527 strm
[08:25:31.320589] process_strm:280 strm command q
[08:25:31.320794] decode_flush:236 decode flush
[08:25:31.320931] output_flush:438 flush output buffer
[08:25:31.321071] sendSTAT:171 ms_played: 0
[08:25:31.321194] sendSTAT:195 STAT: STMf
[08:25:31.321313] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1109025 (diff: -1109025) device: 0 delay: 1109025
[08:25:31.322863] process:527 strm
[08:25:31.325289] process_strm:280 strm command q
[08:25:31.326190] decode_flush:236 decode flush
[08:25:31.326403] output_flush:438 flush output buffer
[08:25:31.326552] sendSTAT:171 ms_played: 0
[08:25:31.326680] sendSTAT:195 STAT: STMf
[08:25:31.326799] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1109031 (diff: -1109031) device: 0 delay: 1109031
[08:25:31.327081] process:527 setd
[08:25:31.327228] sendSETDName:254 set playername: miniamp-test
[08:25:31.327473] process:527 setd
[08:25:31.327683] process:527 aude
[08:25:31.327815] process_aude:421 enable spdif: 1 dac: 1
[08:25:31.328029] process:527 audg
[08:25:31.328162] process_audg:439 audg gainL: 0 gainR: 0 adjust: 1
[08:25:31.328288] set_volume:233 setting internal gain left: 0 right: 0
[08:25:32.011990] process:527 strm
[08:25:32.012245] process_strm:280 strm command t
[08:25:32.012391] sendSTAT:171 ms_played: 0
[08:25:32.012519] sendSTAT:195 STAT: STMt
[08:25:32.012641] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1109717 (diff: -1109717) device: 0 delay: 1109717
[08:25:37.072804] process:527 strm
[08:25:37.076517] process_strm:280 strm command t
[08:25:37.080125] sendSTAT:171 ms_played: 0
[08:25:37.081539] sendSTAT:195 STAT: STMt
[08:25:37.081829] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1114784 (diff: -1114784) device: 0 delay: 1114784
[08:25:40.964802] process:527 strm
[08:25:40.967646] process_strm:280 strm command q
[08:25:40.970288] decode_flush:236 decode flush
[08:25:40.970616] output_flush:438 flush output buffer
[08:25:40.970833] sendSTAT:171 ms_played: 0
[08:25:40.971018] sendSTAT:195 STAT: STMf
[08:25:40.971197] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1118675 (diff: -1118675) device: 0 delay: 1118675
[08:25:40.977894] process:527 audg
[08:25:40.979902] process_audg:439 audg gainL: 1937 gainR: 1937 adjust: 1
[08:25:40.980210] set_volume:233 setting internal gain left: 1937 right: 1937
[08:25:40.980553] process:527 strm
[08:25:40.980753] process_strm:280 strm command s
[08:25:40.980930] process_strm:349 strm s autostart: 1 transition period: 10 transition type: 0 codec: m
[08:25:40.981117] sendSTAT:171 ms_played: 0
[08:25:40.981295] sendSTAT:195 STAT: STMf
[08:25:40.981467] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1118685 (diff: -1118685) device: 0 delay: 1118685
[08:25:40.988313] codec_open:264 codec open: 'm'
[08:25:40.990040] connect_socket:158 connecting to 192.168.2.10:9000
[08:25:40.996559] stream_sock:591 header: GET /stream.mp3?player=02:42:ac:12:00:02 HTTP/1.0

[08:25:40.997986] sendSTAT:171 ms_played: 0
[08:25:40.998271] sendSTAT:195 STAT: STMc
[08:25:40.998460] sendSTAT:198 received bytesL: 0 streambuf: 0 outputbuf: 0 calc elapsed: 0 real elapsed: 1118702 (diff: -1118702) device: 0 delay: 1118702
[08:25:41.003942] send_header:125 wrote 53 bytes to socket
[08:25:41.009353] send_header:129 wrote header
[08:25:41.009736] process_strm:383 set fade mode: 0
[08:25:41.046577] process:527 audg
[08:25:41.046873] process_audg:439 audg gainL: 1937 gainR: 1937 adjust: 1
[08:25:41.047045] set_volume:233 setting internal gain left: 1937 right: 1937
[08:25:41.079456] stream_thread:325 headers: len: 491
HTTP/1.1 200 OK
Server: Logitech Media Server (8.3.0 - 1667251155)
Connection: close
Content-Type: audio/mpeg
Set-Cookie: Squeezebox-albumView=; path=/
Set-Cookie: Squeezebox-expandPlayerControl=true; path=/
Set-Cookie: Squeezebox-expanded-MY_MUSIC=1; path=/
Set-Cookie: Squeezebox-expanded-FAVORITES=1; path=/
Set-Cookie: Squeezebox-expanded-PLUGINS=1; path=/
Set-Cookie: Squeezebox-expanded-PLUGIN_MY_APPS_MODULE_NAME=1; path=/
Set-Cookie: Squeezebox-expanded-RADIO=0; path=/

[08:25:41.084120] sendRESP:226 RESP
[08:25:41.089823] stream_thread:422 streambuf read 89392 bytes
[08:25:41.220330] stream_thread:422 streambuf read 64096 bytes
[08:25:41.263255] stream_thread:422 streambuf read 402544 bytes
[08:25:41.320814] output_thread:687 open output device: default
[08:25:41.338554] alsa_open:351 opening device at: 44100
[08:25:41.361921] alsa_open:422 opened device default using format: S32_LE sample rate: 44100 mmap: 1
[08:25:41.393722] alsa_open:513 buffer: 40 period: 4 -> buffer size: 1764 period size: 441
[08:25:41.396275] stream_thread:422 streambuf read 259192 bytes
Plug PCM: Hardware PCM card 0 'snd_rpi_hifiberry_dac' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 32
buffer_size : 1764
period_size : 441
period_time : 10000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 441
period_event : 0
start_threshold : 1
stop_threshold : 1764
silence_threshold: 0
silence_size : 0
boundary : 1849688064
appl_ptr : 0
hw_ptr : 0
[08:25:41.526281] decode_thread:75 streambuf bytes: 815224 outputbuf space: 3527999
[08:25:41.530976] _output_frames:116 avail: 1764 frames: 1764 silence: 1
[08:25:41.531454] _output_frames:279 wrote 1764 frames
[08:25:41.534977] stream_thread:422 streambuf read 456120 bytes
[08:25:41.545586] _output_frames:116 avail: 452 frames: 452 silence: 1
[08:25:41.554019] _output_frames:279 wrote 452 frames
[08:25:41.554540] _check_lame_header:163 gapless: skip: 2257 samples: 9171036 delay: 1105 padding: 83
[08:25:41.555833] mad_decode:247 setting track_start
[08:25:41.556059] mad_decode:276 gapless: skipping 1152 frames at start
[08:25:41.556189] mad_decode:302 write 0 frames
[08:25:41.556327] decode_thread:75 streambuf bytes: 1269296 outputbuf space: 3527999
[08:25:41.557156] mad_decode:276 gapless: skipping 1105 frames at start
[08:25:41.557324] mad_decode:302 write 47 frames
[08:25:41.557469] decode_thread:75 streambuf bytes: 1268252 outputbuf space: 3527623
[08:25:41.558289] mad_decode:302 write 1152 frames
[08:25:41.558550] decode_thread:75 streambuf bytes: 1267208 outputbuf space: 3518407
[08:25:41.583367] ALSA snd_pcm_hw_delay:615 SNDRV_PCM_IOCTL_DELAY failed (-32)
[08:25:41.628911] output_thread:717 XRUN
[08:25:41.645586] _output_frames:116 avail: 1764 frames: 1764 silence: 1
[08:25:41.646020] _output_frames:279 wrote 1764 frames
[08:25:41.667693] _output_frames:116 avail: 900 frames: 900 silence: 1
[08:25:41.686535] stream_thread:422 streambuf read 477840 bytes
[08:25:41.687175] _output_frames:279 wrote 900 frames
[08:25:41.697368] mad_decode:302 write 1152 frames
[08:25:41.724796] ALSA snd_pcm_hw_delay:615 SNDRV_PCM_IOCTL_DELAY failed (-32)
[08:25:41.745895] output_thread:717 XRUN
[08:25:41.746263] _output_frames:116 avail: 1764 frames: 1764 silence: 1
[08:25:41.746612] _output_frames:279 wrote 1764 frames
[08:25:41.870287] _output_frames:116 avail: 1764 frames: 1764 silence: 1
[08:25:41.870721] _output_frames:279 wrote 1764 frames
[08:25:41.788733] stream_thread:422 streambuf read 234576 bytes
[08:25:41.888730] decode_thread:75 streambuf bytes: 1978579 outputbuf space: 3509191
[08:25:41.940732] mad_decode:302 write 1152 frames
[08:25:41.996535] _output_frames:116 avail: 1764 frames: 1764 silence: 1
[08:25:42.018848] _output_frames:279 wrote 1764 frames
[08:25:42.027479] stream_thread:422 streambuf read 113392 bytes
[08:25:42.029843] process:527 strm
[08:25:42.030090] process_strm:280 strm command t
[08:25:42.030236] sendSTAT:171 ms_played: 0
[08:25:42.030363] sendSTAT:195 STAT: STMt
[08:25:42.030485] sendSTAT:198 received bytesL: 2097152 streambuf: 2090926 outputbuf: 28024 calc elapsed: 0 real elapsed: 1119735 (diff: -1119735) device: 0 delay: 34
[08:25:42.032086] decode_thread:75 streambuf bytes: 2090926 outputbuf space: 3499975
[08:25:42.035242] mad_decode:302 write 1152 frames
[08:25:42.039815] _output_frames:64 start buffer frames: 4655
[08:25:42.058773] _output_frames:116 avail: 448 frames: 4655 silence: 0
[08:25:42.039370] stream_thread:422 streambuf read 7270 bytes
[08:25:42.075712] _output_frames:152 track start sample rate: 44100 replay_gain: 0
[08:25:42.080950] _output_frames:279 wrote 0 frames
[08:25:42.106540] sendSTAT:171 ms_played: 0
[08:25:42.111430] sendSTAT:195 STAT: STMs
[08:25:42.118119] sendSTAT:198 received bytesL: 2104422 streambuf: 2097151 outputbuf: 37240 calc elapsed: 0 real elapsed: 26 (diff: -26) device: 26 delay: 67
[08:25:42.132689] sendSTAT:171 ms_played: 0
[08:25:42.134181] sendSTAT:195 STAT: STMt
[08:25:42.149670] sendSTAT:198 received bytesL: 2104422 streambuf: 2097151 outputbuf: 37240 calc elapsed: 0 real elapsed: 52 (diff: -52) device: 26 delay: 93
[08:25:42.155996] output_thread:853 wrote 0 - sleeping
[08:25:42.158211] decode_thread:75 streambuf bytes: 2097151 outputbuf space: 3490759
[08:25:42.194486] mad_decode:302 write 1152 frames
[08:25:42.194812] decode_thread:75 streambuf bytes: 2096106 outputbuf space: 3481543
[08:25:42.212433] output_thread:717 XRUN
[08:25:42.217544] _output_frames:116 avail: 1764 frames: 5807 silence: 0
[08:25:42.234479] _output_frames:279 wrote 1764 frames
[08:25:42.257351] _output_frames:116 avail: 448 frames: 4043 silence: 0
[08:25:42.279998] _output_frames:279 wrote 448 frames
[08:25:42.297431] stream_thread:422 streambuf read 2090 bytes
[08:25:42.340670] output_thread:717 XRUN
[08:25:42.416863] _output_frames:116 avail: 1764 frames: 3595 silence: 0
[08:25:42.476137] _output_frames:279 wrote 1764 frames
[08:25:42.476456] mad_decode:302 write 1152 frames
[08:25:42.476713] decode_thread:75 streambuf bytes: 2097151 outputbuf space: 3504135
[08:25:42.477977] mad_decode:302 write 1152 frames
[08:25:42.478231] decode_thread:75 streambuf bytes: 2096106 outputbuf space: 3494919
[08:25:42.479507] mad_decode:302 write 1152 frames
[08:25:42.479762] decode_thread:75 streambuf bytes: 2095061 outputbuf space: 3485703
[08:25:42.480943] mad_decode:302 write 1152 frames
[08:25:42.481188] decode_thread:75 streambuf bytes: 2094016 outputbuf space: 3476487
[08:25:42.482358] mad_decode:302 write 1152 frames
[08:25:42.482606] decode_thread:75 streambuf bytes: 2092971 outputbuf space: 3467271
[08:25:42.483781] mad_decode:302 write 1152 frames
[08:25:42.484027] decode_thread:75 streambuf bytes: 2091927 outputbuf space: 3458055
[08:25:42.492906] mad_decode:302 write 1152 frames
[08:25:42.495128] decode_thread:75 streambuf bytes: 2090882 outputbuf space: 3448839
[08:25:42.497278] mad_decode:302 write 1152 frames
[08:25:42.499469] decode_thread:75 streambuf bytes: 2089837 outputbuf space: 3439623
[08:25:42.501540] mad_decode:302 write 1152 frames
[08:25:42.504148] _output_frames:116 avail: 448 frames: 12199 silence: 0
[08:25:42.506074] _output_frames:279 wrote 448 frames
[08:25:42.508368] decode_thread:75 streambuf bytes: 2088792 outputbuf space: 3433991
[08:25:42.510713] mad_decode:302 write 1152 frames
[08:25:42.512902] decode_thread:75 streambuf bytes: 2087747 outputbuf space: 3424775
[08:25:42.515002] mad_decode:302 write 1152 frames
[08:25:42.518671] decode_thread:75 streambuf bytes: 2086702 outputbuf space: 3415559
[08:25:42.521757] mad_decode:302 write 1152 frames
[08:25:42.523171] _output_frames:116 avail: 880 frames: 15207 silence: 0
[08:25:42.525436] _output_frames:279 wrote 880 frames
[08:25:42.526571] decode_thread:75 streambuf bytes: 2085657 outputbuf space: 3413383
[08:25:42.529713] mad_decode:302 write 1152 frames
[08:25:42.530849] decode_thread:75 streambuf bytes: 2084612 outputbuf space: 3404167
[08:25:42.533908] mad_decode:302 write 1152 frames
[08:25:42.536292] decode_thread:75 streambuf bytes: 2083567 outputbuf space: 3394951
[08:25:42.538502] mad_decode:302 write 1152 frames
[08:25:42.546920] _output_frames:116 avail: 884 frames: 17783 silence: 0
[08:25:42.547321] _output_frames:279 wrote 884 frames
[08:25:42.548463] decode_thread:75 streambuf bytes: 2082522 outputbuf space: 3392807
[08:25:42.549754] mad_decode:302 write 1152 frames
[08:25:42.550023] decode_thread:75 streambuf bytes: 2081478 outputbuf space: 3383591
[08:25:42.551192] mad_decode:302 write 1152 frames
[08:25:42.551440] decode_thread:75 streambuf bytes: 2080433 outputbuf space: 3374375
[08:25:42.552691] mad_decode:302 write 1152 frames
[08:25:42.552953] decode_thread:75 streambuf bytes: 2079388 outputbuf space: 3365159
[08:25:42.554098] mad_decode:302 write 1152 frames
[08:25:42.554349] decode_thread:75 streambuf bytes: 2078343 outputbuf space: 3355943
[08:25:42.563347] stream_thread:422 streambuf read 19853 bytes
[08:25:42.564208] _output_frames:116 avail: 880 frames: 21507 silence: 0
[08:25:42.565077] _output_frames:279 wrote 880 frames
[08:25:42.567606] mad_decode:302 write 1152 frames

@GioF71
Copy link
Owner Author

GioF71 commented Mar 16, 2023

Ok not a lot to see from the logs here, apart from this:
ALSA snd_pcm_hw_delay:615 SNDRV_PCM_IOCTL_DELAY failed (-32)
which I do not fully understand unfortunately.
I would try doing these steps

download this version: https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.9.9.1419-armel.tar.gz/download

uncompress it and mount the folder to a path (example: my-binary where your docker-compose file is) on your container through a volume.
Example:

---
version: "3.3"

services:
  squeezelite-hifiberry:
    image: giof71/squeezelite:latest
    container_name: squeezelite-hifiberry
    devices:
      - /dev/snd:/dev/snd
    environment:
      - SQUEEZELITE_NAME=Test_Squeete
      - SQUEEZELITE_SERVER_PORT=192.168.2.10
    volumes:
      - ./my-binary:/my-binary:ro
    restart: unless-stopped

start the container as usual, then do:

docker-compose exec squeezelite-hifiberry bash

you should be dropped to /app/bin

now replace the binary "squeezelite" with the one you just downloaded.
Say you mounted to /my-binary you should execute:

mv /my-binary/squeezelite /app/bin/squeezelite

Now make sure the binary is executable. Just execute:

chmod 755 squeezelite

exit the shell (CTRL-D)

restart the container, without recreating it (or your changes would be reverted):

docker-compose restart

See if this changes something! Fingers crossed

@CrimsonAC
Copy link

Thanks again for your support. I really appreciate that.

Unfortunately, swapping the squeezlite binary inside the container has no positive effect.

But that triggered an idea i didn't have before, i do not know why ;-)
I started the downloaded squeezlite on the pi itself with the parameters from the container log:
squeezelite -s 192.168.2.10 -n Test -C 2 -D 500

And it works. No stuttering, noticeable better reaction time to user input.
So i think, those old little armv6 Pi are just to weak for containerization. or?

@GioF71
Copy link
Owner Author

GioF71 commented Mar 16, 2023

Glad to hear that!
About your question, yes, it might be. If you look at the code that runs squeezelite on the container, you will see that there's not a lot there: it just runs the binary with the appropriate command line. So if it slower, it should be safe to assume that this is containerization overhead, which might be significant a armv6 raspberry pi.

So do you plan on running squeezelite natively on that board?

@CrimsonAC
Copy link

Yeah, i guess i'll have to do that.
Right now, i have 5 old Pi B+ that run my multi-room audio with the Max2Play image. But there is so much stuff with that image, that i do not need at all, i wanted to slim this down. I had a few instances in the past years where that thing just did not want to boot anymore. Only reflashing and reconfiguring solved that.
So i wanted to have something nice manageable via docker.
But i think, squeezelite just natively on the Pi is ok as well.

@GioF71
Copy link
Owner Author

GioF71 commented Mar 16, 2023

Ok good to hear.
Just one last chance if you are willing to try... have you installed docker from their repository, or from the standard debian repositories? You might want to remove the existing docker and try with apt-get install docker.io if you installed from the docker repos, or viceversa, maybe there is some difference.

@CrimsonAC
Copy link

I used the get-docker.sh script from https://get.docker.com
I have no clue from what repo this pulls or if there are differences between docker in debian or from docker.io.
But maybe i can try tomorrow.

@GioF71
Copy link
Owner Author

GioF71 commented Mar 16, 2023

And, another thing, maybe more interesting than the prior, has to do with the build process.
The image is built with an emulator and that sometimes has issues. For example I cannot reliably cross-compile and build images with rust binaries on my librespot-docker repo.
Maybe you can build the container yourself?
You can just run the build.sh script like:

./build.sh -t local

that will result in an image named giof71/squeezelite:local.
Maybe that image will be better with your plaform. Unfortunately I cannot try it myself.

@CrimsonAC
Copy link

Wow, it took about half an hour to build the container on that old Pi.
But no change to the initial problem.

But as i have said, i thought the buffering between LMS and the Squeezelite Player is what causes the issue.
So i tried a few different settings with SQUEEZELITE_BUFFER_SIZE.
Increasing the buffer seemed to make it worse, but decreasing it did not solve it completely.
And a buffer that is too small could lead to some more problems down the road in production use, i think.

So i went over to those additional ALSA parameter with SQUEEZELITE_PARAMS.
I went for the "80:4::" that i could see in my other running Squeeze instances. Did not change much.

But while i was testing and changing and evaluating, it has gotten way better. In fact the stuttering is now gone.
So i tried to reproduce the steps, even flashed a whole new SD card, installed everything and so on.
Took a docker compose with no changes to buffer, ALSA, like on my very first try... and it works!

Then i felt quite stupid, because i forgot one of THE IT rules ;-)
At some time yesterday, can't remember when exactly, i restarted the LMS container on my server.
I think that was the point the problem went away. Maybe that thing was up for too long and just needed a little nap.

Sorry for all the hassle, but at least i learned a few things along the way with containers. And your armv6 container can indeed be useful for others, that may have some old Pis lying around.

Thank you very much!

@GioF71
Copy link
Owner Author

GioF71 commented Mar 17, 2023

Hello, I'am happy that this works for you now! So the binary worked because you restarted lms...
No worries, no hassle, we now have a possibly working arm/v6 version that wasn't there before, and no separate branches, I am happy with this.
If you want, please consider giving a star to the repo.
And close the issue if it's done.

Cheers

@CrimsonAC
Copy link

I think you opened the issues yourself after my post in the Discussions section. At least i cannot find a button/option to close it.
But yes, issue is solved, repo has one more star and i wish you all the best.

Cheers

@GioF71
Copy link
Owner Author

GioF71 commented Mar 17, 2023

Thank you so much, all the best for you as well!

@GioF71 GioF71 closed this as completed Mar 17, 2023
@GioF71
Copy link
Owner Author

GioF71 commented Sep 1, 2023

Hello @CrimsonAC , today I have removed some old images with the "-armv6" substring from Docker Hub. You probably already know that the current images (minus the sourceforge version) all support armv5 which should be ok for you. Please tell me if this is the case, otherwise I might rebuild (and leave available) a custom image. Cheers.

EDIT: typo, now -> know

@GioF71
Copy link
Owner Author

GioF71 commented Sep 1, 2023

Sorry @CrimsonAC I forgot that in the end you probably did not even need the arm/v6 version.

@CrimsonAC
Copy link

That's right. In the end, the little problems i had, have been the LMS itself and not the Pi Zero or your image.
Right now i have already installed 5 Pi Zeros with your image. Two more are still to come, as soon as the ceilings in the two other rooms are completed. Working perfectly right now.
Thanks again for the project and your support.

@GioF71
Copy link
Owner Author

GioF71 commented Sep 1, 2023

Would you like to post some photos of your setup? Of course if this is no trouble.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants