Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Playback of mp3 via smb-share is stuttering
#1
Hi all,

this is my setup: 

Device: HiFiBerry Amp2/4
Chip: Burr Brown TAS5756M
Pi model: Pi-4B 1.2 4GB 

After updating from 9.3.3 to 9.3.6 playing mp3 (320kbs or 192kbs; 44,1 kHz) from my smb-share become utterly stuttering. Playing the same files from local sdcard or usb works fine. If I play flacs (16bit, 48kHz) from same smb-share, there are no issues as well. Issues are just with mp3s. 

Did update to 9.3.7, respectively did a fresh install with 9.3.7 with no change, still the same issues. Turned SoX Resampling on and off, no change. Changed from Ethernet to Wifi, still the same... Is there anything else I can try?

This is my startup log: 

Code:
20250701 043932 worker: --
20250701 043932 worker: -- Start moOde 9 series
20250701 043932 worker: --
20250701 043932 worker: Daemonize:     complete
20250701 043932 worker: Linux startup: complete
20250701 043932 worker: Boot config:   ok
20250701 043932 worker: Boot folder:   ok
20250701 043932 worker: Radio table:   ok
20250701 043933 worker: PHP session:   cleaned
20250701 043933 worker: PHP session:   loaded
20250701 043936 worker: Package locks: applied
20250701 044003 worker: File check:    complete
20250701 044003 worker: Log to RAM:    on
20250701 044003 worker: Tmp to RAM:    on
20250701 044003 worker: Debug logging: off
20250701 044003 worker: --
20250701 044003 worker: -- System
20250701 044003 worker: --
20250701 044005 worker: Host name:     moode
20250701 044005 worker: RPi model:     Pi-4B 1.2 4GB
20250701 044005 worker: moOde release: 9.3.7 2025-06-26
20250701 044005 worker: RaspiOS:       12.11 Bookworm 64-bit
20250701 044005 worker: Linux Kernel:  6.12.25 64-bit
20250701 044005 worker: MPD version:   0.24.4
20250701 044005 worker: User id:       pi
20250701 044005 worker: Home folder:   /home/pi
20250701 044005 worker: Time zone:     America/Detroit
20250701 044005 worker: Kbd layout:    us
20250701 044005 worker: HDMI ports(s): on
20250701 044005 worker: HDMI-CEC:      off
20250701 044005 worker: Sys LED0:      on
20250701 044005 worker: Sys LED1:      on
20250701 044005 worker: Reduce power:  n/a
20250701 044005 worker: Fan control:   n/a
20250701 044005 worker: CPU governor:  ondemand
20250701 044005 worker: --
20250701 044005 worker: -- Network
20250701 044005 worker: --
20250701 044005 worker: Eth0
20250701 044005 worker: Ethernet: adapter exists
20250701 044005 worker: Ethernet: timeout off
20250701 044005 worker: Ethernet: method  dhcp
20250701 044005 worker: Ethernet: address 192.168.178.24
20250701 044005 worker: Ethernet: netmask 255.255.255.0
20250701 044005 worker: Ethernet: gateway 192.168.178.1
20250701 044005 worker: Ethernet: pri DNS 192.168.178.33
20250701 044005 worker: Ethernet: domain  fritz.box
20250701 044005 worker: Wlan0
20250701 044005 worker: Wireless: adapter exists
20250701 044005 worker: Wireless: country US
20250701 044005 worker: Wireless: SSID    None
20250701 044005 worker: Wireless: other   None
20250701 044005 worker: mDNS
20250701 044005 worker: Discover: IPv4 and IPv6
20250701 044005 worker: --
20250701 044005 worker: -- File sharing
20250701 044005 worker: --
20250701 044005 worker: SMB file sharing:  off
20250701 044005 worker: SMB password:      none
20250701 044005 worker: NFS file sharing:  off
20250701 044005 worker: DLNA file sharing: off
20250701 044005 worker: --
20250701 044005 worker: -- Special configs
20250701 044005 worker: --
20250701 044005 worker: Plexamp:          not installed
20250701 044005 worker: RoonBridge:       not installed
20250701 044005 worker: Allo Boss 2:      not detected, OLED script ok
20250701 044005 worker: Allo Piano 2.1:   not detected
20250701 044005 worker: IQaudIO DigiAMP+: not detected
20250701 044005 worker: RPi DigiAMP+:     not detected
20250701 044005 worker: Bluetooth:        session vars ok
20250701 044005 worker: --
20250701 044005 worker: -- ALSA debug
20250701 044005 worker: --
20250701 044005 worker: Cards:  0:vc4hdmi0        1:vc4hdmi1        2:sndrpihifiberry 3:empty          
20250701 044005 worker:         4:empty           5:empty           6:empty           7:empty          
20250701 044006 worker: Mixers: 0:(PCM)           1:none            2:(Digital)       3:none            
20250701 044006 worker:         4:none            5:none            6:none            7:none            
20250701 044006 worker: --
20250701 044006 worker: -- Audio configuration
20250701 044006 worker: --
20250701 044006 worker: Audio device:  2:HiFiBerry Amp2/4
20250701 044006 worker: ALSA card:     has not been reassigned
20250701 044006 worker: MPD config:    update not needed
20250701 044006 worker: ALSA output:   I2S
20250701 044006 worker: ALSA mode:     Default (plughw)
20250701 044006 worker: ALSA mixer:    Digital
20250701 044006 worker: ALSA volume:   100% (0.00dB)
20250701 044006 worker: ALSA maxvol:   100%
20250701 044006 worker: ALSA loopback: off
20250701 044006 worker: MPD mixer      Software
20250701 044006 worker: Integ audio:   vc4-kms-v3d
20250701 044006 worker: Audio formats: S16_LE, S24_LE, S32_LE
20250701 044006 worker: CamillaDSP:    off
20250701 044006 worker: CDSP volume:   0dB
20250701 044006 worker: CDSP volrange: 60dB
20250701 044006 worker: --
20250701 044006 worker: -- MPD startup
20250701 044006 worker: --
20250701 044007 worker: MPD service:        started
20250701 044007 worker: MPD port 6600:      accepting connections
20250701 044007 worker: MPD ALSA Default:   on
20250701 044007 worker: MPD ALSA Bluetooth: off
20250701 044007 worker: MPD HTTP Server:    off
20250701 044007 worker: MPD volume:         1
20250701 044007 worker: Saved MPD vol:      -1
20250701 044007 worker: Saved SRC vol:      0
20250701 044007 worker: MPD crossfade:      off
20250701 044007 worker: MPD ignore CUE:     no
20250701 044007 worker: MPD CDSP volsync:   off
20250701 044007 worker: MPD DB stats:       Tracks:24 | Albums:4 | Artists:4
20250701 044007 worker: --
20250701 044007 worker: -- Music sources
20250701 044007 worker: --
20250701 044007 worker: USB drives:     none
20250701 044007 worker: NVMe drives:    none
20250701 044007 worker: SATA drives:    none
20250701 044007 worker: NAS source:     test (smb)
20250701 044022 worker: --
20250701 044022 worker: -- Feature availability
20250701 044022 worker: --
20250701 044022 worker: Input select:    available, Source: MPD, Output: HiFiBerry Amp2/4
20250701 044022 worker: Bluetooth:       available, PIN: None, ALSA/CDSP maxvol: 100%/0dB, ALSA outmode: Standard
20250701 044022 worker: AirPlay:         available
20250701 044022 worker: Spotify Connect: available
20250701 044022 worker: Deezer Connect:  n/a
20250701 044022 worker: Squeezelite:     available
20250701 044022 worker: UPnP client:     available
20250701 044022 worker: Plexamp:         not installed, ALSA maxvol: 100%
20250701 044022 worker: RoonBridge:      not installed
20250701 044022 worker: Multiroom:       available
20250701 044022 worker: GPIO buttons:    available
20250701 044022 worker: Stream recorder: n/a
20250701 044022 worker: --
20250701 044022 worker: -- Security
20250701 044022 worker: --
20250701 044022 worker: Web SSH server:    off
20250701 044022 worker: XSS detection:     off
20250701 044022 worker: HTTPS mode:        available
20250701 044022 worker: --
20250701 044022 worker: -- Peripherals
20250701 044022 worker: --
20250701 044023 worker: Local display:   off
20250701 044023 worker: Chromium ver:    126.0.6478.164-rpt1
20250701 044023 worker: Chromium cfg:    directory /home/pi/.config does not exist
20250701 044023 worker: Screen blank     600
20250701 044023 worker: On-screen kbd:   off
20250701 044023 worker: Disable GPU:     off
20250701 044023 worker: HDMI orient:     landscape
20250701 044023 worker: HDMI 4K 60Hz:    off
20250701 044023 worker: DSI scn type:    none
20250701 044023 worker: DSI port:        1
20250701 044023 worker: DSI brightness:  255
20250701 044023 worker: DSI rotate:      0
20250701 044023 worker: Rotary encoder:  off
20250701 044023 worker: Triggerhappy:    off
20250701 044023 worker: LCD updater:     off
20250701 044023 worker: --
20250701 044023 worker: -- Miscellaneous
20250701 044023 worker: --
20250701 044023 worker: Software update:   Automatic check off
20250701 044023 worker: Auto-CoverView:    off
20250701 044023 worker: CoverView timeout: Never
20250701 044023 worker: Auto-shuffle:      off
20250701 044023 worker: Auto-play:         off
20250701 044023 worker: Maintenance task:  360 mins
20250701 044023 worker: Current view:      reset to Playback
20250701 044023 worker: Active flags:      all false
20250701 044023 worker: Reset flags:       skipped
20250701 044023 worker: Session check:     ok
20250701 044023 worker: --
20250701 044023 worker: -- Startup complete
20250701 044023 worker: --
20250701 044023 worker: Mount monitor:    started
20250701 044023 worker: Radio monitor:    off
20250701 044023 worker: Watchdog monitor: started
20250701 044023 worker: Responsiveness:   Default
20250701 044023 worker: Ready


Best,
kynr
Reply
#2
Very odd.

A quick test on my end and no issues playing mp3 files.

Run a ping test from your Pi to the NAS and see if the round trip times are reasonable and consistent. For NAS and Pi both on Ethernet they should be < 1ms. For Pi on WiFi prolly 3 - 4ms
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Hi Tim,
thanks for the tip with checking the ping, which is okay for both Ethernet and WiFi. Connection speed and stability is also alright.
I would assume that problems with ping and connection would lead to issues with other, larger files like flacs as well.

What I also tried:

- Mounting the smb-share with another machine (debian) on the same network: no issues playing mp3s or flacs (VLC-Player, Clementine-Player).
- New smb-share on another machine: same issue with playing mp3s with moodeaudio.
- Transcoding mp3 (320kbs; 44,1 kHz) to flac: no issues while playing these flacs with moodeaudio. Would be not an option for me due to bloating the files.
- Remuxing mp3 to mka: no issues playing these files with moodeaudio. This could be an option though I have to check, if metadata is consistent (first impression: embedded album covers are not shown, although are present in my mka-files).
- Stripping all describing metadata from mp3: stuttering when playing with moodeaudio.

This shows me, if the problem is the files, it's not the codec, (probably) not the metadata but the container.

For my specific problem, a workaround could be to remux my mp3 collection to mka. But as far as I see, the issue with mp3 still consists and at the moment, I don't know why...
Reply
#4
As Tim says, very odd.


It’s the underlying Raspberry Pi OS (e.g, Linux) that handles all the connecting and mounting of remote SMB shares. To moOde, the resulting local directory and the files it contains are indistinguishable from actual local directories and files.

You said this stuttering began when you upgraded from 9.3.3 to 9.3.6. Looking through the release notes, I see that with 9.3.4, the kernel was updated to 6.12.25. If.you really want to, you could try installing first 9.3.3 and then 9.3.4 to see if that’s where the stuttering starts. (Previous releases are available on the github repro.)

Incidentally, you can check the MPD log (/var/log/mpd/log) to see if underrun messages are being thrown by MPD while the stuttering is occurring. Note: I don’t recall if you have to increase the MPD logging level to Verbose to see these. 

Some folks on this forum have suggested that increasing the size of the MPD audio buffer and/or enabling its input cache can help alleviate this. I have no experience doing this so can’t comment.  

Out of idle curiosity, what are the details of your SMB server and share configuration?


Regards,
Kent
Reply
#5
(07-02-2025, 12:31 PM)TheOldPresbyope Wrote: You said this stuttering began when you upgraded from 9.3.3 to 9.3.6. Looking through the release notes, I see that with 9.3.4, the kernel was updated to 6.12.25. If.you really want to, you could try installing first 9.3.3 and then 9.3.4 to see if that’s where the stuttering starts. (Previous releases are available on the github repro.)

I did a fresh install with 9.3.3, and to my surprise there is stuttering when playing mp3s as well. No problem with flacs btw. So it's not related to the update of the kernel I think. I recognised the stuttering after the update to 9.3.6, but maybe the issue existed before. Mostly I play flacs, could be that I didn't recognise it because I didn't play any mp3s recently. 

(07-02-2025, 12:31 PM)TheOldPresbyope Wrote: Incidentally, you can check the MPD log (/var/log/mpd/log) to see if underrun messages are being thrown by MPD while the stuttering is occurring. Note: I don’t recall if you have to increase the MPD logging level to Verbose to see these. 

This helped me a lot. The MPD log shows some "alsa_output: Decoder is too slow; playing silence to avoid xrun" messages every five seconds. 

Code:
2025-07-02T17:57:36 client: [127.0.0.1:44770] client connected
2025-07-02T17:57:36 client: [127.0.0.1:44770] process command "status"
2025-07-02T17:57:36 client: [127.0.0.1:44770] command returned 0
2025-07-02T17:57:36 client: [127.0.0.1:44770] process command "idle"
2025-07-02T17:57:36 client: [127.0.0.1:44770] command returned 1
2025-07-02T17:57:36 client: [127.0.0.1:44776] client connected
2025-07-02T17:57:36 client: [127.0.0.1:44776] process command "playlistinfo"
2025-07-02T17:57:36 client: [127.0.0.1:44776] command returned 0
2025-07-02T17:57:36 client: [127.0.0.1:44776] process command "close"
2025-07-02T17:57:36 client: [127.0.0.1:44776] command returned 4
2025-07-02T17:57:36 client: [127.0.0.1:44776] disconnected
2025-07-02T17:57:37 client: [127.0.0.1:51976] client connected
2025-07-02T17:57:37 client: [127.0.0.1:51976] process command "pause"
2025-07-02T17:57:37 client: [127.0.0.1:51976] command returned 0
2025-07-02T17:57:37 client: [127.0.0.1:51976] process command "close"
2025-07-02T17:57:37 client: [127.0.0.1:51976] command returned 4
2025-07-02T17:57:37 client: [127.0.0.1:51976] disconnected
2025-07-02T17:57:37 client: [127.0.0.1:44770] process command "status"
2025-07-02T17:57:37 client: [127.0.0.1:44770] command returned 0
2025-07-02T17:57:37 client: [127.0.0.1:44770] process command "currentsong"
2025-07-02T17:57:37 client: [127.0.0.1:44770] command returned 0
2025-07-02T17:57:37 output: closed "ALSA Default" (alsa)
2025-07-02T17:57:38 client: [127.0.0.1:44770] process command "lsinfo \"NAS/test/2011_Anna_Calvi/07_Blackout.flac\""
2025-07-02T17:57:38 client: [127.0.0.1:44770] command returned 0
2025-07-02T17:57:38 client: [127.0.0.1:44770] process command "close"
2025-07-02T17:57:38 client: [127.0.0.1:44770] command returned 4
2025-07-02T17:57:38 client: [127.0.0.1:44770] disconnected
2025-07-02T17:57:38 client: [127.0.0.1:51986] client connected
2025-07-02T17:57:38 client: [127.0.0.1:51986] process command "status"
2025-07-02T17:57:38 client: [127.0.0.1:51986] command returned 0
2025-07-02T17:57:38 client: [127.0.0.1:51986] process command "idle"
2025-07-02T17:57:38 client: [127.0.0.1:51986] command returned 1
2025-07-02T17:57:38 client: [127.0.0.1:52000] client connected
2025-07-02T17:57:38 client: [127.0.0.1:52000] process command "playlistinfo"
2025-07-02T17:57:38 client: [127.0.0.1:52000] command returned 0
2025-07-02T17:57:38 client: [127.0.0.1:52000] process command "close"
2025-07-02T17:57:38 client: [127.0.0.1:52000] command returned 4
2025-07-02T17:57:38 client: [127.0.0.1:52000] disconnected
2025-07-02T17:57:39 client: [127.0.0.1:52016] client connected
2025-07-02T17:57:39 client: [127.0.0.1:52016] process command "play 12"
2025-07-02T17:57:39 playlist: play 12:"NAS/test/2014_Adamlar_Eski-Dostum-Tankla-Gelmiş/03 Bi Öyle Bi Böyle.mp3"
2025-07-02T17:57:39 decoder_thread: probing plugin mpg123
2025-07-02T17:57:39 decoder: audio_format=44100:16:2, seekable=true
2025-07-02T17:57:39 alsa_output: opened "_audioout" type=COPY
2025-07-02T17:57:39 alsa_output: buffer: size=64..65536 time=1451..1486078
2025-07-02T17:57:39 alsa_output: period: size=32..32768 time=725..743039
2025-07-02T17:57:39 alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
2025-07-02T17:57:39 alsa_output: format=S24_LE (Signed 24 bit Little Endian)
2025-07-02T17:57:39 alsa_output: buffer_size=22050 period_size=4410
2025-07-02T17:57:39 output: opened "ALSA Default" (alsa) audio_format=44100:24:2
2025-07-02T17:57:39 output: converting in=44100:16:2 -> f=44100:24:2 -> out=44100:24:2
2025-07-02T17:57:39 client: [127.0.0.1:52016] command returned 0
2025-07-02T17:57:39 playlist: queue song 13:"NAS/test/2014_Adamlar_Eski-Dostum-Tankla-Gelmiş/04 Koca Yaşlı Şişko Dünya.mp3"
2025-07-02T17:57:39 client: [127.0.0.1:52016] process command "close"
2025-07-02T17:57:39 client: [127.0.0.1:52016] command returned 4
2025-07-02T17:57:39 client: [127.0.0.1:52016] disconnected
2025-07-02T17:57:39 client: [127.0.0.1:51986] process command "status"
2025-07-02T17:57:39 client: [127.0.0.1:51986] command returned 0
2025-07-02T17:57:39 client: [127.0.0.1:51986] process command "currentsong"
2025-07-02T17:57:39 client: [127.0.0.1:51986] command returned 0
2025-07-02T17:57:41 client: [127.0.0.1:51986] process command "lsinfo \"NAS/test/2014_Adamlar_Eski-Dostum-Tankla-Gelmiş/03 Bi Öyle Bi Böyle.mp3\""
2025-07-02T17:57:41 client: [127.0.0.1:51986] command returned 0
2025-07-02T17:57:41 client: [127.0.0.1:51986] process command "close"
2025-07-02T17:57:41 client: [127.0.0.1:51986] command returned 4
2025-07-02T17:57:41 client: [127.0.0.1:51986] disconnected
2025-07-02T17:57:41 client: [127.0.0.1:52018] client connected
2025-07-02T17:57:41 client: [127.0.0.1:52018] process command "status"
2025-07-02T17:57:41 client: [127.0.0.1:52018] command returned 0
2025-07-02T17:57:41 client: [127.0.0.1:52018] process command "idle"
2025-07-02T17:57:41 client: [127.0.0.1:52018] command returned 1
2025-07-02T17:57:41 client: [127.0.0.1:52026] client connected
2025-07-02T17:57:41 client: [127.0.0.1:52026] process command "playlistinfo"
2025-07-02T17:57:41 client: [127.0.0.1:52026] command returned 0
2025-07-02T17:57:41 client: [127.0.0.1:52026] process command "close"
2025-07-02T17:57:41 client: [127.0.0.1:52026] command returned 4
2025-07-02T17:57:41 client: [127.0.0.1:52026] disconnected
2025-07-02T17:57:43 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:57:48 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:57:53 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:57:58 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:58:03 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:58:08 alsa_output: Decoder is too slow; playing silence to avoid xrun
2025-07-02T17:58:13 alsa_output: Decoder is too slow; playing silence to avoid xrun

So it seems the mpg123 decoder has issues handling my mp3 files. Maybe connection issues after all? 
Like I said the flac plugin and ffmpeg (for mka-files) are working properly in my setup, and that's what the logs say, too.

The next thing I did was enabling dev tweaks on moodeaudio (like Tim is describing it here: https://moodeaudio.org/forum/showthread....3#pid47753) and disabling the mpg123 decoder on my custom mpd.conf. This lead to using the mad decoder instead, which works fine as far as I can say. 

This is a solution I can live with. 
Do you know if there is any other or better way to use a preferred decoder or enable/disable one? 

(For the record, increasing audio buffer or enabling input cache didn't change the stuttering...)

Thanks a lot for your help! 

Best,
a.kynr
Reply
#6
@a.kynr

Congrats!

Sorry I didn't remember an underrun is called xrun in the message. Hope you weren't grep'ing the log for "underrun".

I've never experimented with disabling decoders, but quoting from the MPD documentation (ETA: sorry, the formatting got messed up in my cut-n-paste job; best to read the original docs)

Quote:Configuring decoder plugins

Most decoder plugins do not need any special configuration. To configure a decoder, add a decoder block to mpd.conf:

decoder {
    plugin "wildmidi"
    config_file "/etc/timidity/timidity.cfg"
}

The following table lists the decoder options valid for all plugins:

Name
    

Description

plugin
    

The name of the plugin

enabled yes|no
    

Allows you to disable a decoder plugin without recompiling. By default, all plugins are enabled.

More information can be found in the Decoder plugins reference.


Like Tim, I haven't experienced the stuttering you report but I have few MP3 files in my library.  If I find some time, I'll try transcoding some high bitrate FLAC files to MP3 and see if I can repro the problem..

Regards,
Kent
Reply
#7
(07-03-2025, 12:25 PM)TheOldPresbyope Wrote: Sorry I didn't remember an underrun is called xrun in the message. Hope you weren't grep'ing the log for "underrun".

No Problem, the error message was just there, couldn't be unseen (with cat). 

Thanks for the link to the MPD documentation. For completeness:

I added this lines to my custom mpd.conf: 

Code:
decoder {
  plugin "mpg123"
  enabled "no"
}

Since there are two more decoders, who can handle mp3 (mad and ffmpeg), I wouldn't except any problems disabling one, which only handles mp3.

Best, 
a.kynr
Reply


Forum Jump: