Skip to content
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

4K @ 60 FPS audio crackling #91

Closed
JonasZieker opened this issue Sep 28, 2021 · 18 comments
Closed

4K @ 60 FPS audio crackling #91

JonasZieker opened this issue Sep 28, 2021 · 18 comments

Comments

@JonasZieker
Copy link

I realy love the Player but on some videos the sound has some crackling noises which dont come from the video itself. unfortunatly i wasn't able to find the issue. Am i the only one having this problem?

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Sep 28, 2021

Thanks @JonasZieker, first of all it would help if you can provide a video with the issue. Generally, Flyleaf will push audio frames only at exact timestamps to ensure audio/video sync. You can try the following to identify the issue:

  1. Change audio latency from settings/config from 70 ms to 300ms
  2. Try to disable the video and see if the audio still has crackling
  3. Possible update your sound card's drivers (are other players work fine?)
  4. Just to make sure, give it a try with the new/latest version

@JonasZieker
Copy link
Author

Okay seems like my Laptop just havn't had enough processing Power for the Player. Sorry for the false Alarm and thank you for the quick response!

@JonasZieker
Copy link
Author

Hallo, sorry for asking again but i now have better Hardware but got still Problems. I have tryed your suggestions with following result:

  1. i cant find that in the New Version
  2. yes without Video it's fluently
  3. other players are fine (Windows Video and VLC)
  4. i use the Version 3.4.13

@SuRGeoNix
Copy link
Owner

Hey @JonasZieker, does 1) mean that it works fine with the latest version? Can you provide a log file?

@JonasZieker
Copy link
Author

Hey @SuRGeoNix i have updated to 3.5.6 and now it is better but still not as good as i could be.

with 1 i mean that i cannot find such a setting.

What Logfile do you need? The first run log?

@JonasZieker
Copy link
Author

Here is the First Run Log

`09.28.28.487 | Info | [FlyleafEngine] Loading FFmpeg libraries from ':FFmpeg'
09.28.30.477 | Error | [FlyleafEngine] FFmpeg failed to load avdevices/avfilters/postproc
09.28.30.478 | Info | [FlyleafEngine] FFmpeg Loaded (Location: C:\Users\Admin\Desktop\Bedienbarer Player\FFmpeg, Ver: 58.76.100, #Files: 5)
09.28.30.504 | Info | [FlyleafEngine] GPU Adapters
[#1] NVIDIA NVIDIA GeForce RTX 3060 (Id: 9476 | Luid: 54402) | DVM: 11,86 GB
[#2] Intel Intel(R) UHD Graphics 630 (Id: 39880 | Luid: 59151) | DVM: 128 MB
[#3] Unknown Microsoft Basic Render Driver (Id: 140 | Luid: 59071) | DVM: 0 B

09.28.30.533 | Info | [FlyleafEngine] Audio Devices
{0.0.0.00000000}.{6c820c59-5ba0-4e3c-a985-34d6e38658df} | 65BDL3510Q (NVIDIA High Definition Audio)
{0.0.0.00000000}.{de4bab5b-be73-4093-9135-c41bdd2da951} | Lautsprecher (Realtek High Definition Audio) *

09.28.31.476 | Info | [FlyleafEngine] Plugin loaded (OpenDefault - 3.5.6.0)
09.28.31.476 | Info | [FlyleafEngine] Plugin loaded (OpenSubtitles - 3.5.6.0)
09.28.31.476 | Info | [FlyleafEngine] Plugin loaded (StreamSuggester - 3.5.6.0)
09.28.31.532 | Info | [FlyleafEngine] Plugin loaded (BitSwarm - 1.3.0.0)
09.28.31.533 | Info | [FlyleafEngine] Plugin loaded (OpenSubtitlesOrg - 1.2.0.0)
09.28.31.569 | Info | [FlyleafEngine] Plugin loaded (SubtitlesConverter - 1.0.0.0)
09.28.31.570 | Info | [FlyleafEngine] Plugin loaded (YoutubeDL - 1.3.0.0)
09.28.31.673 | Info | [FlyleafEngine] Thread started
09.28.31.698 | Debug | [#1] [Player ] Creating Player (Usage = AVS)
09.28.31.699 | Info | [#1] [Player ] Initialiazing audio (Default @ 48000Hz)
09.28.31.805 | Debug | [#1] [Renderer ] Initializing
09.28.31.953 | Debug | [#1] [Renderer ] Adapter Info
[Adapter-54402] NVIDIA GeForce RTX 3060 System: 0 B Video: 11,86 GB Shared: 15,94 GB
[Output ] \.\DISPLAY1 (X=0, Y=0) 1920x1200 [8:5]

09.28.31.978 | Debug | [#1] [Renderer ] D3D11 Video Processor

MaxInputStreams 5
MaxStreamStates 5
HDR10 Limited no
HLG no

[Video Processor Device Caps]
LinearSpace yes
XvYCC no
RgbRangeConversion yes
YCbCrMatrixConversion yes
NominalRange yes

[Video Processor Feature Caps]
AlphaFill yes
Constriction yes
LumaKey yes
AlphaPalette yes
Legacy no
Stereo yes
Rotation yes
AlphaStream yes
PixelAspectRatio yes
Mirror no
ShaderUsage no
MetadataHdr10 no

[Video Processor Stereo Caps]
MonoOffset yes
RowInterleaved yes
ColumnInterleaved no
Checkerboard no
FlipMode no

[Video Processor Input Format Caps]
RgbInterlaced no
RgbProcamp no
RgbLumaKey yes
PaletteInterlaced no

[Video Processor Filter Caps]
Brightness [ -101 - 101] | x 1 | *0
Contrast [ 40 - 160] | x 1 | *100
Hue [ -180 - 180] | x 1 | *0
Saturation [ 13 - 187] | x 1 | *100
NoiseReduction [ 0 - 100] | x 1 | *0
EdgeEnhancement [ 0 - 100] | x 1 | *0
AnamorphicScaling [ 0 - 100] | x 1 | *0
StereoAdjustment [ -600 - 600] | x 1 | *0

[Video Processor Input Format Caps]
Denoise no
Deringing no
EdgeEnhancement yes
ColorCorrection yes
FleshToneMapping no
ImageStabilization no
SuperResolution no
AnamorphicScaling yes

[Video Processor Rate Conversion Caps #0]

[Video Processor Rate Conversion Caps]
PastFrames                          2
FutureFrames                        1
ProcessorCaps                       23
ITelecineCaps                       0
CustomRateCount                     6

[Video Processor Processor Caps]
DeinterlaceBlend                    yes
DeinterlaceBob                      yes
DeinterlaceAdaptive                 yes
DeinterlaceMotionCompensation       no
InverseErseTelecine                 yes
FrameRateConversion                 no

09.28.31.979 | Info | [#1] [Renderer ] D3D11 Video Processor Initialized (Rate Caps #0)
09.28.31.984 | Info | [#1] [Renderer ] Initialized with Feature Level 12.1
09.28.31.987 | Debug | [#1] [Player ] Created
09.28.32.565 | Debug | [#1] [Renderer ] Swap chain with control ready
`

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Jun 24, 2022

I will need to a log when the issue happens. Set a log file from settings and set Log Level to Debug (set FFmpeg log to Info). Then open the video that causes the audio issue until it happens (few seconds are enough). Please attach the file instead of copy paste it here so I can ready it easily.

(By the way, there is no latency settings anymore as it plays on zero latency)

@JonasZieker
Copy link
Author

Hallo again. Thats a very cool Logwriter. Here the File. The Original Movie goes 15 minutes and i only played 2 mins. At Timestamp 00:32 was a big crack in audio.
Log.log

@SuRGeoNix
Copy link
Owner

I see that the problem is that it cannot handle to play 4K @ 60 fps. You said others players can handle this?

@JonasZieker
Copy link
Author

Yes the normal windows media Player that comes with windows 11 plays it fluently. Would it encounter the Problem if i reduce the Framerate to 30Hz?

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Jun 24, 2022

You can try to edit the Flyleaf.Config.xml and change the MaxVideoFrames to something bigger (maybe 20). Requires restarting the application.

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Jun 24, 2022

I guess it will play at 30Hz. This is not an issue with Flyleaf as I can play 4K @ 60 fps without any issues. I guess you having this issue only with these formats? You might be able to resolve it by changing MaxVideoFrames (try also smaller eg. 2).

@JonasZieker
Copy link
Author

Thank you for youre Help. I realy appreciate it. With the now gatthered information i will make some further testing and will reply later.

@SuRGeoNix SuRGeoNix changed the title Sound has audio artifacts 4K @ 60 FPS audio crackling Jun 24, 2022
@SuRGeoNix
Copy link
Owner

No problem, let me know how it goes when you test it. If you can play it without issues on Windows Media Player then I will have to see how I can allow more not accurate framerate to be able to play it without audio crackling.

@JonasZieker
Copy link
Author

Hallo, so i Player with the settings and it good a small bit better setting the Max framerate to 35 but it still Gold issues. I tried other 4k60 Videos and they run perfekt. So i Konverted by problematic Movie from HEVC to H264 Codec and reduced framrate to 30Hz. I also changed the Resolution from WQUXGA to WUXGA and now it also runs nice and smooth. For now my Issue is solved but it would still be nice to know if theres another way than going down in res. (or maybe my movie is just poorly made :D)

Thank you again For your time

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Jun 25, 2022

I will review also my code. As this does not seem to be a hardware issue. Just not easy for me to fix it as I cannot reproduce it. I have just remembered a part of the code for exact this issue that I have a note. I will use also a config property for the rendering buffers so you can increase those as well.

This is promising as you said by reducing your display's resolution it works better. It means that the problem was with the rendering time rather than decoding (which is still happens at 4K). Can you provide also a dxdiag (Save All Information to a file)? I want to check your display's pixel output format etc.

Edit: I see from your log that the issue was with 1920x1080 output display (not 4K) and with h264 not h265 (hevc). Additionally, the video is not 3840x2160 but 3840x2400 (which is higher than 4K). Generally, there is no point or it is even worse when you play higher resolution videos from what your display supports.

SuRGeoNix added a commit that referenced this issue Jun 25, 2022
* Introduces Config.Video.Swap10Bit to use 10-bit instead of 8-bit swap chain

* Introduces Config.Video.SwapBuffers to manually set render's swap chain buffers
@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Jun 25, 2022

@JonasZieker after your great support with your feedback I think you can have a smooth playback with the new configuration that I have exposed. Use Swap10bit (set to true) and about 7 SwapBuffers.

I've notice that you didn't use the latest version from your log? It was compiled for ffmpeg v5 and you used ffmpeg v4. Make sure you have ffmpeg 5 libraries (download if required from releases) and then I've created a compiled version from the master if you can't do it yourself easily and you can get it here. Is just the executable not the libraries. (Delete old configs xml files, run the application to create them, close it, edit the config and then test it)

@SuRGeoNix
Copy link
Owner

@JonasZieker I'm closing this as others not having issues even with 2 buffers. Feel free to re-open it if you still have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants