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

[AE/OsxSink] fix 16bit ne passthrough when there is no dedicated encoded stream #10680

Merged
merged 3 commits into from
Oct 12, 2016

Conversation

Memphiz
Copy link
Member

@Memphiz Memphiz commented Oct 11, 2016

This restores the pcm passthrough mode for the osx sink when only 32bit float virtual formats are available.

We have multiple ways of passing through on osx

  1. Use dedicated passthrough streams - this is the prefered way but not all audio devices have those streams
  2. If we have a 16 bit integer stream with 48000 Hz sample rate we try to use this.
    a. We open the physical stream and try to open a virtual stream with the same format so that no conversion is taking place and we get a raw passthrough situation
    b. If we fail to open a virtual stream with 16bit integer 48000 Hz (which is the case if there simply is no suche virtual stream like on my mac mini for example), we use the bitstream option we had before (developed by jmarshall) which reverses the conversion from virtual to physical format which is done in the device/CoreAudio layer to achieve raw passthrough.

This PR adds the 2.b. use case again which was removed in

ddc3d29#diff-3dd678432bba9d51a39816409d376717

@FernetMenta you can try this with this patch http://pastebin.com/6MM375AX which basically disables the dedicated encoded streams and leaves you with only integer streams. On my macmini i get the same behavior as the user in the forum - it fails to find a virtual stream which matches the physical format and opens the nullsink ... (because my macmini also only has 32bit float virtual formats).

Jenkins bakes a testbuild i want to provide to the user too.

@Memphiz
Copy link
Member Author

Memphiz commented Oct 11, 2016

User confirmed that this fixes the regression here http://forum.kodi.tv/showthread.php?tid=293500&pid=2434785#pid2434785

@Memphiz Memphiz added Type: Fix non-breaking change which fixes an issue v17 Krypton Platform: macOS Component: Audio labels Oct 11, 2016
@FernetMenta
Copy link
Contributor

wow, what a hack :)
but since it was already in, it sould be ok

@fritsch
Copy link
Member

fritsch commented Oct 12, 2016

We need something similar for certain intel rigs that only speak 24 bit :-)

Am 12.10.2016 10:14 vorm. schrieb "Rainer Hochecker" <
notifications@github.com>:

wow, what a hack :)
but since it was already in, it sould be ok


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#10680 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABCfHX1_V1kMkRb8ShF9lSpY_XQBxtCVks5qzJbvgaJpZM4KT7IE
.

@Memphiz Memphiz merged commit 704fd71 into xbmc:master Oct 12, 2016
@Memphiz Memphiz deleted the osxsink_fix_16bit_ne_passthrough branch October 12, 2016 18:01
@Memphiz
Copy link
Member Author

Memphiz commented Oct 12, 2016

Feel free to steal it for your needs @fritsch ;)

@fritsch
Copy link
Member

fritsch commented Oct 12, 2016

On ALSA ist would be a bit different. We needed to enumerate a pseudo format 16 bit and just align it into the 24bit output. Need to think if I want to do that :-) or directly doing it in kernel level.

Btw. checking your code in detail again, there might be an issue, as you use a float multiplication with an inverse. There is no guarantee that this holds for every input float.

@Memphiz
Copy link
Member Author

Memphiz commented Oct 12, 2016

don't wanna ping him but you would need to discuss this with jmarshall :)

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

Successfully merging this pull request may close these issues.

4 participants