mixmastamyk / boombox

A simple cross-platform audio-file player module for Python.
GNU Lesser General Public License v3.0
12 stars 0 forks source link

No audio on raspberry pi #3

Closed array-in-a-matrix closed 3 years ago

array-in-a-matrix commented 3 years ago

I have made a little app that plays audio when a button is pressed. The app works 100% as intended and my pi does play audio though the speaker i have connected. The audio which should play from the app does not play. Also there is no errors.

mixmastamyk commented 3 years ago

Hi, you can get debug logs from the boombox module if you start logging before it. What is your distro, version, py version?

I have a Pi around here, I'll take a look as well. Hopefully by this weekend.

I do remember odd things around audio with it, having to go into the boot menu to change the output between speaker and headphones, things like that. I'd guess something like that is the problem.

array-in-a-matrix commented 3 years ago

Hello, actually i have no idea how to get the debug logs.

device:

mixmastamyk commented 3 years ago

Oh, turn on python logging and set the level to DEBUG and it should print out. Something like:

import logging

logging.basicConfig(level=logging.DEBUG)

Might want to set a message format also.

array-in-a-matrix commented 3 years ago

Is the problem caused because the pi is not x86_64?

python log:

DEBUG:boombox:trying gstreamer…
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_startup.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_startup.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 8192
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 10302
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 14942
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 10302
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 8192
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 13211
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_switch.mp3'
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 8192
DEBUG:boombox:initializing GstBoomBox
DEBUG:boombox:verified: '/home/pi/Documents/omnitrix-app/res/sound_transformation.mp3'
DEBUG:boombox:playing: '/home/pi/Documents/omnitrix-app/res/sound_transformation.mp3'

thank you for your patience!

mixmastamyk commented 3 years ago

Hmm, it is finding Gstreamer and trying to use it. No idea why it doesn't work. I remember the audio hardware on the pi being odd. There are some tutorials about how to run Gstreamer at the the command-line if you want to give it a try.

In the docs there are some pointers on how to pick other audio systems. Might be easier to try the paplay command-line or something:

paplay /usr/share/sounds/sound-icons/guitar-12.wav

If pulse-audio is installed. There are similar CLI's for other sound systems.

I don't think processor arch has much to do with my part, which is only python, but who knows.

array-in-a-matrix commented 3 years ago

Alright, I will look into that.

Thank you for your time!

mixmastamyk commented 3 years ago

Oh well, don't necessarily need to close this, unless it started working. I will give it a try at some point, just am busy this time of year.