Closed htamas2 closed 2 years ago
The GetChunk() versus Write() stuff shouldn't affect anything at all, it just determines when the audio data is passed to the driver (interrupt context versus not). Munt/Fluid's rendering is too intensive to run inside an interrupt without wrecking performance/timing of other tasks, hence why GetChunk() is not used.
I have other UDA1334A DACs that are working fine here, so there's not much to suggest other than:
Thanks for the quick reply. You are right, the mute pin was the culprit. When probing for the Pisound in CMT32Pi::Initialize, pin 16 (used for Pisound's oversampling ratio) is driven low which mutes the sound.
Thankyou for testing, and great catch with the Pisound probing - I'd forgotten about this device.
I've attempted a fix, which you can test by grabbing the kernels
package from this build run and just replacing the kernels: https://github.com/dwhinham/mt32-pi/actions/runs/1723643561
I've basically just added a destructor to the Pisound driver so that when it's deleted, the affected GPIO pins are reset back to being inputs in pull-down mode (as they should be on power-on, according to Broadcom docs).
If you can test this when you get a chance I'll merge it for the next release.
Thanks!
I can confirm it works great. Thank you.
Excellent, thanks for the quick test and again for the report. This will probably improve compatibility with some other DAC accessories that have a mute pin too.
This fix is now on the develop branch and will be part of the next release.
Hardware and software
Bug description
If I set output_device to hdmi, everything works: I can play on a usb midi keyboard or via rtp-midi, using either fluidsynth or munt. However, if I set output_device to i2s, there is no sound output.
The same configuration is supported by Circle out of the box. It works flawlessly in circle/sample/29-miniorgan or in minisynth. If I write a minimal kernel with a class that extends CI2SSoundBaseDevice and overrides GetChunk(u32*, unsigned) to output a square wave, I can hear the sound. Incidentally it also works in Raspbian.
Steps to reproduce
Expected behavior
There should be sound.
Configuration file (changes from default)
Additional information
In CMT32Pi::AudioTask(), IntBuffer still contains valid sample data which is then sent to CSoundBaseDevice::Write(const void *, size_t). Compare this to the working Circle demo code that doesn't call CSoundBaseDevice::Write but overrides CI2SSoundBaseDevice::GetChunk to fill the buffer on an IRQ. I wonder if that makes any difference or is just a consequence of mt32-pi being multithreaded.