Moode Forum
http streaming not working from certain sources - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: http streaming not working from certain sources (/showthread.php?tid=5311)

Pages: 1 2


http streaming not working from certain sources - richo - 01-18-2023

I have had this problem from version 6 (if I remember correctly) Anytime I was playing FLAC or any other source which was not 16bit/44.1kHz (or 24bit/48kHz) the http streaming was silent.

Now, in version 8 I decided to look for some solutions and I found one. I have added format line  (last one in bellow section) into a mentioned section in  /etc/mpd.conf 
Hopefully this help someone and maybe incorporated to future releases?
-r-


Code:
audio_output {
type "httpd"
name "HTTP Server"
port "8011"
encoder "lame"
bitrate "320"
tags "yes"
always_on "yes"
format "44100:16:1"
}



RE: http streaming not working from certain sources - Nutul - 01-18-2023

(01-18-2023, 08:05 AM)richo Wrote: I have had this problem from version 6 (if I remember correctly) Anytime I was playing FLAC or any other source which was not 16bit/44.1kHz (or 24bit/48kHz) the http streaming was silent.

Now, in version 8 I decided to look for some solutions and I found one. I have added format line  (last one in bellow section) into a mentioned section in  /etc/mpd.conf 
Hopefully this help someone and maybe incorporated to future releases?
-r-


Code:
audio_output {
type "httpd"
name "HTTP Server"
port "8011"
encoder "lame"
bitrate "320"
tags "yes"
always_on "yes"
format "44100:16:1"
}

I can play FLAC 24/96 without any problem. I stram in FLAC format, anyway... Do you mean your issue may arise because you are streaming in mp3?

ETA
Uh, right! If you decide to stream in mp3 and play a FLAC other than 16/44.1 (in my case 24/96, though I didn't try a 24/48...) the stream isn't sending any data...
I don't know what your line may do, but I assume it resamples everything down to 16/44.1 in order for lame to work...


RE: http streaming not working from certain sources - richo - 01-18-2023

(01-18-2023, 08:38 AM)Nutul Wrote: ETA
Uh, right! If you decide to stream in mp3 and play a FLAC other than 16/44.1 (in my case 24/96, though I didn't try a 24/48...) the stream isn't sending any data...
I don't know what your line may do, but I assume it resamples everything down to 16/44.1 in order for lame to work...

Correct, I am streaming http in mp3 format and yes it resamples down to 16/44.1 in mp3.
Anyway this solved the issue.


RE: http streaming not working from certain sources - richo - 01-18-2023

I have also noticed something, which is sort of logical. If you made any changes to the MPD settings from the web interface it will remove earlier manually added line:

format "44100:16:1"

and if the verbose mode for logging is increased on mpd, the following line will be written in that log. And of course your http stream will be silent:

exception: Failed to open "HTTP Server" (httpd); error setting lame out sample rate


RE: http streaming not working from certain sources - Nutul - 01-18-2023

(01-18-2023, 10:16 AM)richo Wrote: I have also noticed something, which is sort of logical. If you made any changes to the MPD settings from the web interface it will remove earlier manually added line:

format "44100:16:1"

I think this is to be expected, as the web interface takes care of writing such configuration file, that is: you're not encouraged to write it yourself.
Maybe we could write the file in a more intelligent way: overwrite only the values the UI is aware of, and leave the rest unchanged... it's a bit challenging, though, to be done in a proper (data-agnostic way) way: read all, take unknown as granted, replace all known, save all.
I may have a look into it, but... let's consider WHY we shouldn't:
we have, ATM, two options: FLAC and MP3 (that is: hi-quality lossless vs lossy low quality). At this point, IMHO, it should be clear that for MP3 streaming we do deliberately want a low-quality, and hence force such line automatically in the config. file. It's easier, and there is no meaning for streaming MP3 at 24/96 => shrinked down to 320kbs, right?!?

@Tim Curtis, am I right in my assumptions? This is a one-liner, and could make a lot of people happy, at least @richo. But looking at the bigger picture... shall I decide to stream my library over the internet, to reduce bandwidth, and costs, and depending on the situation, I would prefer to have MP3 streaming over FLAC. Problem is: I would lose roughly 25% of my music availability without this easy fix.

I could take care of implementing it, of course, shall it be the case.

Nice day everybody, now back to some silly and annoying database work-duties


RE: http streaming not working from certain sources - richo - 01-18-2023

Maybe it should be:

  format "44100:16:2" 

for stereo? And Maybe it should be added behind the scene when mp3 is chosen for http stream.


RE: http streaming not working from certain sources - Nutul - 01-18-2023

(01-18-2023, 12:38 PM)richo Wrote: Maybe it should be:

  format "44100:16:2" 

for stereo? And Maybe it should be added behind the scene when mp3 is chosen for http stream.

Yes, you are right about the stereo thing, and yes, of course, I am discussing about making it automatically added upon selecting mp3, while leaving it out for FLAC.


RE: http streaming not working from certain sources - Tim Curtis - 01-18-2023

Yes, I'll add the line conditionally for mp3.


RE: http streaming not working from certain sources - Nutul - 01-18-2023

(01-18-2023, 01:08 PM)Tim Curtis Wrote: Yes, I'll add the line conditionally for mp3.

Hm... you're taking duties off me... :-)


RE: http streaming not working from certain sources - Tim Curtis - 01-18-2023

(01-18-2023, 01:13 PM)Nutul Wrote:
(01-18-2023, 01:08 PM)Tim Curtis Wrote: Yes, I'll add the line conditionally for mp3.

Hm... you're taking duties off me... :-)

lol, I never turn down a PR.

I have it on the TODO list but if you want to implement it by all means do so :-)