• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Codecs
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.4
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Stefan Waigand - 2010-02-23
Last edited by speachy - 2020-05-24

FS#11052 - SID playback in stereo

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 :)

Closed by  speachy
2020-05-24 14:19
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

A version of this was merged nearly a year ago, commit f2fd8fe79b24de0223987dce4b60fc8896dab1fa

Here is the patch

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:

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.

Ignore my last comment, we already have something like that, called crossfeed.

dfkt commented on 2012-03-30 11:48

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.


Available keyboard shortcuts


Task Details

Task Editing