Closed Bug 1605833 Opened 2 years ago Closed 2 years ago

Tidal's encrypted FLAC playback works on macOS, but fails on Windows

Categories

(Core :: Audio/Video: Playback, defect, P2)

Unspecified
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla74
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- wontfix
firefox72 --- wontfix
firefox73 --- verified
firefox74 --- verified

People

(Reporter: cpeterson, Assigned: jhlin)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Tidal reports that encrypted FLAC playback works on macOS, but fails on Windows using Firefox 71. I don't know if this is a new regression in 71 or whether Tidal only tested in 71. Encrypted FLAC support landed in Firefox 64 (bug 1489102).

Tidal's code to check EME/FLAC/MP4 support looks like:

navigator.requestMediaKeySystemAccess('com.widevine.alpha', [
      {
        initDataTypes: ['cenc'],
        sessionTypes: ['temporary'],
        audioCapabilities: [
          {
            contentType: 'audio/mp4; codecs="flac"', // Flac in MP4
            robustness: 'SW_SECURE_CRYPTO',
          },
          {
            contentType: 'audio/mp4; codecs="mp4a.40.2"', // AAC-LC
            robustness: 'SW_SECURE_CRYPTO',
          },
        ],
      },
    ]).then(ms => console.log(ms.getConfiguration().audioCapabilities)); // flac in mp4 is dropped in FF on Windows 10 here.

bryce, any idea?

Flags: needinfo?(bvandyk)
Priority: -- → P2

I ran mozregression-gui on my Windows machine now as suggested by Chris in our mail thread with Mozilla and TIDAL.

I did encounter errors with bisecting due to this bug though: https://bugzilla.mozilla.org/show_bug.cgi?id=1596201

I moved the test code to a Codepen on https://cdpn.io/enjikaka/debug/dyPVBJo/yPkJjKELoLYk and ran this through with these settings: http://prntscr.com/qif65n

My result was: http://prntscr.com/qif1no

And in the logs I got;

2020-01-02T11:35:13: CRITICAL : Last build ca0f00593e38 is missing, but mozregression can't find a build after - so it is excluded, but it could contain the regression!

in between the TaskCluster errors. Hope this helps! :)

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

(In reply to Jeremy Karlsson from comment #2)

My result was: http://prntscr.com/qif1no

This is very helpful. Looks like a regression between the Firefox 65 Nightly builds on 2018-12-06 and 2018-12-07.

John, your fix for Widevine FLAC bug 1510424 landed during the regression range. It was only supposed to fix an Android assertion failure, but it appears to have broken Widevine FLAC on Windows.

https://hg.mozilla.org/mozilla-central/rev/a7f0acc59459

Flags: needinfo?(jolin)
Regressed by: 1510424
Has Regression Range: --- → yes

Too late for a fix in 71 but we can still take a patch for 73/74.

(In reply to Chris Peterson [:cpeterson] from comment #4)

(In reply to Jeremy Karlsson from comment #2)

My result was: http://prntscr.com/qif1no

This is very helpful. Looks like a regression between the Firefox 65 Nightly builds on 2018-12-06 and 2018-12-07.

John, your fix for Widevine FLAC bug 1510424 landed during the regression range. It was only supposed to fix an Android assertion failure, but it appears to have broken Widevine FLAC on Windows.

https://hg.mozilla.org/mozilla-central/rev/a7f0acc59459

The logic of that fix looks incorrect and excludes Windows from supporting FLAC & Opus. I'll upload a patch to address the problem.

Flags: needinfo?(jolin)
Flags: needinfo?(bvandyk)
Assignee: nobody → jolin

Bug 1510424/D13135 remove them from Windows along with Android by mistake.
This patch also moves some code to separate Android only logic from other
platforms to avoid making similar mistakes.

Pushed by jolin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e75905873309
Add FLAC and Opus support back to Widevine on Windows. r=bryce
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Please nominate this for Beta and Release approval when you get a chance. I'll leave the final call for 72 to Julien, but this seems like a regression we might at least want to consider fixing in a dot release.

Flags: needinfo?(jolin)

Comment on attachment 9119604 [details]
Bug 1605833 - Add FLAC and Opus support back to Widevine on Windows. r?bryce

Beta/Release Uplift Approval Request

  • User impact if declined: Cannot play encrypted FLAC audio on Tidal.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Minor code change.
  • String changes made/needed:
Flags: needinfo?(jolin)
Attachment #9119604 - Flags: approval-mozilla-release?
Attachment #9119604 - Flags: approval-mozilla-beta?

Comment on attachment 9119604 [details]
Bug 1605833 - Add FLAC and Opus support back to Widevine on Windows. r?bryce

Fixes a regression causing encrypted FLAC music to not play. Approved for 73.0b5. Deferring the decision for release to Julien.

Attachment #9119604 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Unfortunately, for Tidal we're unable to log in without a subscription set up. No luck finding other free websites with this sort of encryption.
Would providing a link for manual verification be to much of an effort for this particular issue?

Flags: needinfo?(jolin)
Attached file flac_test.zip

Here are some FLAC EME test files from a Tidal engineer.

I think you'll need to load them over http:// from a web server. Loading the files locally (using file://) doesn't work for me on Windows. I see web console errors about "Shaka Error NETWORK.UNSUPPORTED_SCHEME (file:enc_flac.mpd)".

Bryce, would you mind helping out here to allow Cristian to verify this is fixed? I don't know exactly what setup is required. Thanks!

Flags: needinfo?(bvandyk)

Right now I'm a bit on a standpoint since uploading the test files on xampp and using 71.0 appears to have no issue - the playback is ok.
Looking into alternatives / hosting servers.

I believe we'll need a page that hits the EME APIs to test this -- as the problem was due going through those APIs to play FLAC. I'll hold the NI and see if I can cook something up today or early next week.

I will ask the original bug reporter (an engineer at Tidal) to verify FLAC EME is working in Firefox Nightly.

Do we have automated tests for EME? Or is that not feasible in automation because the test machine would need to download the Widevine CDM and talk to an EME server?

(In reply to Chris Peterson [:cpeterson] from comment #19)

I will ask the original bug reporter (an engineer at Tidal) to verify FLAC EME is working in Firefox Nightly.

Do we have automated tests for EME? Or is that not feasible in automation because the test machine would need to download the Widevine CDM and talk to an EME server?

We can only test a (highly) limited surface of EME due to our current test frameworks limiting network access which means we can't download CDMs or hit any other servers. It's technically feasible if we rework some of our testing frameworks, but there are not concrete plans in motion for that.

Flags: needinfo?(bvandyk)

Clearing the qe+ since we can't do much about it.
Will still keep an eye on this in case any changes or additional info pops up.

Flags: qe-verify+

Tidal QA has verified encrypted FLAC playback is now working correctly in Firefox 74 Nightly and 73 Beta.

Updating status for bug as well.

Status: RESOLVED → VERIFIED

Comment on attachment 9119604 [details]
Bug 1605833 - Add FLAC and Opus support back to Widevine on Windows. r?bryce

73 ships next week, and we have no plans for another 72 dot release.

Attachment #9119604 - Flags: approval-mozilla-release? → approval-mozilla-release-
Flags: needinfo?(jolin)
You need to log in before you can comment on or make changes to this bug.