Mopidy: Bug: Copy multiple .mp3 files to mopidy server machin

Created on 29 Feb 2016  路  13Comments  路  Source: mopidy/mopidy

I copied 20 mp3 files to mopidy server
location:
/home/pi/Music
when I try to local scan with this command:
sudo mopidyctl local scan

WARNING Failed local:track:Fekete%20Teve/Fekete%20Teve%20-%20R%C5%91zse-Dalok%20%282011%29/01%20-%20Fekete%20Teve%20-%20Szeptember.mp3: Track shorter than 100ms

But It is a valid mp3 file becuase I can play via terminal:

omxplayer 01\ -\ Fekete\ Teve\ -\ Szeptember.mp3

If I run the sudo mopidyctl local scan several times sometimes mopidy scan is successfuly but mostly not.

C-bug A-audio

Most helpful comment

There are a couple of options but the quick and dirty is just to replace file /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py with the updated version:

$ cp  /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py scan.py.bak
$ wget https://raw.githubusercontent.com/SeeSpotRun/mopidy/fix/gstreamer_not_pushing_tags_2/mopidy/audio/scan.py
$ sudo cp scan.py   /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py

This just makes a backup copy of the original, downloads the new version and then copies it over the original. You may need to install the wget utility first using sudo apt-get install wget
Then restart mopidy.
You can revert using:

$ sudo cp scan.py.bak /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py

All 13 comments

Please run the command mopidy deps and provide the last section, from "GStreamer:" and down. This will tell us what MP3 decoding elements you have in your GStreamer installation.

Dupe of #935, or maybe same root cause at least?

Yes I think its the same bug

Here is the mopidy deps output:

pi@musicbox ~ $ mopidy deps
Executable: /usr/bin/mopidy
Platform: Linux-4.1.10-v7+-armv7l-with-debian-8.0
Python: CPython 2.7.9 from /usr/lib/python2.7
Mopidy: 2.0.0 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
  tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
Mopidy-MusicBox-Webclient: 2.1.1 from /usr/local/lib/python2.7/dist-packages
  setuptools: 5.5.1 from /usr/lib/python2.7/dist-packages
  Mopidy>=1.1.0: 2.0.0 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
Mopidy-Local-Images: 1.0.0 from /usr/local/lib/python2.7/dist-packages
  uritools>=1.0: 1.0.1 from /usr/local/lib/python2.7/dist-packages
    ipaddress>=1.0.6: 1.0.16 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  setuptools: 5.5.1 from /usr/lib/python2.7/dist-packages
  Mopidy>=1.1: 2.0.0 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify-Web: 0.3.0 from /usr/local/lib/python2.7/dist-packages
  setuptools: 5.5.1 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.19.0: 2.0.0 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  Mopidy-Spotify>=1.2.0: 3.0.0 from /usr/lib/python2.7/dist-packages
    Mopidy>=2.0: 2.0.0 from /usr/lib/python2.7/dist-packages
      Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
      requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
      tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
      cffi>=1.0.0: 1.1.2 from /usr/lib/python2.7/dist-packages
        pycparser: 2.10 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
  requests: 2.4.3 from /usr/lib/python2.7/dist-packages
  spotipy: 2.3.7 from /usr/local/lib/python2.7/dist-packages
    requests>=1.0: 2.4.3 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 3.0.0 from /usr/lib/python2.7/dist-packages
  Mopidy>=2.0: 2.0.0 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
    cffi>=1.0.0: 1.1.2 from /usr/lib/python2.7/dist-packages
      pycparser: 2.10 from /usr/lib/python2.7/dist-packages
  requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
GStreamer: 1.4.4.0 from /usr/lib/python2.7/dist-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.14.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mad
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec

I wonder if this is a similar upstream bug to https://bugzilla.gnome.org/show_bug.cgi?id=762660.

Maybe you could try the following on a couple of files that do/don't scan correctly:

$ gst-launch-1.0 filesrc location=foo.mp3 \
! mpegaudioparse ! fakesink \
num-buffers=2 silent=false -v -m | grep --color -E "duration|preroll|"

... to see if gstreamer is returning the data in an unexpected order, in which case we should file an upstream bug report.

Upstream fix applied by the good folks at gstreamer. This should fix #935, #1453, #1474 and #1480.

To benefit from the upstream fix you will either need to compile gstreamer from source (https://cgit.freedesktop.org/gstreamer/gstreamer/) or wait for gstreamer 1.7.91 to be released for your distro.

In the meantime I'll raise a pull request with a workaround for mopidy.

@szuniverse: : if you have a chance, could you please test using https://github.com/SeeSpotRun/mopidy/tree/fix/gstreamer_not_pushing_tags_2 to see if this fixes the problem? This branch has a workaround in mopidy/audio/scan.py to address an upstream bug in gstreamer.

Alternatively if you are feeling adventurous you could try compiling gstreamer from git source...

Could you help me how can I install this branch? I am using raspberry pi with latest RASPBIAN JESSIE.
and i usually install mopidy with these commands:

https://docs.mopidy.com/en/latest/installation/debian/

There are a couple of options but the quick and dirty is just to replace file /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py with the updated version:

$ cp  /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py scan.py.bak
$ wget https://raw.githubusercontent.com/SeeSpotRun/mopidy/fix/gstreamer_not_pushing_tags_2/mopidy/audio/scan.py
$ sudo cp scan.py   /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py

This just makes a backup copy of the original, downloads the new version and then copies it over the original. You may need to install the wget utility first using sudo apt-get install wget
Then restart mopidy.
You can revert using:

$ sudo cp scan.py.bak /usr/lib/python2.7/dist-packages/mopidy/audio/scan.py

nice. it works fine! good job :+1: :)

1487 has been merged.

I am not sure were this issue is supposed to be posted so I will give it a try right here:
Since I installed mopidy on a fresh raspian jessie image I can neither play local stored m4a nor mp3 files.
It has a HifiBerry sound card installed (worked before) and mopidy runs as a service BUT SINCE REINSTALLATION the command "sudo mopidyctl local scan" results in errors for all found files.

EXAMPLE:

WARNING Failed local:track:DJ%20Wigs/Loungin%27/01%20Titel%2001.m4a: No audio found in file.

mopidy deps says:

$ mopidy deps
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Executable: /usr/bin/mopidy
Platform: Linux-4.1.19+-armv6l-with-debian-8.0
Python: CPython 2.7.9 from /usr/lib/python2.7
Mopidy: 2.0.0 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
requests>=2.0: 2.4.3 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 3.2.2 from /usr/lib/python2.7/dist-packages
GStreamer: 1.4.4.0 from /usr/lib/python2.7/dist-packages/gi
Detailed information:
Python wrapper: python-gi 3.14.0
Relevant elements:
Found:
uridecodebin
souphttpsrc
appsrc
alsasink
osssink
oss4sink
pulsesink
flump3dec
id3demux
id3v2mux
mad
mpegaudioparse
mpg123audiodec
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
lamemp3enc

And the actual config looks like this:

$ sudo 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

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

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

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

[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

[http]
enabled = true
hostname = 127.0.0.1
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

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

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs =
$XDG_MUSIC_DIR|Music
~/|Home
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /media/usb1/iTunes Music
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.png

The music files did play well on the old installation and the file permission to all of them is set like this:

$ ls -l /media/usb1/iTunes\ Music/DJ\ Wigs/Loungin\'/
total 155992
-rwxr-xr-x 1 mopidy audio 31944754 Mar 7 2011 01 Titel 01.m4a
-rwxr-xr-x 1 mopidy audio 44805884 Mar 7 2011 02 Titel 02.m4a
-rwxr-xr-x 1 mopidy audio 42822626 Mar 7 2011 03 Titel 03.m4a
-rwxr-xr-x 1 mopidy audio 40156581 Mar 7 2011 04 Titel 04.m4a

Could anyone point me in the right direction with my question as to how to solve this? If necessary I could provide further information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kingosticks picture kingosticks  路  12Comments

altano picture altano  路  6Comments

djselbeck picture djselbeck  路  8Comments

godzillamesel picture godzillamesel  路  6Comments

ice-bear-forever picture ice-bear-forever  路  6Comments