2009-04-07, 02:59
Hi All,
Like many on this forum, I have been struggling to get XBMC to output standard stereo of varying sample rates to IEC958 (SPDIF), and the developer that I am, I decide that it MUST be possible to encode it on the fly.
I then descovered the alsa A52 plugin, which while it partially worked for me, would not work at all properly with XBMC, I was getting time skipping backwards problems, and all sorts of weird issues.
After hours of hacking the A52 plugin source, I decided that it was crap, and dropped in in favour of re-writing it from scratch, and trying to learn the alsa plugin api, and came up with a perfect solution (for me anyway).
http://code.google.com/p/a52plug
This is another a52 plug for alsa, uses somewhat the same method as the original alsa one, except it uses Aften to encode, instead of ffmpeg. This was choosen because ffmpeg is not thread safe, and aften is, and it may have been the cause of the weird issues I was having.
The code is very experimental at this stage, but I am enjoying upmixed A52 encoded output to all my speakers for standard audio, and passthrough still works since it uses the IEC958 device directly. Even setting the SDL audio device to use alsa works with this plugin.
Please have a go and let me know what you think, how it works, or any mistakes due to my lack of understanding of the ALSA Plugin API. For a sample asound.conf, see the README included with the project.
Like many on this forum, I have been struggling to get XBMC to output standard stereo of varying sample rates to IEC958 (SPDIF), and the developer that I am, I decide that it MUST be possible to encode it on the fly.
I then descovered the alsa A52 plugin, which while it partially worked for me, would not work at all properly with XBMC, I was getting time skipping backwards problems, and all sorts of weird issues.
After hours of hacking the A52 plugin source, I decided that it was crap, and dropped in in favour of re-writing it from scratch, and trying to learn the alsa plugin api, and came up with a perfect solution (for me anyway).
http://code.google.com/p/a52plug
This is another a52 plug for alsa, uses somewhat the same method as the original alsa one, except it uses Aften to encode, instead of ffmpeg. This was choosen because ffmpeg is not thread safe, and aften is, and it may have been the cause of the weird issues I was having.
The code is very experimental at this stage, but I am enjoying upmixed A52 encoded output to all my speakers for standard audio, and passthrough still works since it uses the IEC958 device directly. Even setting the SDL audio device to use alsa works with this plugin.
Please have a go and let me know what you think, how it works, or any mistakes due to my lack of understanding of the ALSA Plugin API. For a sample asound.conf, see the README included with the project.