bbond007 wrote: ↑Fri Apr 14, 2023 7:00 pm
Its really been a while (and I was using RetroArch), but I thought that HDMI could be set it using the raspi-config utility. For my USB Turtle Beach and HiFiBerry I remember having to manually edit a file (maybe /etc/asound.conf)
https://linuxhint.com/configure-sound-raspberry-pi/
Update: I got it working, but I ended up getting a HiFiBerry anyway for hopefully the best sound quality, and still had the issue. The issue was running it as root with the ./sudo midilink... The root user did not have the default audio device that the pi user did.
Here are all the fixes and enhancements that I did (for future reference and to anyone else that wants to do this)...
To get the list of devices, type aplay -l:
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: BossDAC [BossDAC], device 0: Boss DAC HiFi [Master] pcm512x-hifi-0 [Boss DAC HiFi [Master] pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Then to set the default audio device for root edit /etc/asound.conf and specify the card number of the BossDAC (2 in this case):
pi@raspberrypi:~ $ sudo vi /etc/asound.conf
pcm.!default {
type hw
card 2
device 0
}
Then to get it to launch automatically with a reboot, edit /etc/rc.local
pi@raspberrypi:~ $ sudo vi /etc/rc.local
(at the end before the exit 0)
cd /home/pi
./midilink UDPMUNT QUIET &
exit 0 <-- already there
reboot to test and hopefully it works in the background
Be prepared to have your ears blown off because it is very loud. To fix this:
pi@raspberrypi:~ $ sudo alsamixer
Press F6 to select the sound card BossDAC
Press Right Arrow until you get to Digital and change the volume to 50 with the Down Arrow
Press Esc to exit
Save it permanently:
sudo alsactl store
reboot
Also, I was getting Munt performance issues so I did some performance enhancements:
pi@raspberrypi:~ $ sudo vi /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
100
pi@raspberrypi:~ $ sudo vi /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
50000
pi@raspberrypi:~ $ sudo vi /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
pi@raspberrypi:~ $ vi /home/pi/MidiLink.INI
MUNT_OPTIONS = -i 30
(keep all the other lines)
Now on my Raspberry Pi 3b+ I get much better Munt performance without as many stutters and no overruns, at least in Monkey Island 2. Hopefully someday I can get a Pi 4. I still get a bit of stutter occasionally so maybe I will try overclocking. Probably first, I will try a lighter OS like Raspberry Pi OS Lite, or maybe I can disable unnecessary services on the OS I have now.