-
Notifications
You must be signed in to change notification settings - Fork 95
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
Faint humming (buzz) sound while running a game (HDMI RetroArch & RetroPie) #13
Comments
I have a guess, normally when running, atai800 puts full range DC voltage on the audio output, it might cause a buzz in some amplifiers. If you tested recent build of atari800 with -volume option, something like atari800 -volume 10 it could reduce the buzz. |
UpdateI think I know the reason, I have dumped So altogether it looks like a bug, and I can expect that depending on the device, playing negative constant value instead zero for silence can produce so unpleasant (humming, buzz) effects. |
Ah, you just confirmed what I said earlier. |
@knik0 Yeah that might be, it is just high-tier Samsung TV that I got as a present 😉 But I anyway I don't see why the amp is to blame if the audio signal is a mess, -75% constant DC for a silence is definitely not right. |
I guess it was done this way to maximize output volume. |
Sounds like we should make this change and make it configurable. Sound issues are the last thing we want in Atari800. |
I think the source of weird buffer[0] = (UBYTE)floor((generate_sample(pokey_states) - MAX_SAMPLE / 2.0)
* (255.0 / MAX_SAMPLE / 4 * M_PI * 0.95) + 128 + 0.5 + 0.5 * rand() / RAND_MAX - 0.25); It is easy to see the regardless of Now the question is what is the value range of If it is unsigned, why If it is signed then the formula above is incorrect, it should be instead: buffer[0] = (UBYTE)floor(generate_sample(pokey_states)
* (128.0 / MAX_SAMPLE / 4 * M_PI * 0.95) + 128.0 + 0.5 + 0.5 * rand() / RAND_MAX - 0.25); According to the "Master gain and DC offset calculation" description in the big comment block, it is more likely signed, talking about input range of Thoughts? |
Sorry for hammering in there, but is there any chance to get this fixed? This DC bias humming is really annoying. |
I'm absolutely no expert in this area but I wouldn't be surprised if the formula isn't correct. For instance I had to fix similar signed/unsigned problem when specifying certain compilation flags: 4024d49 |
I'd like to get this issue fixed before releasing new Atari800 version. How can I help? |
I'm looking into this. The generated samples (before the above mentioned conversion) are not signed/unsigned but rather "digital" with logical 0 and 1. Silence is generated as precise 0 while simple sound (say Pokey Self test sound of single channel) generates levels - the low is around 0 and the high is around 38 with slight oscillations (so the low can go below zero slightly). The above mentioned conversion by @nanoant is actually working exactly as on real Atari computer (I have checked output of Atari 130 XE with oscilloscope, it looks just like the WAV from the emulator). This is great for the emulator accuracy but I can imagine a modern TV set might mis-interpret the silence that is not at zero level. I may try shifting it up a bit. |
Fixes issue #13. The price for this is lower total volume.
Hopefully fixed in the 4.0.0 release. Thanks for reporting it. |
I believe this should be a configuration option (on by default, as there is no perceptible difference beyond loudness, but configurable), especially as the real hardware does behave in this way, meaning patching it to act differently equates not trying to mimic real hardware as close as possible. Is there any hope for it becoming such? Perhaps making the "-volume" parameter go from 0 to 200 (where 100-200 move the baseline down, where 200 matches real hardware) as opposed to 0 to 100? |
I wouldn't make it configurable unless the current (v4.0.0) setup creates any issue. |
Fixes issue atari800#13. The price for this is lower total volume.
I have recently managed to run Atari800 on my NVIDIA Shield TV with 2 PRs merged to libretro version libretro/libretro-atari800#9 libretro/libretro-atari800#10
Everything works great except rather faint humming (buzz) sound emitted by atari800 emulator when running. Sound goes via HDMI output, so it is not analog/hw problem, also no other emulators or Android apps exhibit this problem on my box.
I have also found another user having exactly same problem but in RetroPie, completely different hardware and platform, so I suppose it makes sense to blame atari800 emulator.
https://retropie.org.uk/forum/topic/6927/atari800-5200-emulation-faint-humming-sound-while-running-a-game
Is it some well known problem? Is there any workaround? (except rather ugly workaround removing the humming sound via equalizer or some DSP filter).
The text was updated successfully, but these errors were encountered: