GithubHelp home page GithubHelp logo

aditya-k2 / gomp Goto Github PK

View Code? Open in Web Editor NEW
84.0 5.0 2.0 16.24 MB

MPD client inspired by ncmpcpp with builtin cover-art view and LastFM integration.

License: GNU General Public License v3.0

Go 97.25% Shell 1.26% Makefile 1.49%
mpd-client go golang mpd music tui terminal-based

gomp's Introduction

aditya-K2 (Aditya Kurdunkar)

Project Showcase

  • gspt - Spotify for terminal written in Go.
  • scandoc - A GTK Application to scan Documents and Compile PDFs
  • brow - A simple terminal utility to get browser history
  • gomp - A terminal client for MPD with native cover-art rendering capabilities
Others

gomp's People

Contributors

aditya-k2 avatar johnallen3d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gomp's Issues

Files Section Not Working And No Help Text.

As Someone New In Linux, I Never Managed To Find How To Use Gomp. But Upon Experimenting, I Managed To Figure Out Some Keys To Use.

Also My Songs Directory Is Same Mentioned In MPD Configs And In Gomp Configs. Yet Songs Cannot Be Played.

Note :- Using In Termux. Android 10 MIUI 12.5

`No Image Extracted`, reverts to fallback image.

Version: 1.0.1.
Terminal: alacritty 0.12

When I open up gomp I get the error: No Image Extracted, and it shows the fallback image.

2023-05-11_14-41

How can this be fixed? I read in earlier issues that only certain filetypes are supported. I only have mp3s in my library.

Image not placed correctly

(I used a random image as the default, please pay no attention)
image
The first terminal (up) is st, the second one (down) is alacritty. I also tested with urxvt and got the same issue.

Sidenote : What are the naming conventions, so the album picture is read ?

Panic: dial tcp

error:

Could Not Connect to MPD Server
Make Sure You Mention the Correct MPD Port in the config file.
panic: dial tcp [::1]:6600: connect: connection refused

goroutine 1 [running]:
main.main()
	github.com/aditya-K2/gomp/main.go:29 +0x21cf

My config.yml

MUSIC_DIRECTORY: "~/Music/"
ADDITIONAL_PADDING_X : 9
ADDITIONAL_PADDING_Y : 17
IMAGE_WIDTH_EXTRA_X  : -1.1
IMAGE_WIDTH_EXTRA_Y  : -3.75
MPD_PORT : "6600"
togglePlayBack : [ "p", "SPACE", "]" ]
CACHE_DIR : "~/.config/gomp/cache/"

My mpd.conf

music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
db_file "~/.config/mpd/mpd.db"
log_file "~/.config/mpd/mpd.log"
pid_file "~/.config/mpd/mpd.pid"
state_file "~/.config/mpd/mpdstate"

audio_output {
        type "pulse"
        name "pulse audio"
}

audio_output {
	type                    "fifo"
	name                    "my_fifo"
	path                    "/tmp/mpd.fifo"
	format                  "44100:16:2"
}

bind_to_address "127.0.0.1"
port "6600"

Support SubSonic API

Hey all,

Gomp looks supremely awesome and I would love to use it, but I don't run mpd anymore and have moved to gonic for music streaming server
I'm not sure how difficult it would be, or whether you'd want to support this, so this is just a suggestion :)

Runtime Error

Building the project works fine, but when running the executable, I get this message :

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x5b0a33]

goroutine 23 [running]:
gitlab.com/diamondburned/ueberzug-go.NewImage({0x0, 0x0}, 0x0, 0x0)
        /home/luc/.local/share/go/pkg/mod/gitlab.com/diamondburned/[email protected]/ueberzug.go:25 +0x53
main.openImage({0xc0000e29c0, 0xc0000c04c0}, 0x1)
        /home/luc/repos/externals/goMP/render.go:45 +0x6c
created by main.(*Renderer).Start
        /home/luc/repos/externals/goMP/render.go:63 +0x8f

(The repository is cloned at /home/luc/repos/externals)

[@somerandomguy24] gomp increases the cpu usage of one of the cores to 100%

Whenever gomp is launched, gomp increases the cpu usage of one of my cores to 100%, which I'm guessing is not what happens to most people (It might be to do with the number of songs I have in my library (> 1200)).
Other information:

mpd-version: 0.23.12
gomp-version: 1.0.0 (2a2579c)
terminal-emulator: alactitty 0.11.0
shell: ash (busybox 1.36.0) | bash (5.2.15)

Originally posted by @somerandomguy24 in #50 (reply in thread)

Opening a song with unknown duration crashes goMP

Creating this Issue as a reference. Might be helpful if someone runs into the same issue. This is happening due to the duration is by default set to zero by mpd which means we can't find the percentage and which makes the slice go out of bound.

goMP PKGBUILD

If you're using Arch Linux, here's how i build package

pkgname=goMP
pkgver=0.1
pkgrel=1
pkgdesc='MPD client inspired by ncmpcpp written in GO.'
arch=('any')
url="https://github.com/aditya-K2/goMP"
license=('GPL')
depends=('go')
makedepends=('go')
source=("https://github.com/aditya-K2/goMP/archive/refs/heads/master.zip")
sha256sums=('SKIP')

build() {
    cd "${pkgname}-master"
    go build
}

package() {
    cd "${pkgname}-master"
    install -Dm 655 goMP -t "${pkgdir}/usr/bin"
}

Performance with larger lists really bad

I'm running gomp on a pretty powerful machine, yet with a larger playlist of over 1k entries the TUI feels awfully sluggish. Pressing arrow down for a few seconds and letting it go makes the selection continue to advance for several seconds before it stops.

Album art not displaying, fallback image also not displaying.

Hi, I am trying out gomp for the first time. I used the example config and was able to connect to my server no problem, the only thing I changed was disabling lastfm art downloading as my files should have images embedded. Upon launching, no image (not even a preview image) is displayed, and a message pops up in the corner that simply says "Error Rendering Image!".

My terminal emulator is Alacritty. I suspect the issue has something to do with my terminal emulator configuration, but I couldn't find anything online about enabling image rendering in Alacritty, and I couldn't find anything in the gomp documentation about extra steps/ troubleshooting to get images to show up. If anyone has any experience or suggestions it would be appreciated, and let me know if you need other information.

image

[@somerandomguy24] Border not rendered properly in `ash`

There characters surrounding the queue appear to be missing, is there any particular font that is needed to render these? (after further testing, it seems that it is rendered in bash, just not ash (alpine's default shell).
image
Other information:

mpd-version: 0.23.12
gomp-version: 1.0.0 (2a2579c)
terminal-emulator: alactitty 0.11.0
shell: ash (busybox 1.36.0) | bash (5.2.15)

Originally posted by @somerandomguy24 in #50 (reply in thread)

panic: runtime error: invalid memory address or nil pointer dereference

I haven't had any success getting gomp to run to this point. I decided to try troubleshooting a little bit and have a slightly better understanding of why now. It looks like Notify is nil when GetImagePath is executed.

I added fmt.Println(Notify) here and this is what I see.

$ go build && ./gomp
<nil>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x13a10ea]

goroutine 4 [running]:
github.com/aditya-K2/gomp/render.GetImagePath({0xc0000280f6, 0x3e})
	/Users/johna/tmp/gomp/render/render.go:106 +0x38a
github.com/aditya-K2/gomp/render.OpenImage({0xc0000280f6, 0x3e}, 0x0?)
	/Users/johna/tmp/gomp/render/render.go:59 +0x6f
created by github.com/aditya-K2/gomp/render.(*Renderer).Start
	/Users/johna/tmp/gomp/render/render.go:79 +0x8a

Unfortunately, I have very little experience with Go, otherwise, I'd try to troubleshoot further.

Some further information. I'm running on macOS and building from source. I'm using Kitty and not really expecting imagine rending to work at this point.

Image Conversion Logging Breaks TUI

Certain album covers which use atypical colour encoding (e.g. grayscale) can cause messages to be logged to stdout, which leads to strange visual bugs and issues rendering the TUI correctly.

image

image

"Converting image type *image.Gray the slow way. Optimization for this image type hasn't been added yet."

panic: EOF

how to corret it :

  Could Not Generate the File Map
  Make Sure You Mention the Correct MPD Port in the config file.
  panic: EOF

  goroutine 1 [running]:
  main.main()
      .../gomp/main.go:65 +0x2112
  exit status 2

Gomp freezes upon toggling playback

ฮป gomp -v
gomp 1.0.0
Report any issues at: https://github.com/aditya-K2/gomp/issues

Upon pressing p, gomp ceases to redraw, but continues to accept keyboard input until it is quit. When it advances to the next song, the album art is redrawn, while the rest of the ui stays static.

panic: runtime error: invalid memory address or nil pointer dereference

Steps to build the latest version :
1/ go build on master branch
2/ get default version https://github.com/aditya-K2/goMP/blob/master/sample_config.yml to .config/$USER/goMP/config.yml and change MUSIC_DIRECTORY

The program needs a local mpd configuration file :
No config File for mpd Found panic: open $USER/.config/mpd/mpd.conf: no such file or directory
but i'm using config file at /etc/mpd.conf (why not add an option to set config file path ?)

./goMP
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x78d5fb]

goroutine 3 [running]:
main.getImagePath({0xc0000280c6, 0x38})
        /home/user/goMP/render.go:94 +0x5bb
main.openImage({0xc0000280c6, 0x38}, 0x0)
        /home/user/goMP/render.go:47 +0x6f
created by main.(*Renderer).Start
        /home/user/goMP/render.go:67 +0x8f

[Request] Release binaries on github

Thanks for your work on this tool.

I'm a long time cli mpd clients user (ncmpcpp).
Just heard about gomp in the Arch linux forums.

I'm eager to try it out.
We do already have a "recipe" called PKGBUILD for building it on Archlinux. Either the "release" version or the "git" version.

https://aur.archlinux.org/packages/gomp or https://aur.archlinux.org/packages/gomp-git

I just dont want to download 500 Mega of Go just to compile it.
Especially in tiny ARM devices which are perfect for running mpd and/or a cli client.
Ex. Raspberry Pi (aarch64 or armv7h) or chromebooks.

Since it is written in Go, and github makes it easy and free to release binaries with automated github workflows for many different architectures

This would also make it very easy for package maintainers of different Linux distros to create a "gomp-bin" version for their distro that basicly just pulls the binary from github.

It's what many "famous" and popular go github projects do.

See for example how,

https://github.com/junegunn/fzf
https://github.com/gokcehan/lf

do it.

Thanks in advance.

Adding fallback values in case no mpd config file is found

Hi! I recently tried to package gomp for NixPkgs. However, i discovered a very specific "bug" (or intended behavior) that makes the process difficult.

In it's current state, gomp crashes if no mpd config is found anywhere, throwing a No File Found at path : /etc/mpd.conf. The problem is, in NixOS, if you configure mpd in a declarative manner with the default settings attrset, it will write the configuration to the nix store, which makes it so that it can't be found by gomp, and the config path can't be patched from the nix derivation in a reproducible manner either. Besides that, this behavior causes custom mpd.conf paths in any other distro to not work.

What would fix the issue is if the application defined a fallback default value to avoid these types of crashes. So, for example, if the mpd config file wasn't found, the default mpd port (6600) would be set and could be overridden from gomp's config file.

Gomp seems like a great music player, and it's one of the few that provides native last.fm support, so I would be very happy to package it for nixpkgs! Thanks for continuously developing this application. If you need any additional info about the problem, feel free to ask.

gomp panic: invalid memory address

Just found this project, looks interesting. Installed it from aur, but ran into this error.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x563de28a0cf3]

goroutine 6 [running]:
gitlab.com/diamondburned/ueberzug-go.NewImage({0x0, 0x0}, 0x0?, 0x0?)
	gitlab.com/diamondburned/[email protected]/ueberzug.go:25 +0x53
github.com/aditya-K2/gomp/render.OpenImage({0xc000165946, 0x3a}, 0x0?)
	github.com/aditya-K2/gomp/render/render.go:52 +0x110
created by github.com/aditya-K2/gomp/render.(*Renderer).Start
	github.com/aditya-K2/gomp/render/render.go:70 +0x8a

Cloned the git repo, built it from there, same error. Then I checked out to an earlier commit. Same error. Seems it might be something on my side.
Here is my config.yml

MPD_PORT : "6600"
MUSIC_DIRECTORY : "~/Music"
DEFAULT_IMAGE_PATH : "~/Pictures/defaultlain.jpg"
SEEK_OFFSET : 5
CACHE_DIR : "~/.config/gomp/cache"
#GET_COVER_ART_FROM_LAST_FM : "TRUE"
#LASTFM_API_KEY : "4e316e10a94a2eef30b605fc3db04cf1"
#LASTFM_API_SECRET : "d95f07d336316312a81e34680c6d5bb2"

Please advise. Also, sorry for making an empty issue and then editing it later. Was about to type this up when I misclicked and then something came up.

TogglePlayBack should be able to start playback when there is no active song playing by MPD

Discussed in #53

Originally posted by vendion March 3, 2023
So far gomp is coming along nicely as a modern TUI client for MPD but as it stands, I cannot use only gomp due to one major annoyance. If MPD is in a stopped state and has no songs in the play queue, I can use gomp to go through my library and add songs to the queue no problem. What I can't do though is to use togglePlayBack (default keymap p) to start playback. To get MPD to actually start playing, I have to use a different client (mcp, ncmpcpp, etc) and then I can manage playback with gomp.

Is this the expected behavior? If so I can't find another command in the key_map map that sounds like it will start playback from a stopped state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.