-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAC Volume Discrepancy w/ real Mega65 hardware #393
Comments
Hmm, I am far from being expert on this area but I guess I cannot make anything in "dB" I just can push digital samples to SDL. Also it must be taken account that audio samples generated for the SDL audio output is mixed together with SID and OPL3 output as a single stereo 16 bit audio stream. About the log/linear scale, I guess then the way would be to use a helper table to "scale" the meaning of the volume register values to "real" scaling (used for samples generated by the DMA-audio) before the final mixing stage, it can also include the effect being "louder", ie over 0dB or something. My main concern that though I can try to compare the listening experience with a real MEGA65, but I am very much "music / audio deaf" ie I never can say the difference too much, and I always have the feeling "well, it sounds similar, close enough" and cannot even distinguish the difference with different setting ie "which is the better" to be able to fine-tune the situation. |
By the way, another key factor: Xemu misses the "audio mixer" part of MEGA65 still. Where logically the normalization of level-ratios of different sources should be done before submitting the sample values to SDL. And no, I don't want to use |
Well, so I guess this must be #272 where the various sources of audio should be mixed together with the right scaling factor also taking account the missing "MEGA65 mixer" settings. Currently Xemu internally uses 10 channels:
If you agree @deathybrs I would close this issue and move to #272 with extra observations and TODOs in this area. By the way, I would say, even if I am "tone/volume deaf" I can still use an oscilloscope to measure the output levels and their relative standings with different volume/mixer settings and compare it to a real MEGA65's output. |
Merging the tickets sounds fine to me. Yeah, I would recommend using tools to sort it out. If you are OK with waiting until the next batch ships, I can give you exact numbers by which it needs adjustment. |
So my plan is (more or less ...): Implement MEGA65 mixer emulation. Then, fine tune what certain "volume" and "level" settings mean for real. If not linear, with some help of a "mapping table" for example and such. So I close this now, and moving to #272 , after all it's a really old issue, and should be targeted sooner than later for now ... |
The values of CHnVOLUME ($d729, $d739, $d749 and $d459) do not have the same levels on xemu as they do on real hardware. On real hardware, it appears that $ff is +6dB, allowing the volume to be boosted above 100%. In contrast, on xemu, a value of $ff in these registers appears to be 0dB, which would be in line with what one would expect if you used a typical sound system like the one that is included in SDL.
It further appears that the scale of the registers on the real hardware is linear, when it should be log2, but I have not been able to confirm this with certainty yet... the relevance being that the behavior of these registers may need to change in the future.
I am using v20230703013254, with ROM 920384.
The text was updated successfully, but these errors were encountered: