Friday, February 21, 2020

GAudio and new architecture

Month:4 Week:2-3

I had to delay with this post due to being mid-progress on an issue I've been stuck for some time which I could not explain it without a proper research/debugging. GAudio is now completely ported to new architecture and at this point it is completely rewritten. GAudio is now event-based and completely asynchronous unlike on old architecture.

GAudio had significant issues with volume controls on Mac and Linux. While Mac solution took me a day at most (had to write and algorithm to pan 6 channels to 1 float value), linux was causing significantly more problems. I couldn't obtain a proper audio sink (where it writes a volume to) without affecting other sounds/music objects in the future. I attempted to create virtual sinks and connect using several pulseaudio callbacks without any success.

Only about now I figured out the solution with obtaining a proper sink index and even then it still doesn't work as expected (per-channel volume controls make everything play in mono and not stereo). This is due to our system internally using 6 channels (5.1 support) and while there is a fallback on Windows and Mac (custom-made), Linux doesn't have a proper fallback. I could make the system work with 2 channels for stereo support and this is a huge breakthrough as now I know how to deal with it. My next task is to implement a proper  fallback from 5.1 to stereo to mono, so the setchannels controls would properly set the channel volumes AND our GAudio3D system would be able to work on stereo mode. (5.1 hardware support was not tested on Mac and Linux as of right now but it does work on software level.)

No comments:

Post a Comment