Closed everon987 closed 2 years ago
Can you have a look at the logs to see if there's any error or message related to the plugin ?
The capitalisation of the keyword is strange. Is that a "feature" of your OS on the notebook/desktop/tablet you're using ?
Install logs look good to me: plugin_pluginmanager_console.log
And this is the octoprint.log with the following logging levels enabled: octoprint.log
I've tried to repeatedly trigger m300 @startup or m300 @default
to see if anything will show up in the logs but I don't see anything. Perhaps my logging settings are wrong?
This is what I meant by the capitalization, not sure if this is normal behavior but I've tried it on my phone too and another computer, they all behave similarly:
m300 @startup
shows up as (@STARTUP)
And this is how the folders look like:
I see... I have gave up on 3D printing and I don't have any way to test this... But ... My guess is that some change in recent Octoprint version capitalises the parameters of commands... YOU can test my theory by renaming one of the files to capital letters (eg DEFAULT.mp3 or DEFAULT.MP3) If that works you rename them all and you're good. If not, I'll carry on thinking :D
Let me know.
Whoops.... Notice this in the logs
(ImportError: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory)
if not pygame.mixer.get_init():
That means your pygame
is not properly installed or missing the library...
Whelp, good catch on that error, totally missed it. I tried doing a sudo apt-get install python-pygame
via ssh and rebooted the pi but the error still persists. Currently looking to ways to fix this.
I also did a amixer -q -M sset Headphone 80%
and sudo alsactl store
to make sure the 3.5mm jack is outputting audible levels of audio which worked so far (installed sox and used play foo.mp3
to test the files and the 3.5mm jack, both are working)
Once the pygame error is fixed and it still doesn't work, I'm going to try renaming the files to capital letters just to give it a shot.
Will update shortly, thanks for the help so far man.
try apt-get install libsdl2-mixer-2.0-0
Yep, I've tried that as well (saw it from: https://github.com/cosmologicon/pygame-text/issues/7) Still getting this:
2022-01-04 14:59:55,353 - py.warnings - WARNING - /home/pi/oprint/lib/python3.7/site-packages/octoprint_sound/__init__.py:27: RuntimeWarning: use mixer: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory
(ImportError: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory)
if not pygame.mixer.get_init():
just checking... did you install pygame
for python3 ? (pip3 install pygame
) ...
Yep, I did. I had to install pip first though because it wasn't part of OctoPi. Pygame and libsdl2-mixer-2.0-0 are both installed.
I ran a sudo apt-update --fix-missing
as well. Issue still persist with the same error.
I'm not sure how I can help. Try to find smth to fix pygame or feel free to change the MP3 player if you're ok with coding in python...
one more thing.. try to find if "libSDL2_mixer-2.0.so.0" is really on your system... maybe it's a version conflict...
No worries, I'll mess around a little further and see if I can get it to work and update you if it does (and perhaps post a solution if I found one).
Thanks for your help!
I managed to fix the dependency error and it is now working.
At first apt-get install libsdl2-mixer-2.0-0
did not work and was constantly giving a 404, which I then ran an sudo apt-update
which didn't work either as it required some permissions to be accepted manually.
What fixed it was:
sudo apt update
and manually accept all permission prompts (just press "y" all the way)apt-get install libsdl2-mixer-2.0-0
will work and no longer results in a 404On top of that, to ensure volume isn't defaulted at 40% on boot:
amixer -q -M sset Headphone 80%
and sudo alsactl store
Edit: I think your plugin already sets the volume at 100 by default, whoops
The only issue I am trying to fix now is that m300 @"something" keeps calling default.mp3, but there is sound now.
awesome!
maybe that can be solved by capitalising the file names... 🤞🏻
On 5 Jan 2022, at 15:44, Alvin Lim @.***> wrote:
I managed to fix the dependency error and it is now working.
At first apt-get install libsdl2-mixer-2.0-0 did not work and was constantly giving a 404, which I then ran an sudo apt-update which didn't work either as it required some permissions to be accepted manually.
What fixed it was:
sudo apt update and manually accept all permission prompts (just press "y" all the way) apt-get install libsdl2-mixer-2.0-0 will work and no longer results in a 404 Reboot and try m300 again On top of that, to ensure volume isn't defaulted at 40% on boot: amixer -q -M sset Headphone 80% and sudo alsactl store
The only issue I am trying to fix now is that m300 @"something" keeps calling default.mp3, but there is sound now.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
awesome! maybe that can be solved by capitalising the file names... 🤞🏻 … On 5 Jan 2022, at 15:44, Alvin Lim @.***> wrote: I managed to fix the dependency error and it is now working. At first apt-get install libsdl2-mixer-2.0-0 did not work and was constantly giving a 404, which I then ran an sudo apt-update which didn't work either as it required some permissions to be accepted manually. What fixed it was: sudo apt update and manually accept all permission prompts (just press "y" all the way) apt-get install libsdl2-mixer-2.0-0 will work and no longer results in a 404 Reboot and try m300 again On top of that, to ensure volume isn't defaulted at 40% on boot: amixer -q -M sset Headphone 80% and sudo alsactl store The only issue I am trying to fix now is that m300 @"something" keeps calling default.mp3, but there is sound now. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
You are absolutely right. That fixed it:
Thanks again!
Good to hear that! It must be a change in latest Octoprint...
Happy printing!!!
Sorry to necro this thread again but:
I realized that if I were to send an m300 @default
directly into the terminal, it would work. But placing them in the start GCODE section yields an unknown command error and no sound is played
try capital M ? M300 @WHATEVER
Hi, I've successfully installed 1.0.6 with no errors. However, I am unable to get any sound out of the 3.5mm jack.
I've placed some mp3 files inside .octoprint/data/sound and .octoprint/plugins/sound, all of which have the following mp3 files in 128kbps:
Upon calling
m300 @startup
, the console shows m300 @STARTUP and plays the default.mp3 file with no sound. I realized that no matter what @keyword is inserted into the console, it becomes uppercase. It also doesn't seem to be able to find the startup.mp3 file inside .octoprint/data/sound.Things I've tried:
speaker-test -t wav -c 6
(There is sound, albeit rather soft)Octoprint Version: 1.7.1 (Correction: It is 1.7.2) OctoPi Version: 0.18.0
PS: Thanks for taking the time out to develop this plugin