Raspberry Pi 3 Mp3 music play


#1

I have my ubuntu desktop running mycroft. Now I am setting up my raspberry pi 3.
The default skills all installed and I am trying to get mopidy and mpd control skills to work.

I was able to get demo_skill to work for playing music on my ubuntu machine by adding my music to the mp3 demo_skill/mp3 folder.

However, on my raspberry pi 3 I can not get the demo_skill, mopidy, mpd control skills working.

Does the mopidy, mpd_control, demo_skill skills work on the raspberry pi ?


#2

Having issues to start mopidy_skill.
sudo systemctl start mycroft-skill
when I check from the log file it shows the skill not starting
grep mopidy_skill /var/log/mycroft-skill.log

However; I can start it using the skill-container

mycroft-skill-container /opt/mycroft/skills/mopidy_skill

When I installed I installed the mopidy skill to
/opt/mycroft/skills/mopidy_skill

Not sure why it won’t start with normal service startup.


#3

OK it would appear that pulseaudio and mopidy on the raspberry pi 3 have a problem.

What I see is I can play 1, maybe two songs. Then the pulseaudio stops playing.


#4

The pulsesink plugin as well can not be found regardless of installing all the necessary gstreamer plugins

see below

pi@picroft:~ $ mopidy deps
Executable: /usr/local/bin/mopidy
Platform: Linux-4.9.35-v7±armv7l-with-debian-8.0
Python: CPython 2.7.9 from /usr/lib/python2.7
Mopidy: 2.1.0 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
requests>=2.0: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
tornado>=3.2: 4.2.1 from /usr/local/lib/python2.7/site-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/site-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
Mopidy-MusicBox-Webclient: 2.4.0 from /usr/local/lib/python2.7/site-packages
Mopidy>=1.1.0: 2.1.0 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
requests>=2.0: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
tornado>=3.2: 4.2.1 from /usr/local/lib/python2.7/site-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/site-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
Mopidy-Youtube: 2.0.2 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
pafy>=0.3.35: 0.5.3.1 from /usr/local/lib/python2.7/site-packages
requests>=2.2.1: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
Mopidy>=1.0: 2.1.0 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
requests>=2.0: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
tornado>=3.2: 4.2.1 from /usr/local/lib/python2.7/site-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/site-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
Mopidy-TuneIn: 0.4.1 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
requests>=2.0.0: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
Mopidy>=1.1: 2.1.0 from /usr/local/lib/python2.7/site-packages
Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
setuptools: 36.3.0 from /usr/local/lib/python2.7/site-packages
requests>=2.0: 2.18.4 from /usr/local/lib/python2.7/site-packages
certifi>=2017.4.17: 2017.7.27.1 from /usr/local/lib/python2.7/site-packages
chardet<3.1.0,>=3.0.2: 3.0.4 from /usr/local/lib/python2.7/site-packages
idna<2.7,>=2.5: 2.6 from /usr/local/lib/python2.7/site-packages
urllib3<1.23,>=1.21.1: 1.22 from /usr/local/lib/python2.7/site-packages
tornado>=3.2: 4.2.1 from /usr/local/lib/python2.7/site-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/site-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/site-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
id3demux
id3v2mux
lamemp3enc
mad
mpegaudioparse
mpg123audiodec
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
pulsesink
flump3dec


#5

When I try testing my ubuntu desktop machine which has mycroft installed and mopidy I can see the pulsesink plugin. Of course this causes me grief if I want to make the pulseaudio as a service using pulsesink for output audio

see below

legtod2@legtod2-G41MT-S2P:~$ mopidy deps
Executable: /usr/local/bin/mopidy
Platform: Linux-3.16.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
Python: CPython 2.7.6 from /usr/lib/python2.7
Mopidy: 2.1.0 from /usr/local/lib/python2.7/dist-packages
tornado>=3.2: 4.5.1 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
six: 1.5.2 from /usr/lib/python2.7/dist-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/dist-packages
backports-abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
requests>=2.0: 2.2.1 from /usr/lib/python2.7/dist-packages
Mopidy-MusicBox-Webclient: 2.4.0 from /usr/local/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Mopidy>=1.1.0: 2.1.0 from /usr/local/lib/python2.7/dist-packages
tornado>=3.2: 4.5.1 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
six: 1.5.2 from /usr/lib/python2.7/dist-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/dist-packages
backports-abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
requests>=2.0: 2.2.1 from /usr/lib/python2.7/dist-packages
Mopidy-Local-SQLite: 1.0.0 from /usr/local/lib/python2.7/dist-packages
uritools>=1.0: 2.0.0 from /usr/local/lib/python2.7/dist-packages
ipaddress: 1.0.18 from /usr/local/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Mopidy>=1.1: 2.1.0 from /usr/local/lib/python2.7/dist-packages
tornado>=3.2: 4.5.1 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
six: 1.5.2 from /usr/lib/python2.7/dist-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/dist-packages
backports-abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
requests>=2.0: 2.2.1 from /usr/lib/python2.7/dist-packages
Mopidy-TuneIn: 0.4.1 from /usr/local/lib/python2.7/dist-packages
requests>=2.0.0: 2.2.1 from /usr/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
Mopidy>=1.1: 2.1.0 from /usr/local/lib/python2.7/dist-packages
tornado>=3.2: 4.5.1 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
six: 1.5.2 from /usr/lib/python2.7/dist-packages
certifi: 2017.7.27.1 from /usr/local/lib/python2.7/dist-packages
backports-abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
setuptools: 3.3 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
requests>=2.0: 2.2.1 from /usr/lib/python2.7/dist-packages
GStreamer: 1.2.4.0 from /usr/lib/python2.7/dist-packages/gi
Detailed information:
Python wrapper: python-gi 3.12.0
Relevant elements:
Found:
uridecodebin
souphttpsrc
appsrc
alsasink
osssink
oss4sink
pulsesink <–
id3demux
id3v2mux
lamemp3enc
mad
mpegaudioparse
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
flump3dec
mpg123audiodec


#6

I am quite sure I have all the required pakages for Gstream installed.

pi@picroft:~ $ dpkg -l |grep pulse
ii libpulse0:armhf 5.0-13 armhf PulseAudio client libraries
ii libpulsedsp:armhf 5.0-13 armhf PulseAudio OSS pre-load library
ii pulseaudio 5.0-13 armhf PulseAudio sound server
ii pulseaudio-module-x11 5.0-13 armhf X11 module for PulseAudio sound server
ii pulseaudio-utils 5.0-13 armhf Command line tools for the PulseAudio sound server
pi@picroft:~ $ dpkg -l |grep GStre
ii gir1.2-gst-plugins-base-0.10 0.10.36-2 armhf Description: GObject introspection data for the GStreamer Plugins Base library
ii gir1.2-gst-plugins-base-1.0 1.4.4-2+deb8u1 armhf Description: GObject introspection data for the GStreamer Plugins Base library
ii gir1.2-gstreamer-0.10 0.10.36-1.5 armhf Description: GObject introspection data for the GStreamer library
ii gir1.2-gstreamer-1.0 1.4.4-2+deb8u1 armhf Description: GObject introspection data for the GStreamer library
ii gstreamer0.10-alsa:armhf 0.10.36-2 armhf GStreamer plugin for ALSA
ii gstreamer0.10-gconf:armhf 0.10.31-3+nmu4+deb8u2 armhf GStreamer plugin for getting the sink/source information from GConf
ii gstreamer0.10-plugins-base:armhf 0.10.36-2 armhf GStreamer plugins from the “base” set
ii gstreamer0.10-plugins-good:armhf 0.10.31-3+nmu4+deb8u2 armhf GStreamer plugins from the “good” set
ii gstreamer0.10-plugins-ugly:armhf 0.10.19-2.1+b1 armhf GStreamer plugins from the “ugly” set
ii gstreamer0.10-tools 0.10.36-1.5 armhf Tools for use with GStreamer
ii gstreamer0.10-x:armhf 0.10.36-2 armhf GStreamer plugins for X11 and Pango
ii gstreamer1.0-alsa:armhf 1.4.4-2+deb8u1 armhf GStreamer plugin for ALSA
ii gstreamer1.0-libav:armhf 1.4.4-2 armhf libav plugin for GStreamer
ii gstreamer1.0-plugins-bad:armhf 1.4.4-2.1+deb8u2 armhf GStreamer plugins from the “bad” set
ii gstreamer1.0-plugins-base:armhf 1.4.4-2+deb8u1 armhf GStreamer plugins from the “base” set
ii gstreamer1.0-plugins-good:armhf 1.4.4-2+deb8u3 armhf GStreamer plugins from the “good” set
ii gstreamer1.0-plugins-ugly:armhf 1.4.4-2+deb8u1 armhf GStreamer plugins from the “ugly” set
ii gstreamer1.0-tools 1.4.4-2+deb8u1 armhf Tools for use with GStreamer
ii gstreamer1.0-x:armhf 1.4.4-2+deb8u1 armhf GStreamer plugins for X11 and Pango
ii libgstreamer-plugins-bad1.0-0:armhf 1.4.4-2.1+deb8u2 armhf GStreamer development files for libraries from the “bad” set
ii libgstreamer-plugins-base0.10-0:armhf 0.10.36-2 armhf GStreamer libraries from the “base” set
ii libgstreamer-plugins-base1.0-0:armhf 1.4.4-2+deb8u1 armhf GStreamer libraries from the “base” set
ii libgstreamer0.10-0:armhf 0.10.36-1.5 armhf Core GStreamer libraries and elements
ii libgstreamer1.0-0:armhf 1.4.4-2+deb8u1 armhf Core GStreamer libraries and elements
ii python-gst-1.0 1.2.1-1.1 armhf GStreamer GObject Introspection overrides for Python
pi@picroft:~ $


#7

I suspect issues with the present raspberry pi image and discrepancies in the documentation.

What would be helpful is a simple review of installing mopidy instructions onto a pi 3.
Assumptions:
The pulseaudio will be configured as a service rather then as a user.
Mycroft with mopidy and the mycroft skill installed.
Mycroft to be a service and mopidy to be a service.
The linux user mycroft, pi, mopidy will be allowed to communicate to the pulseaudio.
The audio output will be the 3.5mm audio jack (nothing fancy)
The mic in will be a usb connect.


#8

I have been able to test and play mp3 using this method on the pi.
Also I can vary the volume control in the command

gst-launch-1.0 filesrc location="/var/lib/mopidy/media/Chilliwack - Fly At Night.mp3" ! decodebin ! audioconvert ! volume volume=4.0 ! alsasink
gst-launch-1.0 filesrc location="/var/lib/mopidy/media/Chilliwack - Fly At Night.mp3" ! decodebin ! audioconvert ! volume volume=7.0 ! alsasink


#9

Here I am demonstrating that I can play both outputs of pulsesink and alsasink on my desktop ubuntu machine. Of course pulsesink does not work on my pi image.

legtod2@legtod2-G41MT-S2P:~$ gst-launch-1.0 filesrc location="./Music/04 November Rain.mp3" ! decodebin ! audioconvert ! volume volume=4.0 ! alsasink
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstAudioSinkClock
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:07.782055365
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
legtod2@legtod2-G41MT-S2P:~$ gst-launch-1.0 filesrc location="./Music/04 November Rain.mp3" ! decodebin ! audioconvert ! volume volume=4.0 ! pulsesink
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstPulseSinkClock


#10

Here is an experiment to demonstrate a problem.

The sound on a pi vs sound on a desktop pc.
When I run the command numerous times on the pi, the sound stop and will not continue…
gst-launch-1.0 filesrc location="./Music/04 November Rain.mp3" ! decodebin ! audioconvert ! volume volume=4.0 ! pulsesink
If I wait a few mins. the command will begin to work but quit play the sound again after a few repetitions.

This is not the case on my desktop ubuntu machine.

The implications of this are when you are giving commands to your raspberry pi, the pi will suddenly go death and not respond again until you reset the raspberry pi.

Is the source of the problem the pulseaudio with the raspberry pi sound module, I am not sure.

I am going to retire my raspberry pi 3 mycroft project as something that is not ready for my needs.

Strangely I have mopidy running on my raspberry pi 2 with no troubles at all. It simply is not using mycroft.