The SAM set ioctl is actually a toggle;


case EMPEG_MIXER_SET_SAM:
{
int sam;

copy_from_user_ret((void *) &sam, (const void *) arg,
sizeof(int), -EFAULT);

if(sam) dsp_write(Y_switch, 0);
else dsp_write(Y_switch, 0x5d4); // 4.6ms


IANA Kernel Hacker, but that doesn't look like a toggle to me... Looks to me like passing in a non-zero value turns SAM on, and passing in 0 turns it off. At least that's what I was seeing last night when I tested it out. I hacked up the sam.c code from riocar.org to set/read SAM status (after I added the GETSAM ioctl) and it wasn't working like a toggle...

what you appear to be doing is affecting the player-ttsd balance.

Yeah, but it seems to be working okay, I don't think it scales the background music down unless a PCM sample is playing... I don't think it's losing fidelity under normal use. Try it out and tell me if I'm wrong...
_________________________
- Tony C
my empeg stuff