FS#11052 - SID playback in stereo

Attached to Project: Rockbox
Opened by Stefan Waigand (Stefan Waigand) - Tuesday, 23 February 2010, 21:40 GMT
Task Type Patches
Category Codecs
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This patch adds pseudo stereo output to the TinySID sid codec by splitting the three sid voices to the right and left audio channels.
Sid playback sounds much better then, especially with headphones. Famous sid players (e.g. sidplay2/w) also do that to enhance sid sound.
Note: this is not an implementation of a stereo sid because that needs a complete emulation of a 2nd sid chip. I think any further efforts should concentrate on porting the sidplay engine to rockbox.

The function synth_render() computes the sid internal voices and maps them to the pcm buffer for a given count of pcm samples. I extended the function arguments by one more pcm buffer pointer for the second channel. Voice 1 and 3 are then written to the right and voice 2 to the left channel (I assume it is not standardized which voice goes to which channel). I also mixed 1/16th of every channel to the respectively other channel because this will give a more natural sound compared with the very hard panning if the voices are completely seperated.
Overflow of the variables outf and outo should not happen because before they carried three voices, now only max. 2.0625. And please have a look at the additional 2k memory for the second pcm buffer, imho no problem, at least it compiles :)
This task depends upon

Comment by Stefan Waigand (Stefan Waigand) - Tuesday, 23 February 2010, 21:46 GMT
Here is the patch
Comment by David Kornbach (DeeKay) - Saturday, 06 March 2010, 23:55 GMT
Thanks for that patch, I'll have to put down my current SIDplayer (an iPod touch) and start up the old Nano again! ;-D
btw: the by far best Pseudo-Stereo-SID I ever heard was in Pulse Player, but i dunno how they did it:
Comment by Bertrik Sikken (bertrik) - Monday, 19 July 2010, 23:32 GMT
I can imagine you get a nice stereo effect by using psycho-acoustics a bit, for example put one channel in one ear and a slightly delayed and low-pass filtered version of this channel in the other ear. The delay represents the delay between your ears, say 20 cm, or about 600 us, or about 26 samples at 44100 Hz. The low-pass filter represents the shadowing effect of your head: the close ear hears the full-range sound, the far ear hears the sound with the high-frequencies attenuated, similar to what we do with crossfeed.
Comment by Bertrik Sikken (bertrik) - Sunday, 27 November 2011, 00:27 GMT
Ignore my last comment, we already have something like that, called crossfeed.
Comment by Martin Sägmüller (dfkt) - Friday, 30 March 2012, 11:48 GMT
I just built a version with this patch. It sure is nice having stereo imaging, but even with crossfeed it sounds a bit 'irritating', since bass frequencies are also hard-panned to one side. It would be great if frequencies below, say, 200-300 Hz could be kept fully in the center, for a more natural feeling.