Thank you for your donation!


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


Streaming MPD-over-http to my computer has drop-outs
#1
I setup MPD-over-http output to my Mac, which works but with occasional drop-outs. Both Raspberry Pi 4 and the Mac are on wired ethernet. Also on the wired ethernet is the dedicated NAS that does nothing but serve the music files to the Raspberry Pi. The MPD is configured with ample read-ahead buffer.

I’ve had it happen while I was monitoring using `moodeutl -m`, but CPU-util. remains below 5%.

Here is the MPDlog that includes two drop-outs:
Code:
Aug 27 18:41 : player: played "NAS/mediaDS124/Tortoise/TNT/07 The Suspension Bridge at Iguazú Falls.m4a"
Aug 27 18:41 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, timescale not set
Aug 27 18:41 : alsa_output: Decoder is too slow; playing silence to avoid xrun
Aug 27 18:41 : alsa_output: Decoder is too slow; playing silence to avoid xrun
Aug 27 18:41 : alsa_output: Decoder is too slow; playing silence to avoid xrun
Aug 27 18:41 : alsa_output: Decoder is too slow; playing silence to avoid xrun
Aug 27 18:42 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, timescale not set
Aug 27 18:45 : player: played "NAS/mediaDS124/Chocolate Hills/Yarns from the Chocolate Triangle [Qobuz]/01 Leaving Plymouth.m4a"
Aug 27 18:46 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, timescale not set
Aug 27 18:50 : player: played "NAS/mediaDS124/Chocolate Hills/Yarns from the Chocolate Triangle [Qobuz]/02 Saragossa Wells.m4a"
Aug 27 18:52 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, timescale not set

I’m using VLC on the Mac to play the stream.

Do you have any ideas? Know of any other apps that can play such a stream on the Mac?
Reply
#2
both errors show file as .m4a
Does it happen with other file types ? .mp3 Flac.

Have you tried using a browser instead of VLC ?
----------
bob
Reply
#3
@hestehandler 

I just tried to repro your situation with a 12 minute .m4a file (Beethoven's Sym.6, 1st Mvmt) I found on a test-file site. 

My NAS is OpenMediaVault 5.6.26 running on an Odroid HC1 (an ARM-based SBC), connected to my LAN router via Ethernet. I was running moOde 8.3.5 on an RPi4B, connected to my LAN via WiFi, while I played the HTTP stream using VLC 3.0.16 on an x86 laptop running Linux Mint 21.1, also connected to my LAN via WiFi.

I didn't experience any drop outs. 

Here's what the MPD log showed (in verbose logging mode) as moOde starts the track and the MPD plugin starts processing the .m4a file


Code:
ug 27 20:53 : client: [83] opened from 127.0.0.1:48624
Aug 27 20:53 : client: [83] process command "play 7"
Aug 27 20:53 : playlist: play 7:"NAS/Omv-music/Test/Symphony No.6 (1st movement).m4a"
Aug 27 20:53 : decoder_thread: probing plugin ffmpeg
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'ftyp' parent:'root' sz: 24 8 11816072
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: ISO: File Type Major Brand: M4A
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'free' parent:'root' sz: 8 32 11816072
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'mdat' parent:'root' sz: 11689519 40 11816072
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'moov' parent:'root' sz: 126521 11689559 11816072
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'mvhd' parent:'moov' sz: 108 8 126513
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: time scale = 1000
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'trak' parent:'moov' sz: 126097 116 126513
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'tkhd' parent:'trak' sz: 92 8 126089
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'edts' parent:'trak' sz: 36 100 126089
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'elst' parent:'edts' sz: 28 8 28
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: track[0].edit_count = 1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: duration=728085 time=1024 rate=1.000000
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'mdia' parent:'trak' sz: 125961 136 126089
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'mdhd' parent:'mdia' sz: 32 8 125953
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'hdlr' parent:'mdia' sz: 45 40 125953
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: ctype=[0][0][0][0]
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stype=soun
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'minf' parent:'mdia' sz: 125876 85 125953
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'smhd' parent:'minf' sz: 16 8 125868
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'dinf' parent:'minf' sz: 36 24 125868
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'dref' parent:'dinf' sz: 28 8 28
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: Unknown dref type 0x206c7275 size 12
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stbl' parent:'minf' sz: 125816 60 125868
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stsd' parent:'stbl' sz: 106 8 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: size=90 4CC=mp4a codec_type=1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: audio channels 2
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: version =0, isom =1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'esds' parent:'stsd' sz: 54 8 54
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: MPEG-4 description: tag=0x03 len=37
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: MPEG-4 description: tag=0x04 len=23
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: esds object type id 0x40
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: MPEG-4 description: tag=0x05 len=5
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: Specific MPEG-4 header len=5
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: mp4a config channels 2 obj 2 ext obj 5 sample rate 44100 ext sample rate 0
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stts' parent:'stbl' sz: 24 114 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: track[0].stts.entries = 1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: sample_count=31357, sample_duration=1024
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stsc' parent:'stbl' sz: 112 138 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: track[0].stsc.entries = 8
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stsz' parent:'stbl' sz: 125448 250 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: sample_size = 0 sample_count = 31357
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'stco' parent:'stbl' sz: 64 125698 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'sgpd' parent:'stbl' sz: 26 125762 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: type:'sbgp' parent:'stbl' sz: 28 125788 125808
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: AVIndex stream 0, sample 0, offset 28, dts 0, size 24, distance 0, keyframe 1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: AVIndex stream 0, sample 1, offset 40, dts 1024, size 6, distance 0, keyframe 1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: AVIndex stream 0, sample 2, offset 46, dts 2048, size 6, distance 0, keyframe 1
Aug 27 20:53 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: AVIndex stream 0, sample 3, offset 4c, dts 3072, size 6, distance 0, keyframe 1
...


I have no idea how this test file differs  technically from yours, but notice how my ffmpeg messages differ from yours.

If you want, you can zip up a couple of your m4a files, post the zip to an accessible file-sharing site such as DropBox, and send me the link in a PM on this forum. I'd be happy to repeat my test with it.

Also, in addiion to @DRONE7's questions, do you experience the drop-outs when you shut off the HTTP service and play the .m4a files locally, e.g., on your moOde player?

Regards,
Kent
Reply
#4
Perhaps as the o/p files are youtube/qobuz sourced there is some timing data not brought through with the download ?
hence your "time scale=1000" vs their "time scale not set" ?
----------
bob
Reply
#5
Hold on.


I think I may have managed to create more smoke than fire here. I need to understand better just how MPD and ffmpeg are interacting to read the file and convert it to streaming format. It's midnight; I think I'll sleep on it.

Meanwhile,it's possible to use ffprobe to look at some file details. Here's what I get for my test file

Code:
pi@m835-64:~ $ ffprobe -hide_banner -i /mnt/NAS/Omv-music/Test/'Symphony No.6 (1st movement).m4a'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/NAS/Omv-music/Test/Symphony No.6 (1st movement).m4a':
 Metadata:
   major_brand     : M4A
   minor_version   : 512
   compatible_brands: isomiso2
   title           : Symphony No.6 (1st movement)
   artist          : Ludwig van Beethoven
   album           : www.mfiles.co.uk
   encoder         : Lavf57.83.100
   comment         : � Music Files Ltd
   genre           : Classical
 Duration: 00:12:08.11, start: 0.000000, bitrate: 129 kb/s
   Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
   Metadata:
     handler_name    : SoundHandler
Regards,
Kent
Reply
#6
I suspect that the ‘timescale not set’ error is this issue: https://github.com/Martchus/tageditor/issues/1 relating to embedded cover art.

I’ll try running it in the browser to see if that fixes anything.
Reply
#7
Tried to play the stream in Firefox – which largely works – but every time the track changes sample rate the playback is silent and the stream needs to be reloaded in the browser.

The http streaming was not made for us audiophiles I think.

Would you have alternate suggestions to this scenario:
I have a *copy* of my music library on a one-disk NAS. Moode than mounts this library read-only. This works excellently. Here is the problem: Sometimes I want to listen to that music at my computer where my headphones are. Making an alternate library in Apple Music is a no-go. It takes ages to scan the library, and I would have to do that every time I add music to the NAS. I think the best way to do this is to use Moode in some capacity to get the audio from Moode to my computer, but http streaming is a problem. Are there other alternatives?
Reply
#8
(08-28-2023, 07:09 AM)hestehandler Wrote: Tried to play the stream in Firefox – which largely works – but every time the track changes sample rate the playback is silent and the stream needs to be reloaded in the browser.

The http streaming was not made for us audiophiles I think.

Would you have alternate suggestions to this scenario:
I have a *copy* of my music library on a one-disk NAS. Moode than mounts this library read-only. This works excellently. Here is the problem: Sometimes I want to listen to that music at my computer where my headphones are. Making an alternate library in Apple Music is a no-go. It takes ages to scan the library, and I would have to do that every time I add music to the NAS. I think the best way to do this is to use Moode in some capacity to get the audio from Moode to my computer, but http streaming is a problem. Are there other alternatives?

I am not an expert on how MPD works, but isn't it possible to:

1. mount the same share on your laptop
2. install MPD on it
3. play with it using one of the many MPD clients

of course this brings moOde out of the picture, maybe it's not what you want...
Reply
#9
(08-28-2023, 08:09 AM)Nutul Wrote:
(08-28-2023, 07:09 AM)hestehandler Wrote: Tried to play the stream in Firefox – which largely works – but every time the track changes sample rate the playback is silent and the stream needs to be reloaded in the browser.

The http streaming was not made for us audiophiles I think.

Would you have alternate suggestions to this scenario:
I have a *copy* of my music library on a one-disk NAS. Moode than mounts this library read-only. This works excellently. Here is the problem: Sometimes I want to listen to that music at my computer where my headphones are. Making an alternate library in Apple Music is a no-go. It takes ages to scan the library, and I would have to do that every time I add music to the NAS. I think the best way to do this is to use Moode in some capacity to get the audio from Moode to my computer, but http streaming is a problem. Are there other alternatives?

I am not an expert on how MPD works, but isn't it possible to:

1. mount the same share on your laptop
2. install MPD on it
3. play with it using one of the many MPD clients

of course this brings moOde out of the picture, maybe it's not what you want...

This didn’t occur to me, but yes, that is probably the least bad solution (so far). I see that there is a Homebrew installer for MPD so I’m giving it a try.
Reply
#10
I recall there was some thread about managing all files to stream at one sample rate...

Found! ( and Al was part of so may have more insight as to how to)

https://moodeaudio.org/forum/showthread....+STREAMING
----------
bob
Reply


Forum Jump: