pydoro icon indicating copy to clipboard operation
pydoro copied to clipboard

[BUG] No sound for OpenBSD

Open yuuwe-n opened this issue 3 years ago • 5 comments

Describe the bug No sound using Pydoro using OpenBSD

To Reproduce pydoro --audio-test OR pydoro

Expected behavior expected to play sound

Desktop (please complete the following information):

  • OS: OpenBSD
  • Version 7.1

Additional context I am pretty sure the solution is to add to the sound.py under platforms. I will try to create a pull request to fix this for openbsd under fallback. There is probably another library to use in OpenBSD as OpenBSD does not use linux utilites like ALSA, pulse audio, jack, etc. (im pretty sure the linux version uses alsa). Since OpenBSD uses sndio, I will see if there is a related python library.

yuuwe-n avatar Aug 30 '22 09:08 yuuwe-n

Can you try installing pygame to virtual environment, it will use it if it's available. 👍🏽 (If that works just change it in README to indicate that for both Linux/BSD can work with pygame)

If you like to send a PR, add the necessary audio libraries to setup.py as well. 👍🏽

JaDogg avatar Aug 30 '22 09:08 JaDogg

pygame will not install automatically because of dependency issues. I tried manually compiling pygame. An issue faced was that it did not recognize camera libraries and did not build; however I removed the camera dependencies and was able to build pygame (commented pygame/build/Setup_Unix.in) (also using the auto option which skips over dependencies not found)

Sound still does not work with pygame though. Pydoro still runs, but with some warnings. I am gonna try adding a platform to sound.py instead

python3.9:/usr/local/lib/python3.9/site-packages/pygame-2.1.3.dev5-py3.9-openbsd-7.1-amd64.egg/pygame/rwobject.cpython-39.so: undefined symbol 'lseek64'

yuuwe-n avatar Aug 30 '22 10:08 yuuwe-n

@yuuwe-n do you know of any library that works with OpenBSD? I'm not using BSD at the moment and do not have much experience in that :( Anyway send a PR if you can get it working 👍🏽

JaDogg avatar Aug 30 '22 11:08 JaDogg

It seems that pydub works as it uses ffmpeg. pydub

yuuwe-n avatar Aug 31 '22 08:08 yuuwe-n

according to https://stackoverflow.com/questions/26387571/playing-audio-in-pydub

from pydub import AudioSegment
from pydub.playback import play

song = AudioSegment.from_wav("explosion.wav")
play(song)

allows you to play audio. But I assume this is synchronous. will need to look at an async play method..

JaDogg avatar Sep 01 '22 21:09 JaDogg

Closing this as I do not want to support OpenBSD.

JaDogg avatar Apr 23 '23 09:04 JaDogg