How do I convert mkv files into avi/mp4 files that contaian 5.1 audio? Can only get 2 channel audio

I’m ripping blu-ray files to play on my WD TV Live and on other devices.

I use makemkv to decrypt and convert the blu-ray m2ts files into mkv files. This process works fairly reliable but I end up with 20-30GB mkv files. I then convert these mkv files into smaller and better supported avi or mp4 files. The reliability of these conversions are spotty. I use either Total Video Converter, My Video Converter, or Any DVD Converter Pro to perform the conversion into the avi or mp4 files

I can convert these blu-ray ripped 20-30gb mkv files  into 1920x1080, 4-6gb avi files . I am happy with this result except I can only get 2 channel audio.

Does anybody have any suggestion as to how I can keep my 5.1 surround sound audio?

I had mentioned that this conversion process fails often. These conversions also take 4-6hrs to complete.

I would also welcome any tips on how to improve this conversion process.

Thanks, Chris