Please test the binary below. It is the new volume control system and I would like some feedback before I make it part of the library and you all will have to use it
NOTE: Watch your ears if using headphones on high volumes, because this can push even more power out.
This is a new way of controlling volume levels on Pokitto. Instead of a sliding volume control from 0 to 255, this is 8 distinct levels. You can control the volume both in the start-up screen and with C+left / C+right during the SynthTest demo.
Did you try with headphones and speaker? The idea is that there is a smooth transition from hphone levels to speaker levels, i.e. highest headphone level is quiet on the speakers then increases to volume levels you wouldnāt want to listen on headphones any more.
Level 4 goes yellow and 7 is the same as 6. This is because I needed 8 levels to be able to do bitshifting fast but couldnt get a meaningful difference between 6 and 7.
I tried with headphones, I have a suggestion, but i donāt think itās possible from previous discussions. Is it possible to detect the headphones being plugged in and automatically reduce the volume?
I did notice though, that my headphone jack is not fully connected (this is the first time I have used headphones on this pokitto). I just looks like the bottom 2 pin are not soldered correctly, I should be able to fix that with my soldering level.
[edit] now that my headphones work correctly I noticed that when the volume level is lower, the volume change within the test program is not smooth. Moving the volume from 0 to 255 will result in only 3 or 4 actual changes.
As I am writing this massive explanation thingy, I realized this may or may not be something that is of interest to others. I am a first-order geek, and I find these things endlessly fascinating, so I canāt really tell.
So, is there interest in me explaining how the entire Pokitto sound generation (DACs, buffers, amplification works, how to control the DAC directly etc?) Is this something you are interested in learning, or should I focus on porting games etc. instead?
#Background story I.e. why we had a crappy wolume control and why making this took so long
The volume in Pokitto is controlled by a digital I2C controlled potentiometer. I was not able to get the necessary ālevelsā out of the potentiometer. The problem is that when you have a 3.3V device like Pokitto, the actual window within which the amplification works is extremely small. The digital potentiometer couldnāt control the volume with such small increments as was needed.
Solution
Now there are 7 levels (0-6) that I have individually adjusted using a scope and listening. 1,2,3 are suitable for headphone use, 4 is on the limit, and 5 and 6 are intended for speaker use
The way it is implemented is that there is a premultiplier table for each level and a discrete volume level for the hardware I2C digipot. These, in combination, make the necessary, well defined volume levels.