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

Upmix Stereo Question #3

Closed
GrandfatherTrout opened this issue Feb 9, 2018 · 5 comments
Closed

Upmix Stereo Question #3

GrandfatherTrout opened this issue Feb 9, 2018 · 5 comments

Comments

@GrandfatherTrout
Copy link

When "Upmix Stereo" is enabled what happens when there is already a 5.1 sound source playing?
I have noticed a difference in sound - will the additional surround channels be overridden by the upsampled stereo signal?

I am curious because so far your little program is so promising... My goal is to have different material in a playlist and I would like to have for example stereo material being upsampled, but 6 channel FLACs being passed through as 5.1.

@q-p
Copy link
Owner

q-p commented Feb 9, 2018

The up-mix matrix is described in the commit message here 42b2f23

As you can see the original 5.1 channels are passed through but the up-mix is performed and added additionally. SoundPusher doesn't look at the audio data at all, and preferably I'd keep it that way.

The main problem I see is that detecting >2 channels is easy (was there any signal on the non-L/R channels in the last N frames?), but the converse is not, because you could have a 5.1 signal that purposely has silence everywhere but the L/R channels.

@GrandfatherTrout
Copy link
Author

I see, so the 5.1 is actually sounding, but an upmix from the stereo is also added to the back L+R channels...
And so what you are saying, for SoundPusher there is no difference in a 5.1 stream with silence in the back L+R than a stereo stream? So it would have to find another way to see whether the file that is streaming through is 2ch or 6ch source.
To me it would be really cool if I could randomly stream 6ch and 2ch files with only the stereo files being upmixed, but I understand if that is difficult to do.

@q-p
Copy link
Owner

q-p commented Feb 13, 2018

And so what you are saying, for SoundPusher there is no difference in a 5.1 stream with silence in the back L+R than a stereo stream?

Yes, that's the essence. The audio device (in this case LoopbackAudio) is always 5.1 channels, but which channels the application "feeds" depends on the application, and I don't know of a good way to transport "intent".

As I said, technically, it's not hard to insert a silence detection heuristic and toggle upmixing based on that, but it will always be wrong occasionally.

What are you using to play your tracks? Maybe it's possible to add the upmix on the application side, where the knowledge of the source format is still there?

@GrandfatherTrout
Copy link
Author

I use Swinsian. It is the most flexible music player I know and I tried everything else I could get my hands on - it works like iTunes used to work before Apple ruined it and can handle very large music libraries. It also has the ability to play lossless and multi-channel formats and switch between them on the fly (I am not affiliated - I am using it for several years now and it has stood the test of time)
I wonder how often a silence detection would actually get it wrong in a real-world test, you would probably have to introduce a delay so SoundPusher can examine a certain portion ahead of time?

@q-p
Copy link
Owner

q-p commented Feb 14, 2018

No, there wouldn't be any additional delay, you'd instead switch in one direction (when turning upmix back on) a fixed amount of time too late (for however long you decide you need to not hear anything on all surround channels for you to assume it really is only 2 channel content — but this really can't be too short because otherwise you'd get weird flips of upmix on/off just because some channels were silent for too long in a real 5.1 context).

@q-p q-p closed this as completed Jun 7, 2020
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