hoglet67 / RGBtoHDMI

Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
GNU General Public License v3.0
846 stars 115 forks source link

Audio Support #376

Open angelsix opened 6 months ago

angelsix commented 6 months ago

Starting to use this project in lots of builds and it is absolutely awesome. I'm amazed at the quality of the output, the feature richness, and overall skill gone into making this project so universal and professional. Hats off to all involved.

On to the issue. Everyone who gets these mods the first instant issue is lack of audio. Most people do this mod so they can connect up to a monitor, that has HDMI input, no 3.5mm or RCA audio input.

As this project seems to lack any audio support, the only option is a £60 HDMI audio embedder device to re-inject audio into the HDMI.

Is there any way to add audio support to this project? I'm both a hardware and software dev so I can possibly assist to if you point me in the right direction. Perhaps sending analog audio into the Pi, or making a dedicated hardware board to inject audio into the HDMI pins directly perhaps?

Basically, a solution cheaper than a £60 embedder device.

IanSB commented 6 months ago

@angelsix

Is there any way to add audio support to this project?

I am looking at this but the main issue has been lack of documentation to output audio over HDMI from bare metal on the Pi but I have recently found some info that should help with that. The other issue that might indirectly help with this is that the CPLD is being discontinued at the end of the year so I am currently redesigning the board to use an alternative solution and I may be able to add audio capture to this new design.

Basically, a solution cheaper than a £60 embedder device.

There is a cheaper embedder available for about £35 which I have tried and does seem to work OK but I haven't done exhaustive tests: https://www.aliexpress.com/item/1005006695915253.html (I didn't buy from this seller but that is currently the cheapest price. There are several other sellers listing it on that site) It is also listed on ebay etc at a slightly higher price.

IanSB commented 6 months ago

@angelsix I managed to get bare metal HDMI Audio output working and I have uploaded an Alpha test version with a HDMI audio test menu if you want to give it a try: https://github.com/IanSB/RGBtoHDMI/issues/29

This is only half of the solution as I still need to devise a way to capture the audio in the first place but at least it is half way there!

It works with the TVs/monitors I have tested so far but others have reported problems with some TVs so let me know if it works for you.

angelsix commented 6 months ago

I have copied the files to the SD card and overwrote the existing files that are there. Am I meant to do something more? No audio for anything but amiga boots as normal

IanSB commented 6 months ago

@angelsix You can just play audio files from the menu audio_menu

audio_menu2

IanSB commented 6 months ago

@angelsix

If you can't get sound, check that your monitor or TV isn't configured for line input. Sometimes even testing with another HDMI source isn't enough:

When I first tested this on my 12 TVs and monitors, it didn't work properly on four of them: Two had technical issues which were caused by bugs that have been fixed in Alpha65G. (This fixed all problems reported by testers) Two had no audio output and one of those was fixed with a simple menu change to disable line input.

The last one (an LG TV) was a bit more unusual. This had no audio output when running the test but worked when a Sky receiver was plugged into the same input. After much experimentation I found that it worked when the RGBtoHDMI output was configured for 50Hz but not at 60Hz which was why it worked with the Sky receiver which is 50Hz and that eventually turned out to be caused by labelling the input as "PC" in the TV's menu. Doing that meant when a 60Hz PC source was connected it used the line input and when a 50Hz source was connected it used the HDMI audio but wasn't obvious that making such a cosmetic change would change hardware behaviour.

I think some monitors will also override HDMI audio if something is plugged into the line input (if available)

angelsix commented 6 months ago

yep works for me on all monitors