
음악 파일이 로컬에 저장되는 홈 서버가 있습니다.
이 홈 서버에 MPD와 ncmpcpp를 설치했습니다.
어디에서나 액세스할 수 있도록 포트를 전달하는 매우 간단한 단계를 수행할 수 있도록 프로토타입을 만들려고 노력하고 있지만 로컬에서 작동하도록 하는 데에도 많은 어려움을 겪고 있습니다. 원격 컴퓨터에서 작업 중인데 오늘 아침에 한 모든 작업은 원격 셸에서 이루어졌습니다.~에홈서버...
mpd 데몬을 종료하고 비활성화한 후 다음과 같이 시작했습니다.
mpd --stdout --no-daemon --verbose ~/.config/mpd/mpd.conf
결과는 다음과 같습니다.
config_file: loading file .config/mpd/mpd.conf
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.5
opus: libopus 1.1.4
sndfile: libsndfile-1.0.27
simple_db: reading DB
curl: version 7.52.1
curl: with OpenSSL/1.0.2k
avahi: Initializing interface
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /home/dale/.config/mpd/state
포트가 뭔가를 하고 있거나 적어도 MPD를 위해 뭔가를 할 준비를 하고 있는 것 같습니다.
~ ➭ sudo netstat -lnp | sudo grep 8002
tcp 0 0 127.0.0.1:8002 0.0.0.0:* LISTEN 21596/mpd
그러나 ncmpcpp를 실행하면(MPD를 실행하는 동일한 시스템, 홈 서버에서... SSH 접속 중임을 기억하세요) 다음과 같은 불만 사항이 표시됩니다.
ncmpcpp: Failed to resolve host name
다음 파일이 있습니다 ~/.config/mpd/mpd.conf
.
music_directory "/mnt/media/Music"
playlist_directory "~/.config/mpd/playlists"
db_file "~/.config/mpd/database"
log_file "~/.config/mpd/log"
pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql"
#mixer_type "software"
#█▓▒░ opts
bind_to_address "127.0.0.1"
port "6601"
log_level "default"
gapless_mp3_playback "yes"
filesystem_charset "UTF-8"
#█▓▒░ io
input {
plugin "curl"
}
audio_output {
type "alsa"
name "My ALSA Device"
device "hw:0,0" # optional
mixer_type "hardware" # optional
mixer_device "default" # optional
mixer_control "PCM" # optional
mixer_index "0" # optional
}
#audio_output {
# type "alsa"
# name "audio"
#}
audio_output {
type "fifo"
name "visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
audio_output {
type "httpd"
name "My HTTP Stream"
encoder "vorbis" # optional
bind_to_address "127.0.0.1"
port "8002"
# quality "5.0" # do not define if bitrate is defined
bitrate "128" # do not define if quality is defined
format "44100:16:1"
always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped.
tags "yes" # httpd supports sending tags to listening streams.
}
`
내 파일에 다음이 있습니다 ~/.ncmpcpp/config
.
ncmpcpp_directory = "~/.ncmpcpp"
#lyrics_directory = "~/.lyrics"
external_editor = "/usr/bin/vim"
# █▓▒░ MPD Settings
mpd_crossfade_time = "3"
mpd_music_dir = "/mnt/media/Music"
mpd_host = "127.0.0.1:8002"
mpd_port = "8002"
내가 잘못 구성한 속성에 대한 아이디어가 있습니까?
감사해요
답변1
구성한 포트의 목적을 잘못 이해했습니다.
6601(MPD 구성 파일의 "포트")은 통신하려는 응용 프로그램에서 사용됩니다.MPD 프로토콜MPD - 즉, 재생, 음악 데이터베이스 등을 제어하는 애플리케이션입니다.
8002(MPD 구성 파일의 "audio_output" 섹션에 있는 "포트")는 MPD가 HTTP를 통해 vorbis 오디오 스트림을 내보내는 데 사용되는 포트입니다.
ncmpcpp는제어MPD, 적합하지 않음듣다내보내는 오디오 스트림의 경우 포트 6601(설정에서 mpd_port
)에 연결하도록 ncmpcpp를 구성해야 합니다.