You are not logged in.
I been trying to set up "mpd" along with "ncmpcpp" but couldn't get it to work no matter what I try. I almost tried every possible options given in this forum and in others.
This is the config file of "mpd.conf"
bind_to_address "127.0.0.1"
db_file "/home/tintin/.mpd/mpd.db"
pid_file "~/.mpd/mpd.pid"
music_directory "/home/tintin/Music"
playlist_directory "/home/tintin/.mpd/playlists"
log_level "verbose"
auto_update "yes"
auto_update_depth "3"
follow_inside_symlinks "yes"
follow_outside_symlinks "yes"
audio_output {
type "pulse"
name "pulse audio"
}
audio_output {
type "fifo"
name "mpd_fifo"
path "/home/tintin/.mpd/mpd.fifo"
format "44100:16:2"But I'm getting
MPD: No database though the db file is present in ".mpd" folder.
I tried checking the file permission and the folders as well as the files have write and execute permissions.
$ ls -la
drwxrwxrwx 3 tintin tintin 4096 May 25 00:37 .
drwxrwxrwx 43 tintin tintin 4096 May 25 00:58 ..
-rwxrwxrwx 1 tintin tintin 512 May 25 00:37 mpd.conf
-rwxrwxrwx 1 tintin tintin 29079 May 24 23:15 mpd.db
-rwxrwxrwx 1 tintin tintin 4681 May 24 23:15 mpd.log
-rwxrwxrwx 1 tintin tintin 6 May 24 23:15 mpd.pid
-rwxrwxrwx 1 tintin tintin 215 May 24 23:15 mpdstate
drwxrwxrwx 2 tintin tintin 4096 May 24 23:37 playlistsI also executing
$ mpd --no-daemon --stderr --verbose
config_file: loading file /home/tintin/.mpd/mpd.conf
exception: Failed to bind to '127.0.0.1:6600'
exception: nested: Failed to bind socket: Address already in useI have mpd running as a service when the system boots up.
This is my "ncmpcpp" config
###############################################################
#
##### directories ######
##
## Directory for storing ncmpcpp related files.
## Changing it is useful if you want to store
## everything somewhere else and provide command
## line setting for alternative location to config
## file which defines that while launching ncmpcpp.
##
#
ncmpcpp_directory = ~/.ncmpcpp
## Directory for storing downloaded lyrics. It
## defaults to ~/.lyrics since other MPD clients
## (eg. ncmpc) also use that location.
##
#
lyrics_directory = ~/.ncmpcpp/lyrics
##### connection settings #####
mpd_host = "127.0.0.1"
mpd_port = "6600"
mpd_connection_timeout = 5
## Needed for tag editor and file operations to work.
mpd_crossfade_time = 5
mpd_music_dir = "/home/tintin/Music/"
## Note: In order to make music visualizer work you'll
## need to use mpd fifo output, whose format parameter
## has to be set to 44100:16:1 for mono visualization
## or 44100:16:2 for stereo visualization. Example
## configuration (it has to be put into mpd.conf):
##
audio_output {
type "my_fifo"
name "Visualizer feed"
path "/tmp/mpd.fifo"
format "44100:16:2"
## }
##
#
visualizer_fifo_path = "/tmp/mpd.fifo"
#
##
## Note: Below parameter is needed for ncmpcpp
## to determine which output provides data for
## visualizer and thus allow syncing between
## visualization and sound as currently there
## are some problems with it.
##
#
visualizer_output_name = "my_fifo"
##
## Note: Below parameter defines how often ncmpcpp
## has to "synchronize" visualizer and audio outputs.
## 30 seconds is optimal value, but if you experience
## synchronization problems, set it to lower value.
## Keep in mind that sane values start with >=10.
##
#
visualizer_sync_interval = "12"
#
##
## Note: To enable spectrum frequency visualization
## you need to compile ncmpcpp with fftw3 support.
##
#
## Available values: spectrum, wave, wave_filled, ellipse.
##
visualizer_type = "spectrum" (spectrum/wave)
visualizer_look = "●┃"
#visualizer_look = "+|"
#
# visualizer_color = blue, cyan, green, yellow, magenta, red
#
## Alternative subset of 256 colors for terminals that support it.
##
# visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
#
#
##
## If you set format to 44100:16:2, make it 'yes'.
##
visualizer_in_stereo = "yes"
##### system encoding #####
##
## ncmpcpp should detect your charset encoding
## but if it failed to do so, you can specify
## charset encoding you are using here.
##
## Note: You can see whether your ncmpcpp build
## supports charset detection by checking output
## of `ncmpcpp --version`.
##
## Note: Since MPD uses UTF-8 by default, setting
## this option makes sense only if your encoding
## is different.
##
#
system_encoding = "utf-8"
##### delays #####
#
## Time of inactivity (in seconds) after playlist
## highlighting will be disabled (0 = always on).
##
playlist_disable_highlight_delay = "0"
#
## Defines how long messages are supposed to be visible.
##
message_delay_time = 5
##### song format #####
##
## For a song format you can use:
##
## %l - length
## %f - filename
## %D - directory
## %a - artist
## %A - album artist
## %t - title
## %b - album
## %y - date
## %n - track number (01/12 -> 01)
## %N - full track info (01/12 -> 01/12)
## %g - genre
## %c - composer
## %p - performer
## %d - disc
## %C - comment
## %P - priority
## $R - begin right alignment
##
## If you want to make sure that a part of the format is displayed
## only when certain tags are present, you can archieve it by
## grouping them with brackets, e.g. '{%a - %t}' will be evaluated
## to 'ARTIST - TITLE' if both tags are present or '' otherwise.
## It is also possible to define a list of alternatives by providing
## several groups and separating them with '|', e.g. '{%t}|{%f}'
## will be evaluated to 'TITLE' or 'FILENAME' if the former is not
## present.
##
## Note: If you want to set limit on maximal length of a tag, just
## put the appropriate number between % and character that defines
## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'.
##
## In addition, formats support markers used for text attributes.
## They are followed by character '$'. After that you can put:
##
## - 0 - default window color (discards all other colors)
## - 1 - black
## - 2 - red
## - 3 - green
## - 4 - yellow
## - 5 - blue
## - 6 - magenta
## - 7 - cyan
## - 8 - white
## - 9 - end of current color
## - b - bold text
## - u - underline text
## - r - reverse colors
## - a - use alternative character set
##
## If you don't want to use a non-color attribute anymore, just put it
## again, but this time insert character '/' between '$' and attribute
## character, e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag
## or filename with reversed colors.
##
## If you want to use 256 colors and/or background colors in formats
## (the naming scheme is described below in section about color
## definitions), it can be done with the syntax $(COLOR), e.g. to set
## the artist tag to one of the non-standard colors and make it have
## yellow background, you need to write $(197_yellow)%a$(end). Note
## that for standard colors this is interchangable with attributes
## listed above.
##
## Note: colors can be nested.
##
#
#song_list_format = "{$3%n │ $9}{$7%a - $9}{$5%t$9}|{$8%f$9}$R{$6 │ %b$9}{$3 │ %l$9}"
#song_list_format = {%a - }{%t}|{$8%f$9}$R{$5(%l)$9}
#song_status_format ="{{%a{ $2//$9 %b{, %y}} $2//$9 }{%t$/b}}|{$b%f$/b}"
#song_status_format = " $2%a $4⟫$3⟫ $8%t $4⟫$3⟫ $5%b "
#song_list_format = " $8%a • %t"
#song_status_format = " $6%a $7%t $5%b "
#song_library_format = {%n - }{%t}|{%f}
#alternative_header_first_line_format = "$0$aqqu$/a {$7%a - $9}{$5%t$9}|{$8%f$9} $0$atqq$/a$9"
#alternative_header_second_line_format = "{{$6%b$9}{ [$6%y$9]}}|{%D}"
#now_playing_prefix = "$b$9▶ "
now_playing_suffix = $/b
selected_item_prefix = "* "
#selected_item_prefix = $6
#
#selected_item_suffix = $9
#
#modified_item_prefix = $3> $9
##
## Note: Below variables are used for sorting songs in browser.
## The sort mode determines how songs are sorted, and can be used
## in combination with a sort format to specify a custom sorting format.
## Available values for browser_sort_mode are "name", "mtime", "format"
## and "noop".
##
#
browser_sort_mode = name
#
browser_sort_format = {%a - }{%t}|{%f} {(%l)}
#
##### columns settings #####
##
## syntax of song columns list format is "column column etc."
##
## - syntax for each column is:
##
## (width of the column)[color of the column]{displayed tag}
##
## Note: Width is by default in %, if you want a column to
## have fixed size, add 'f' after the value, e.g. (10)[white]{a}
## will be the column that take 10% of screen (so the real width
## will depend on actual screen size), whereas (10f)[white]{a}
## will take 10 terminal cells, no matter how wide the screen is.
##
## - color is optional (if you want the default one,
## leave the field empty).
##
## Note: You can give a column additional attributes by putting appropriate
## character after displayed tag character. Available attributes are:
##
## - r - column will be right aligned
## - E - if tag is empty, empty tag marker won't be displayed
##
## You can also:
##
## - give a column custom name by putting it after attributes,
## separated with character ':', e.g. {lr:Length} gives you
## right aligned column of lengths named "Length".
##
## - define sequence of tags, that have to be displayed in case
## predecessor is empty in a way similar to the one in classic
## song format, i.e. using '|' character, e.g. {a|c|p:Owner}
## creates column named "Owner" that tries to display artist
## tag and then composer and performer if previous ones are
## not available.
##
#song_columns_list_format = "(3)[]{}(85)[white]{t} (1)[blue]{a}"
song_columns_list_format = "(10)[white]{l} (30)[white]{b} (25)[cyan]{a} (10)[magenta]{t}"
#song_columns_list_format = "(10)[blue]{l} (30)[green]{a} (30)[magenta]{b} (50)[yellow]{t}"
##### various settings #####
#
##
## Note: Custom command that will be executed each
## time song changes. Useful for notifications etc.
##
execute_on_song_change = notify-send -i "Now Playing ♫" "$(mpc current)"
# Playlist
#playlist_show_mpd_host = no
#
#playlist_shorten_total_times = no
#
#playlist_separate_albums = no
##
## Note: Possible display modes: classic, columns.
##
playlist_display_mode = "columns"
browser_display_mode = "columns"
#search_engine_display_mode = columns
#playlist_editor_display_mode = columns
playlist_disable_highlight_delay = "0"
playlist_show_remaining_time = "yes"
## Selected tracks ##
discard_colors_if_item_is_selected = "no"
## Seeking ##
incremental_seeking = "yes"
seek_time = "1"
#volume_change_step = 2
autocenter_mode = yes
centered_cursor = yes
## Note: You can specify third character which will
## be used to build 'empty' part of progressbar.
##
#progressbar_look = "◾◾◽"
#progressbar_look = "=>"
#progressbar_look = "─- "
#progressbar_look = "▒▒░"
#progressbar_look = "┅┅┄"
#progressbar_look = "─⊙┄"
#progressbar_look = "─➞─"
#progressbar_look = "─┅─"
#progressbar_look = "▪▪▪"
#progressbar_look = "▪▪▫"
#progressbar_look = "───"
#progressbar_look = "▁▁▁"
progressbar_look = "=>-"
#progressbar_look = "‒‒‒"
#progressbar_look = "■◣ "
#progressbar_look = "◈◆◇"
#progressbar_look = "─╼ "
#
#progressbar_boldness = yes
#
## Available values: database, playlist.
##
#default_place_to_search_in = database
#
## Available values: classic, alternative.
##
user_interface = "alternative"
#user_interface = "classic"
#
#data_fetching_delay = yes
#
## Available values: artist, album_artist, date, genre, composer, performer.
##
#media_library_primary_tag = artist
#
## Available values: wrapped, normal.
##
#default_find_mode = wrapped
#
#default_tag_editor_pattern = %n - %t
#
header_visibility = no
#
statusbar_visibility = yes
#
titles_visibility = yes
#
header_text_scrolling = yes
#
#
#follow_now_playing_lyrics = no
#
fetch_lyrics_for_current_song_in_background = yes
#
#store_lyrics_in_song_dir = no
#
#generate_win32_compatible_filenames = yes
#
#allow_for_physical_item_deletion = no
##
## Note: If you set this variable, ncmpcpp will try to
## get info from last.fm in language you set and if it
## fails, it will fall back to english. Otherwise it will
## use english the first time.
##
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
##
#lastfm_preferred_language = en
#
#show_hidden_files_in_local_browser = no
#
##
## How shall screen switcher work?
##
## - "previous" - switch between the current and previous screen.
## - "screen1,...,screenN" - switch between given sequence of screens.
##
## Screens available for use: help, playlist, browser, search_engine,
## media_library, playlist_editor, tag_editor, outputs, visualizer, clock.
##
#screen_switcher_mode = playlist, browser
#
##
## Note: You can define startup screen
## by choosing screen from the list above.
##
#startup_screen = playlist
#
##
## Note: You can define startup slave screen
## by choosing screen from the list above or
## an empty value for no slave screen.
##
#startup_slave_screen = ""
#
#startup_slave_screen_focus = no
#
##
## Default width of locked screen (in %).
## Acceptable values are from 20 to 80.
##
#
#locked_screen_width_part = 50
#
#ask_for_locked_screen_width_part = yes
#
#jump_to_now_playing_song_at_start = yes
#
ask_before_clearing_playlists = yes
#
#clock_display_seconds = no
#
display_volume_level = "yes"
display_bitrate = "no"
##So what is wrong in here and why couldn't I run ncmpcpp properly? Any sort of help would be totally appreciable
Last edited by Tintin5371 (2020-05-26 10:41:43)
Offline
Don't start mpd as a system service, use an --user service instead. https://wiki.archlinux.org/index.php/Mu … th_systemd
So in practice
sudo systemctl disable --now mpd
systemctl --user enable --now mpdnote the lack of sudo and the --user flag in the second case.
Oh and though I doubt it to be of much relevance, you can remove the pid_file config option, systemd will be able to handle the mpd instance without it
Last edited by V1del (2020-05-25 07:05:17)
Offline
I tried to make the necessary steps that you suggested but it showing error code. But this still doesn't answer the fact that it couldn't detect the database though it is present in there. Why would that be so? Is there any additional steps to create a database. I the previous version database could be created manually but in the latest version it is not possible. So why isn't mpd able to detect the database on its own after it is created ?
Offline
So why isn't mpd able to detect the database on its own after it is created?
Because it might be looking at a different place.
Are you running mpd system wide? Then it will look for it in /var/lib/mpd.
Can you post the status of mpd.service? Either system or user depending on what you're using.
Offline
I tried looking out to that but I already gave permission to write and execute on that directory but still nothing happens.
Here's the output you asked for
$ sudo systemctl status mpd
mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2020-05-25 18:08:34 IST; 4min 24s ago
TriggeredBy: ● mpd.socket
Docs: man:mpd(1)
man:mpd.conf(5)
Main PID: 4703 (mpd)
Tasks: 3 (limit: 9406)
Memory: 8.9M
CGroup: /system.slice/mpd.service
└─4703 /usr/bin/mpd --no-daemon
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No database
May 25 18:10:18 Midori mpd[4703]: exception: No databaseI tried running as --user but it would always exit with error code.
$ systemctl --user status mpd
mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/user/mpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-05-25 18:21:31 IST; 14s ago
Docs: man:mpd(1)
man:mpd.conf(5)
Process: 5671 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
Main PID: 5671 (code=exited, status=1/FAILURE)
May 25 18:21:30 Midori systemd[1110]: Starting Music Player Daemon...
May 25 18:21:31 Midori mpd[5671]: May 25 18:21 : exception: Failed to bind to '[::1]:6600'
May 25 18:21:31 Midori mpd[5671]: May 25 18:21 : exception: nested: Failed to bind socket: Address already in use
May 25 18:21:31 Midori systemd[1110]: mpd.service: Main process exited, code=exited, status=1/FAILURE
May 25 18:21:31 Midori systemd[1110]: mpd.service: Failed with result 'exit-code'.
May 25 18:21:31 Midori systemd[1110]: Failed to start Music Player Daemon.Hope this would help you to understand the issue.
Offline
You need to stop the system wide mpd to start the user based one. The problem right now seems to be that the system wide one is triggered via socket so disable that as well
sudo systemctl disable --now mpd.socket mpd.service
systemctl --user start mpdOffline
Tintin5371 wrote:So why isn't mpd able to detect the database on its own after it is created?
Because it might be looking at a different place.
Are you running mpd system wide? Then it will look for it in /var/lib/mpd.
Can you post the status of mpd.service? Either system or user depending on what you're using.
Yes you were right. I guess there was permission error on /var/lib/mpd directory. So I gave it write and execute permission to the directory and currently it is working perfectly. But how is it possible to make it work using the mpd file in my home directory?
Offline
By starting it properly as your user. See my comment above, you need to stop the system wide instance so that the one from your user can start properly.
Offline
I've noticed this is a very common issue & v1del is usually right on the money when suggests MPD is running systemwide opposed to --user, maybe a sticky in
Multimedia and Games would suffice ?
OP please edit your first post and mark as [solved] if no further support is required on this issue.
regards
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline
You can run mpd as system service, https://wiki.archlinux.org/index.php/Mu … figuration
What we'd rather need is a reminder, when opening a thread, to always RTFW first…
Online
You can run mpd as system service, https://wiki.archlinux.org/index.php/Mu … figuration
What we'd rather need is a reminder, when opening a thread, to always RTFW first…
I did read the wiki as well as searched enough for 1 whole day almost but couldn't get it to work since I wasn't aware that it should be run as a --user and not as root nor was it anywhere suggested. Moreover there was permission issue with the folder and not the file since the database file had write and execute permissions from the very beginning. If I would've got the answer already I wouldn't have bothered to ask in the first place.
Anyway thank you guys it works now perfectly.
Last edited by Tintin5371 (2020-05-26 10:46:01)
Offline
I was actually talking to cirrus, though since you claimed this wasn't anywhere suggested…
Autostart with systemd
The mpd package provides a user service file. The service starts the process as user, there is no need to change permission nor use the user and group variables in the MPD configuration file.start/enable the user unit mpd.service (i.e. with the --user flag).
And once more: you do not *have* to run it as user service, though it's what most people want. And the wiki actually explains all of this …
Online
Well yeah I saw that later on and wasn't actually aware that it was a problem related to the service. Currently I'm aware that I don't have to run it as a service since I couldn't get it to work even just launching it I thought running it as a service would be the answer to the issue but I was wrong.
Offline
What we'd rather need is a reminder, when opening a thread, to always RTFW first…
it might work.
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline