pimoroni / pirate-audio

Examples and documentation for the Pirate Audio range of Raspberry Pi add-ons
MIT License
248 stars 50 forks source link

Unable to get audio working with Python #20

Closed Crdguy closed 4 years ago

Crdguy commented 4 years ago

Hello,

I have been trying to write a custom music player for the version of this HAT with the headphones DAC. Using the LCD has been successful, but I have been having some trouble with the audio.

The first time I set up the HAT, I was able to get audio output through VLC fine. However, pydub and every other module I tried to play songs through Python failed to use the audio on the HAT.

I had another play with /boot/config.txt and it currently looks like this:

hdmi_drive=2

dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

dtparam=audio=off

[pi4]

max_framebuffers=2

[all]

gpio=25=op,dh
dtoverlay=hifiberry-dac

With this config.txt, I get absolutely no audio and VLC says it is unable to play sound as there is no audio device installed.

Is there a way I can fix my config.txt and get audio output using Python? Thanks in advance.

Gadgetoid commented 4 years ago

As near as I can tell you've done everything that's required to set up audio- I suspect the problem is with the various Python libraries you've been trying, Could you venture some code/setup steps? pydub to take an example, appears to use one of 4 different applications to handle the actual audio playback, have you tried all of these?