Fix the LRCK signal which caused reversed channels after my previous PR.
For reference, the clocking for the old data format is here:
And the new data format is here:
The old volume code had a side effect of shifting the 16bit values to the top end of the 32bit word which is written to I2S. I was a bit surprised to see the maximum volume of 0x7FFF, which shifts the data into bits 30-15 rather than 31-16. I assumed this generated the BCK pulse before the first bit is written, but now I see that is not the case. I suspect this was just an error. As a result this fix adds a small, but useful increase in the max volume.
Fix the LRCK signal which caused reversed channels after my previous PR.
For reference, the clocking for the old data format is here:
And the new data format is here:
![image](https://github.com/ploopyco/headphones/assets/30636555/6add4fd1-3cd9-4552-94d3-952011e3ce52)
The old volume code had a side effect of shifting the 16bit values to the top end of the 32bit word which is written to I2S. I was a bit surprised to see the maximum volume of 0x7FFF, which shifts the data into bits 30-15 rather than 31-16. I assumed this generated the BCK pulse before the first bit is written, but now I see that is not the case. I suspect this was just an error. As a result this fix adds a small, but useful increase in the max volume.