Mopidy + soundcloud sets URI scheme

Hello, I’m having difficulty understanding the requirements for loading Soundcloud sets into mopidy-soundcloud. I’m always running into URI scheme errors. From some searching I found this thread, and it appears that his pull request was merged in to master a while ago. I’ve got my API key set in mopidy.conf, yet any way I try it there no go. In Moped I’m actually able to see the name of my set, but no songs within it.

Any advice would be greatly appreciated.

Please provide your version information (sudo mopidyctl deps). Do the other parts of Mopidy-Soundcloud work for you? Have you checked the Mopidy log for any errors/warnings messages?

This works for me:

nick@xps:~$ mpc add sc:https://soundcloud.com/yndihalda/sets/dash-and-blast
nick@xps:~$ mpc playlist
yndi halda - 01 Dash And Blast
yndi halda - 02 We Flood Empty Lakes
yndi halda - 03 A Song For Starlit Beaches
yndi halda - 04 Illuminate My Heart, My Darling

Does that example work for you? Can you provide an example of a set that does not work?

See attached-

Using the same MPC add command with my own playlist results in URI scheme errors.

root@crates:/home/kz# mopidyctl deps
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
Executable: /usr/bin/mopidy
Platform: Linux-5.4.0-1021-aws-x86_64-with-glibc2.29
Python: CPython 3.8.2 from /usr/lib/python3.8
Mopidy: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-Moped: 0.7.1 from /usr/local/lib/python3.8/dist-packages
  setuptools: 45.2.0 from /usr/lib/python3/dist-packages
  Mopidy: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-SoundCloud: 3.0.0 from /usr/lib/python3/dist-packages
GStreamer: 1.16.2.0 from /usr/lib/python3/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.36.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad
root@crates:/home/kz# mopidyctl config
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[moped]
enabled = true

[file]
enabled = true
media_dirs =
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist =
timeout = 5000

[soundcloud]
enabled = true
explore_songs = 25
auth_token = ********
root@crates:/home/kz# mpc add sc:https://soundcloud.com/cratesfm/sets/test
error adding sc:https://soundcloud.com/cratesfm/sets/test: Unsupported URI scheme
root@crates:/home/kz#

You don’t have Mopidy-MPD installed so I can only assume your mpc commands are talking to some version of mpd you have installed. You need to install Mopidy-MPD and then either configure it to run on a port other than the default (6600) so it does not clash with mpd, or keep the default port and stop mpd instead.

Gotcha, i suppose from reading the docs I was under the impression that mopidy itself parsed own version of MPD and the mopidy-mpd was like the original MPD spec. If using mopid-mpd am I correct to assume that MPD itself is not needed?

Progress:

root@crates:/home/kz# netstat -tulpn | grep 6600
tcp6       0      0 127.0.0.1:6600          :::*                    LISTEN      574/python3
root@crates:/home/kz# mopidyctl deps
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
Executable: /usr/bin/mopidy
Platform: Linux-5.4.0-1021-aws-x86_64-with-glibc2.29
Python: CPython 3.8.2 from /usr/lib/python3.8
Mopidy: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-SoundCloud: 3.0.0 from /usr/lib/python3/dist-packages
Mopidy-Moped: 0.7.1 from /usr/local/lib/python3.8/dist-packages
  setuptools: 45.2.0 from /usr/lib/python3/dist-packages
  Mopidy: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-MPD: 3.0.0 from /usr/lib/python3/dist-packages
GStreamer: 1.16.2.0 from /usr/lib/python3/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.36.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad
root@crates:/home/kz# mopidyctl config
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[moped]
enabled = true

[file]
enabled = true
media_dirs =
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist =
timeout = 5000

[soundcloud]
enabled = true
explore_songs = 25
auth_token = ********

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist =
  listall
  listallinfo
default_playlist_scheme = m3u
root@crates:/home/kz# mpc add sc:https://soundcloud.com/cratesfm/sets/test
error adding sc:https://soundcloud.com/cratesfm/sets/test: directory or file not found

Is there an additional configuration that I’m missing that is resulting in it looking locally?

Correct.

Shouldn’t be. Does your Mopidy log show Mopidy-SoundCloud started OK?

I guess I am slightly wary that I said to use mopidyctl, which is for the normal case of interacting with the Mopidy service. But you don’t have a normal setup here, you are running as root. I am guessing you are not using our service at all and you have started Mopidy manually. When you start manually you’ll be picking up a different config file to what our service uses (and to what mopidyctl reports). And so SoundCloud is probably just not configured properly. But that should be pretty obvious in the log file.

So how are you starting/running Mopidy?

Its running as a service, with the mopidy user. I’m just logged in as root because lazy.

Good catch, I checked the log, and remembered that I put n a different(incorrect) soundcloud ID when i was troubleshooting. I fixed the ID and everything is working now.

Thanks for your help!

As a continuation of the mopidy-mpd and mopidy-soundcloud setup, one thing I’m still running into an issue which is upon execution of mpc play, I’m greeted with GStreamer errors.

Aug 25 19:32:02 cast.crates.fm mopidy[7652]: ERROR    [MainThread] mopidy.audio.gst GStreamer error: Forbidden
Aug 25 19:32:02 cast.crates.fm mopidy[7652]: WARNING  [MainThread] mopidy.audio.gst GStreamer warning: Failed to connect: Connection refused
Aug 25 19:32:02 cast.crates.fm mopidy[7652]: INFO     [MpdSession-12] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:45766
Aug 25 19:31:50 cast.crates.fm mopidy[7652]: ERROR    [MainThread] mopidy.audio.gst GStreamer error: Forbidden
Aug 25 19:31:50 cast.crates.fm mopidy[7652]: WARNING  [MainThread] mopidy.audio.gst GStreamer warning: Failed to connect: Connection refused

I’m running as a system service, are there any special permissions that I need to grant to the mopidy user?

Is this with pulseaudio? There’s a note on our docs about the extra config step required for that.

I don’t believe that pulseaudio is installed.

kz@cast:~$ sudo apt list pulseaudio*
Listing... Done
pulseaudio-equalizer/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-bluetooth/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-gsettings/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-jack/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-lirc/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-raop/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-module-zeroconf/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio-utils/focal-updates 1:13.99.1-1ubuntu3.5 amd64
pulseaudio/focal-updates 1:13.99.1-1ubuntu3.5 amd64

Ive also verified that I’m able to connect to Icecast using the configured credentials via another app.

So this is with Mopidy configured to use icecast output, as in your other thread? Or is this with a normal output?

I’ve tried it with Icecast output as well as autoaudiosink and get the same result.