httpd output plugin (wave) duration of 25:21

Need help with MPD?
Post Reply
Muffinman
Posts: 13
Joined: July 25th, 2016, 7:12 pm
Contact:

httpd output plugin (wave) duration of 25:21

Post by Muffinman »

Hello,

I'm trying to make MPD 0.19.16 stream wave from an Alsa input device with the httpd plugin. This works pretty well. However, the stream is limited to 25:21 minutes:seconds after which you'll have to restart the stream. When I use Flac as a decoder there is no limit. Unfortunately, the device running MPD is not handling the encoding too well, so that's not an option.

The results do not seem to depend on the client (tried both Chrome and Foobar2000). In addition, I've seen this problem reported before.

Trying a newer version of MPD is also problematic since I'm crosscompiling and the target OS is quite old (and not upgradable).

Any ideas on how to solve this problem (or where the problem may be)?

Kind regards, Maarten

max
Forum team
Posts: 1096
Joined: January 15th, 2013, 3:43 pm

Re: httpd output plugin (wave) duration of 25:21

Post by max »

Muffinman wrote:Trying a newer version of MPD is also problematic since I'm crosscompiling and the target OS is quite old (and not upgradable).
I don't even know which MPD version you're using, but this implies that it's not the latest. No support from me. Good luck.

(Correction: you did mention it, sorry. But anyway, no support for outdated MPD versions. See https://www.musicpd.org/help/)

Muffinman
Posts: 13
Joined: July 25th, 2016, 7:12 pm
Contact:

Re: httpd output plugin (wave) duration of 25:21

Post by Muffinman »

Seems fair.

I've compiled MPD 0.20.2 on an AMD64 system running Debian Jessie, kernel 4.5.2.

Running MPD with -v verbose option and httpd encoding in wave.
Length of the audiostream is now 15:32 according too Foobar.
When I use Flac encoder instead of Wave, a length is not specified.
The input source is a radio station, mp3 format I presume.

Below I've got the log output, config file and mpd --version output.

Any help on this would be appreciated...

Kind regards, Maarten

Log output

Code: Select all

Jan 07 18:39 : state_file: Loading state file /tmp/.mpd2/state
Jan 07 18:39 : exception: bind to '0.0.0.0:8000' failed (continuing anyway, because binding to '[::]:8000' succeeded): Failed to bind socket: Address already in use
Jan 07 18:39 : curl: icy-metaint=16000
Jan 07 18:39 : decoder_thread: probing plugin mad
Jan 07 18:39 : decoder: audio_format=48000:24:2, seekable=false
Jan 07 18:39 : output: opened plugin=httpd name="Analogue Input" audio_format=48000:24:2
Jan 07 18:39 : state_file: Saving state file /tmp/.mpd2/state
Jan 07 18:42 : state_file: Saving state file /tmp/.mpd2/state
mpd --version

Code: Select all

root@soekris:/mnt# ./mpd*/src/mpd --version    
Music Player Daemon 0.20.2

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2015 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy

Storage plugins:
 local

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [faad] aac
 [wavpack] wv
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Filters:


Tag plugins:
 id3tag

Output plugins:
 null fifo alsa oss httpd recorder

Encoder plugins:
 null vorbis opus lame wave flac

Input plugins:
 file alsa curl ffmpeg mms

Playlist plugins:
 extm3u m3u pls soundcloud flac cue embcue

Protocols:
 file:// http:// https:// mms:// mmsh:// mmst:// mmsu:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// alsa://

Other features:
 epoll icu inotify ipv6 tcp un
Config:

Code: Select all

music_directory			"/mnt.smb"
playlist_directory		"/mnt.smb/.mpd/playlists"
db_file				"/tmp/.mpd2/tag_cache"
log_file			"/tmp/log/mpd2.log"
pid_file			"/var/run/mpd2.pid"	
state_file			"/tmp/.mpd2/state"
sticker_file                    "/tmp/.mpd2/sticker.sql"

# General music daemon options ################################################
user				"root"
#group                          "nogroup"
bind_to_address		"any"
port				"6601"
log_level			"default"
#gapless_mp3_playback			"yes"
save_absolute_paths_in_playlists	"yes"
#metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc"
#auto_update    "yes"
#auto_update_depth "3"

###############################################################################

# Symbolic link behavior ######################################################
follow_outside_symlinks	"yes"
follow_inside_symlinks		"yes"

###############################################################################

# Zeroconf / Avahi Service Discovery ##########################################
zeroconf_enabled		"yes"
### zone_name ###
zeroconf_name	"test"

###############################################################################

# Permissions #################################################################
#password                        "password@read,add,control,admin"
#default_permissions             "read,add,control,admin"

###############################################################################

# Input #######################################################################
#input {
#        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
#}

###############################################################################

# Audio Output ################################################################
audio_output {

    type        "httpd"
    name        "Analogue Input"
    encoder     "wave"
    port        "8000"
    #format "44100:16:1"
}

#audio_output_format		"44100:16:2"
#samplerate_converter		"Fastest Sinc Interpolator"

playlist_plugin {
       name            "soundcloud"
       enabled         "true"
}
###############################################################################

# Volume control mixer ########################################################
#mixer_type			"hardware"
#mixer_type			"software"
#mixer_type			"none"
#mixer_type			"disabled"

###############################################################################

# Normalization automatic volume adjustments ##################################
#replay_gain_handler		"none"
#replaygain			"album"
#replaygain_preamp		"0"
#volume_normalization		"no"

###############################################################################

# MPD Internal Buffering ######################################################
#audio_buffer_size		"384"
#buffer_before_play		"10%"

###############################################################################

# Resource Limitations ########################################################
#connection_timeout		"60"
#max_connections		"10"
#max_playlist_length		"16384"
#max_command_list_size		"2048"
#max_output_buffer_size		"8192"

###############################################################################

# Character Encoding ##########################################################
filesystem_charset		"UTF-8"
id3v1_encoding			"UTF-8"

###############################################################################

max
Forum team
Posts: 1096
Joined: January 15th, 2013, 3:43 pm

Re: httpd output plugin (wave) duration of 25:21

Post by max »

There are lines missing in your log file. My random guess is that you forgot to enable verbose mode, even though you were asked to do exactly that.

Muffinman
Posts: 13
Joined: July 25th, 2016, 7:12 pm
Contact:

Re: httpd output plugin (wave) duration of 25:21

Post by Muffinman »

I'm afraid that's all there is in the log file and I'm running with verbose logging (option -v, and changing log_level to verbose did not seem to have a different effect).

If you're reffering to missing client connections etc, there are none. The state file makes MPD start where it left before restart, I did clean up the log file before starting MPD.

There is however some terminal output which is not in the log file:

Code: Select all

Jan 07 23:23 : exception: bind to '0.0.0.0:6601' failed (continuing anyway, because binding to '[::]:6601' succeeded): Failed to bind socket: Address already in use
Jan 07 23:23 : path: SetFSCharset: fs charset is:
Jan 07 23:23 : vorbis: Xiph.Org libVorbis 1.3.4
Jan 07 23:23 : opus: libopus 1.1
Jan 07 23:23 : simple_db: reading DB
Jan 07 23:23 : curl: version 7.38.0
Jan 07 23:23 : curl: with GnuTLS/3.3.8

max
Forum team
Posts: 1096
Joined: January 15th, 2013, 3:43 pm

Re: httpd output plugin (wave) duration of 25:21

Post by max »

... and now what was your problem you need help with?

Muffinman
Posts: 13
Joined: July 25th, 2016, 7:12 pm
Contact:

Re: httpd output plugin (wave) duration of 25:21

Post by Muffinman »

max wrote:... and now what was your problem you need help with?
Using the httpd output plugin and encoding in wave, the length of the stream is 15:32 minutes:seconds according to Foobar and Chrome browser. After those 15:32 minutes/seconds the stream will stop. When I use the Flac encoder instead of Wave, a length is not specified and the stream is continues (without a limit as far as I checked). The input source is a radio station, mp3 format I presume.

How can I make wave stream continues without a limit (as works with Flac but not with Wave)? Since the target device can't handle the convertion to flac too well, Flac is not an option.

max
Forum team
Posts: 1096
Joined: January 15th, 2013, 3:43 pm

Re: httpd output plugin (wave) duration of 25:21

Post by max »

That's an inherent problem of the WAVE format. Its header must contain the total file size, but a stream has an "infinite" size. Some software obeys this value, others may (correctly!) stop playback at this size. This problem makes the WAVE format inappropriate for streaming. If you know another uncompressed file format which is supported by your player software and supports streaming, MPD may support it after your feature request, but I don't know one.

Muffinman
Posts: 13
Joined: July 25th, 2016, 7:12 pm
Contact:

Re: httpd output plugin (wave) duration of 25:21

Post by Muffinman »

Ok, thanks for the explanation.

Post Reply