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

Multi-channel sound blocked #618

Closed
JeremTM93 opened this issue Nov 6, 2023 · 41 comments
Closed

Multi-channel sound blocked #618

JeremTM93 opened this issue Nov 6, 2023 · 41 comments

Comments

@JeremTM93
Copy link

After testing the latest version of TracyPlayer (36) on tvOS 17.1

When I open a multichannel feed everything is fine :

1000006880.jpg

Then, I close the multichannel stream, I open a 2.0 stereo stream, the player remains stuck in multichannel :

1000006881.jpg

We need to restart the AppleTV for normal operation on a 2.0 stereo stream :

1000006882.jpg

@kingslay
Copy link
Owner

kingslay commented Nov 6, 2023

你用AirPods pro 查看呢?也会这样吗?我测试的时候是用AirPods pro。

@JeremTM93
Copy link
Author

你用AirPods pro 查看呢?也会这样吗?我测试的时候是用AirPods pro。

I don't have airpods. I have the problem on my two 5.1.2 home theater systems

@cdguy
Copy link

cdguy commented Nov 6, 2023

你用AirPods pro 查看呢?也会这样吗?我测试的时候是用AirPods pro。

I don't have airpods. I have the problem on my two 5.1.2 home theater systems

Perhaps using the ios application might reveal you the audio input info.

Even if you can't find it, what you should do (debug) is this:

1- track the sound properties of the appleTV at first open; because regardless of the sound device you use, at first open the AppleTV outputs stereo sound.
2- track the changes (codewise) of the appleTV when a multi-audio track is played (meaning that the audio properties would change from stereo to surround)
3- when the media playback is ended, "revert" the audio properties to the audio properties at first AppleTV open

@kingslay
Copy link
Owner

kingslay commented Nov 6, 2023

@cdguy 你在tvOS上,用AirPods,显示会有问题吗?

@anrtiger
Copy link

anrtiger commented Nov 6, 2023

I have the same problem with my home theater system

@kingslay
Copy link
Owner

kingslay commented Nov 6, 2023

你们是在那边看到这个信息的。这个信息是电视自带的吗?还是tvos上面的。

@JeremTM93
Copy link
Author

JeremTM93 commented Nov 6, 2023

你们是在那边看到这个信息的。这个信息是电视自带的吗?还是tvos上面的。

tvOS is not the cause of the problem.
As soon as we open a multichannel stream with KSplayer, all streams will be blocked as multichannel, even 2.0 streams.
This information is given by the audio receiver until we restart the AppleTV.
If we open another application using another player, it will interpret which sound track and adapt the signal sent to the audio receiver.

However, when we open for the first time (starting AppleTV) with KSplayer a 2.0 audio track, it's perfect.
It's really when we open a multichannel stream that KSplayer locks all other 2.0 streams as multichannel streams, wrongly, until AppleTV restarts.

@JeremTM93
Copy link
Author

Additional information @kingslay, if it helps :

After turning on the AppleTV, we launch a 5.1 stream, it's ok, the audio receiver receives the right information.

then, we launch a 7.1 stream, it's ok again, the audio receiver receives the right information.

From there, if we open a stream again in 5.1 or 2.0, KSplayer no longer provides the correct information to the audio receiver, it will be stuck in 7.1.

Forced to restart the AppleTV if we want to match the correct playback information with KSplayer again.

After reboot we continue the tests by first opening a 5.1 stream, it's ok. we then open a stream in 2.0, the audio receiver remains stuck in 5.1. We open a 7.1 stream, it's ok, the audio receiver receives the right information.

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

@JeremTM93 你把audio Player Type 改成是AudioUnit或者AVSampleBufferAudioRenderer也是都有这个问题吗?

@cdguy
Copy link

cdguy commented Nov 7, 2023

@JeremTM93 你把audio Player Type 改成是AudioUnit或者AVSampleBufferAudioRenderer也是都有这个问题吗?

If you update tracy player testflight version he can try

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

我有点思路了。可能找到问题点了。我等下更新下testflight

@JeremTM93
Copy link
Author

@JeremTM93 你把audio Player Type 改成是AudioUnit或者AVSampleBufferAudioRenderer也是都有这个问题吗?

I know this problem existed before your AudioUnit patch

@JeremTM93
Copy link
Author

我有点思路了。可能找到问题点了。我等下更新下testflight

Ok, let me know here when I could try, thanks

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

@JeremTM93 现在在打包testflight了。新的包出来之后。你就可以测试这个问题了。再次感谢你的测试。我这边有个私人的问题想问下你,不知道是否合适: 你不是一个开发者,你为什么会对这个项目感兴趣呢?并且还花时间来帮忙做测试。

@chillout23
Copy link

chillout23 commented Nov 7, 2023

@kingslay AVSampleBufferAudioRenderer is the only option that gives me dialogue (center channel) on 5.1 movies right now, but I have no surround sound on rear speakers. There is still something here that does not work correctly, did you verify with your soundbar that you have sound on rear speakers?

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

我这边是的可以的。你是5.1还是7.1的呢?

@chillout23
Copy link

@kingslay I have 5.1 system.

AUGraph gives me no center channel sound
AudioUnit gives me no center channel sound
AVAudioEngine gives me no center channel sound
AVSampleBufferAudioRenderer gives me center channel sound

All of these 4 options do not play any surround sound from rear speakers.

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

是后置音箱都无法发出声音吗

@chillout23
Copy link

chillout23 commented Nov 7, 2023

Nope. But I am on tvOS 17.2, not sure if things changed in the beta. If it works for you and other users the issue must be on my side. Actually it is a bug on my side: https://community.firecore.com/t/lpcm-surround-is-lost-in-the-latest-apple-tv-17-2-beta/45616

Do you get 5.1 PCM Multichannel on your soundbar or Dolby 5.1? Do you use HDMI ARC or HDMI eARC? Because 5.1 PCM Multichannel needs eARC which can be more complicated.

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

我的电视只支持HDMI ARC 。所以我的是用HDMI ARC 。我的音箱是7.1. 我的音箱5.1和7.1都支持的。我是用https://github.com/kingslay/KSPlayer/raw/develop/Tests/KSPlayerTests/Resources/dolby-digital-plus-channel.mkv 这个url来进行测试的。这是dolby的demo

@chillout23
Copy link

Ok thank you, it's nice to know what you are testing with for future reference. :)

@JeremTM93
Copy link
Author

@JeremTM93 现在在打包testflight了。新的包出来之后。你就可以测试这个问题了。再次感谢你的测试。我这边有个私人的问题想问下你,不知道是否合适: 你不是一个开发者,你为什么会对这个项目感兴趣呢?并且还花时间来帮忙做测试。

No problem 😉
I am a user of your player, which is to date the best on AppleTV when we want to play high quality digital content, as I do with the fabulous multimedia application with its Xtream support, LillyPlayer V3 !
This is why I participate, your work allows the most demanding to continue on the tvOS platform. Thank you so much !

I will test the new version of TracyPlayer soon and will get back to you.
I will continue to help you as I can with your test application.

@chillout23
Copy link

@JeremTM93 Where do you find LillyPlayer V3?

@cdguy
Copy link

cdguy commented Nov 7, 2023

@JeremTM93 现在在打包testflight了。新的包出来之后。你就可以测试这个问题了。再次感谢你的测试。我这边有个私人的问题想问下你,不知道是否合适: 你不是一个开发者,你为什么会对这个项目感兴趣呢?并且还花时间来帮忙做测试。

@kingslay all sound and media geeks would like to have the best experience possible on AppleTV apps; however, only your library written in SwiftUI supports too many features such as correct display of dolby vision, multi-channel audio, dynamic range etc.

As most Devs. do not have the appropriate hardware to improve such features, sometimes it is up to the user to report what is missing but just a few users know how to explain in details and in a way that a developer would understand everything

@cdguy
Copy link

cdguy commented Nov 7, 2023

@chillout23 @JeremTM93 please no comment on any media player app; some would get angry 🤣

@chillout23
Copy link

I would even go as far to say that the future of IPTV on Apple devices is dependant on @kingslay's work. FFMPEG looks like a can of worms, and neither VLC project or MPV can solve issues as they arise. If it wasn't for this project Apple TV will always give you an subpar experience compared to other platforms.

@JeremTM93
Copy link
Author

@JeremTM93 Where do you find LillyPlayer V3?

In beta for a few weeks but was submitted to Apple this morning 😉

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

我知道有一个很著名的Apple全平台app infuse。 他支持的高质量的视频的格式应该是最多的吧

@chillout23
Copy link

FYI: Just tested LillyPlayer 3.0.
4K HEVC playback. After 2-3 minutes it starts to stutter if I use MPVLib.
With KSLib there is no stutter, everything is smooth.

:)

@JeremTM93
Copy link
Author

我知道有一个很著名的Apple全平台app infuse。 他支持的高质量的视频的格式应该是最多的吧

No Dolby Vision on infuse, or very limited or false support. No IPTV support either. Its strong point is support for Dolby Atmos Mat

@JeremTM93
Copy link
Author

Otherwise it's perfect @kingslay, the audio receiver now adapts to the audio track read by KSPlayer, tracks 2.0, 5.1 and 7.1 are processed correctly by switching from one to the other !

I just had strange things when moving forward on a 7.1 track, a sound and image lag occurred and also an acceleration of the image. This can be corrected by going back. surely an interface problem.

@JeremTM93
Copy link
Author

I would even go as far to say that the future of IPTV on Apple devices is dependant on @kingslay's work. FFMPEG looks like a can of worms, and neither VLC project or MPV can solve issues as they arise. If it wasn't for this project Apple TV will always give you an subpar experience compared to other platforms.

I will still add that no matter how much Kingslay works, there will always be limitations with Apple.
For example, the AppleTV does not offer audio passthrough and cannot read the MEL and FEL layers of Dolby Vision. But the interface is so nice that only the positive sides stand out !

@chillout23
Copy link

True. There are limitations anywhere you go. Things arent perfect at Android side of things either.

@JeremTM93
Copy link
Author

I just had strange things when moving forward on a 7.1 track, a sound and image lag occurred and also an acceleration of the image. This can be corrected by going back. surely an interface problem.

I can confirm that after using seek to go backwards or forwards there may be a desynchronization of sound and image on 7.1 tracks. On old versions of TracyPlayer the phenomenon already existed but it has become more pronounced since the last version.  we need to play seek to restore synchronization.

We'll be continuing our tests for a future ticket, but if you've already got an idea @kingslay ?

@kingslay
Copy link
Owner

kingslay commented Nov 8, 2023

@JeremTM93 是否可以提供下url呢?

@cdguy
Copy link

cdguy commented Nov 10, 2023

I can confirm that after using seek to go backwards or forwards there may be a desynchronization of sound and image on 7.1 tracks. On old versions of TracyPlayer the phenomenon already existed but it has become more pronounced since the last version.  we need to play seek to restore synchronization.

I sent you an e-mail @kingslay

@kingslay
Copy link
Owner

kingslay commented Nov 10, 2023

@cdguy 那个url我用vpn还是无法播放。是否可以麻烦你裁剪出那段有问题的视频片段然后上传到github呢?

@cdguy
Copy link

cdguy commented Nov 10, 2023

@cdguy 那个url我用vpn还是无法播放。是否可以麻烦你裁剪出那段有问题的视频片段然后上传到github呢?

I sent you the same link without https

Thank you

@kingslay
Copy link
Owner

@cdguy 收到你的链接了。可以播放了。你操作说明的意思是 只要从大于两分钟的地方开始播放,然后往后退都会导致音画不同步吗?

@cdguy
Copy link

cdguy commented Nov 10, 2023

@cdguy 收到你的链接了。可以播放了。你操作说明的意思是 只要从大于两分钟的地方开始播放,然后往后退都会导致音画不同步吗?

Go directly to the last 2 minutes of the movie, and do a quick seek backwards, the audio and the movie goes out of sync

@JeremTM93
Copy link
Author

Hi @kingslay, in fact on the stream sent to you by @cdguy, you just have to read the first 2 minutes and then rewind a bit and normally you'll see the bug.

kingslay added a commit that referenced this issue Nov 11, 2023
kingslay added a commit that referenced this issue Nov 11, 2023
theonlymo pushed a commit to theonlymo/KSPlayer that referenced this issue Nov 16, 2023
theonlymo pushed a commit to theonlymo/KSPlayer that referenced this issue Nov 16, 2023
* 'develop' of github.com:kingslay/KSPlayer:
  解决本地依赖问题
  解决字幕无法显示的问题
  fix kingslay#624
  fix kingslay#528
  add log
  fix  kingslay#618
  fix  kingslay#618
  fix build
  fix kingslay#627
  add sponsor
  fix build
  fix kingslay#528

# Conflicts:
#	Sources/KSPlayer/MEPlayer/FFmpegAssetTrack.swift
#	Sources/KSPlayer/MEPlayer/FFmpegDecode.swift
#	Sources/KSPlayer/MEPlayer/MEPlayerItem.swift
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

5 participants