kuma4649 / MDPlayer

GNU General Public License v3.0
124 stars 15 forks source link

ADPCM and FM are out of sync when using SPFM to play FMP music #244

Closed denjhang closed 8 months ago

denjhang commented 9 months ago

When I use SPFM to play FMP music, MDPlayer seems to go into a frozen state for a few seconds (no RD icon is displayed) when loading ADPCM, and then starts producing sound. FM and ADPCM are out of sync for the first few seconds, and after about 5 seconds Just completely synchronized.

denjhang commented 9 months ago

https://youtu.be/ldm9BPcm06E Here is a video showing this bug. I used a USB audio collector to input the SPFM sound into the computer.

kuma4649 commented 9 months ago

恐らく原因は実音源はADPCMのメモリにデータを転送するのに時間がかかることだと思います。 が、これに対応するにはFMP側に仕掛けを追加する必要があります。 しかしFMPはソースを公開していないのでほぼ無理かと思われます。

kuma4649 commented 9 months ago

MDPlayer STBL343 2023/12/28

をお試しください。

kuma4649 commented 9 months ago

こちら、効果ありましたか?

denjhang commented 9 months ago

I'll look into it today.

denjhang commented 9 months ago

The latest version synchronizes FM and ADPCM faster. Currently, synchronization can be achieved within 1 second, but the initial 1 second is very chaotic.

denjhang commented 9 months ago

It looks like it caused other bugs, FM tracks playback is now much slower using FM only.

denjhang commented 9 months ago

https://youtu.be/7F6DlOKOMJY Here is the test video.

kuma4649 commented 9 months ago

こちらも対策したうえでの現状であるならばこれ以上の改善は難しいですね。 (ちなみに例によって私の環境では発生しません)

ハードウェアが悪いかチェックするとか、他人のPCでも現象がでるかとか試しましたか? またオーディオデバイスはハードウェアのASIOを使用していますか? (MDPlayerは実Chipであってもオーディオデバイスの性能が絡んできます)

denjhang commented 9 months ago

I don't use ASIO, I use WaveOUT.

kuma4649 commented 9 months ago

できるだけ、AsioOutか、無理ならWasapiOutを選択してください。 WaveOutやDirectSoundは緊急向け又は、おまけでつけています。 image

kuma4649 commented 9 months ago

image また、Asio Out以外の場合は、「遅延時間(レンダリングバッファ)」をできるだけ小さくしてください。 (但し小さすぎると音切れを起こしたりハングアップしたりします)

kuma4649 commented 8 months ago

こちらどうなりましたか

denjhang commented 8 months ago

STBL347 still has this problem, and the FM part playback speed is 2 times the PCM speed, which is very inconsistent. The video first shows the sound played using SPFM (abnormality). Then I used the emulation core to play OZI (normally). https://youtu.be/BH-kndG0J_A

By the way, there is no such problem in the STBL345 version. At that time, there was just a delay in ADPCM and it would automatically return to normal after a few seconds. The STBL347 version can't even hear the ADPCM sound because the playback speed is too fast.

kuma4649 commented 8 months ago

image ここのチェックマークを消してみて試してもらえますか。

あと、AsioOutか、無理ならWasapiOutを選択してください。

denjhang commented 8 months ago

I hope the code related to OZI falls back to STBL345, which is acceptable.

kuma4649 commented 8 months ago

FMP関連のコードに大きな違いは無いです

kuma4649 commented 8 months ago

参考用に私の設定を。 image image

denjhang commented 8 months ago

In the STBL345 version, no matter which audio output I choose, there is no big problem, and the out-of-sync phenomenon only occurs in the first two seconds. But STBL347 is in a similar situation no matter which setting is selected. I don't have hardware USB ASIO, can you test the output using wasapi or a few other options?

kuma4649 commented 8 months ago

Wasapiでも問題なく演奏できてます。 image これ、チェックオフしましたか?

denjhang commented 8 months ago

In the STBL345 version, ADPCM syncs fine with your setup.

denjhang commented 8 months ago

In the STBL347 version, ADPCM syncs fine with your setup.

kuma4649 commented 8 months ago

image

これ、チェックオフしましたか?

denjhang commented 8 months ago

sshot-20240113-224128 Yes, that's how it was set up, and now it's completely normal, it's amazing.

kuma4649 commented 8 months ago

Yes! 正しく演奏されますか?

denjhang commented 8 months ago

yes

kuma4649 commented 8 months ago

ではクローズします

denjhang commented 8 months ago

So I want MDPlayer to adapt to SPFM-Y8950, Y8950 and YM2608 are very similar, in rebirth hardware, they use the same DRAM.