)]}'
{
  "commit": "ed10b2c7df695ab73ab58c4439a29a8789fd46c7",
  "tree": "4c5a25550a28c96d4cb1b5f15a14d7d6f736d0d5",
  "parents": [
    "66950357d6359b693777efb806c2ff02ed4620ea"
  ],
  "author": {
    "name": "Tom Bergan",
    "email": "tombergan@fuchsia.infra.roller.google.com",
    "time": "Mon Mar 07 23:07:13 2022 +0000"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Mar 07 15:08:51 2022 -0800"
  },
  "message": "[roll] Roll fuchsia Reland \"[audio_core] Finalize new ReadLock semantics\"\n\nThis is a reland of commit a8579d5c2d8b6544825df2a95241865938195dcd\n\nChanges are:\n\n- Fix a crash in PacketQueue (see new test)\n- Fix a test flake in audio_policy_pipeline_test (was fxrev.dev/654306)\n\nMultiply: audio-policy-pipeline-test\nMultiply: audio-renderer-pipeline-test\nMultiply: audio-capturer-pipeline-test\nMultiply: audio-core-fidelity-test\nMultiply: audio-clock-pipeline-test\nOriginal-Fixed: 50669\nOriginal-Fixed: 73306\nOriginal-Fixed: 95042\n\nOriginal change\u0027s description:\n\u003e [audio_core] Finalize new ReadLock semantics\n\u003e\n\u003e fxr/639969 defined new semantics for ReadLock. This CL enforces those\n\u003e semantics across audio_core. stream.h has been overwritten with\n\u003e stream2.h.\n\u003e\n\u003e The major changes are:\n\u003e\n\u003e 1. Subclasses now implement ReadLockImpl and TrimImpl instead of\n\u003e    ReadLock and Trim. This results in a bunch of small mechanical\n\u003e    changes across the code base.\n\u003e\n\u003e 2. EffectsStageV{1,2} are updated to meet the new semantics, including\n\u003e    ring out. Additionally, a number of bugs have been fixed (these bugs\n\u003e    were labeled TODOs in the old code). The two classes have essentially\n\u003e    identical implementations of ReadLockImpl and TrimImpl.\n\u003e\n\u003e 3. PacketQueue is updated to meet the new semantics. The old\n\u003e    implementation always returned the first packet in the queue, while\n\u003e    the new implementation intersects the first packet with the requested\n\u003e    range. Additionally, the new semantics make it easy to detect packet\n\u003e    underflows in PacketQueue -- this no longer happens in MixStage.\n\u003e\n\u003e 4. MixStage is updated to meet the new semantics, including ring out.\n\u003e    The old implementation had a lot of code to handle cases where the\n\u003e    source buffer was entirely in the past or entirely in the future.\n\u003e    Most of that code is obsolete with the new semantics, e.g., ReadLock\n\u003e    never returns a buffer \"in the past\". Since we can delete a lot of\n\u003e    code, I refactored MixStage::Mix to be (hopefully) simpler.\n\u003e\n\u003e This is a large CL. It\u0027s difficult to split this CL into smaller pieces\n\u003e without creating a temporary audio_core2 directory, which felt like\n\u003e overkill. To simpify the review, note that:\n\u003e\n\u003e - The review can be logically split into the four parts listed above\n\u003e   (EffectsStage, PacketQueue, MixStage, and everything else). You can\n\u003e   read and comment on one part at a time as if they are different CLs.\n\u003e\n\u003e - Since EffectsStageV{1,2} have essentially the same ReadLock code, I\n\u003e   suggest reviewing EffectsStageV1 carefully, then skim EffectsStage2.\n\u003e\n\u003e - stream2.h was moved into stream.h and the tempoary \"::stream2\"\n\u003e   namespace was removed. The diff looks large than reality because\n\u003e   Git/gerrit is unfortunately unable to recognize the file move.\n\u003e\n\u003e Other minor changes:\n\u003e\n\u003e - audio-capture-timestamp-validator was updated to use a shorter\n\u003e   impulse. Before this CL, the production effects added a long ramp-in\n\u003e   phase to each impulse, so to locate an impulse\u0027s leading edge, the\n\u003e   impulse needed to be wider than the ramp in (we used 35 frames).\n\u003e   After this CL, impulses have a short ramp-in phase. Wide impulses are\n\u003e   transformed to a short ramp in followed by a wave, and our existing\n\u003e   impulse detector is confused by this wave. To avoid this problem,\n\u003e   we\u0027ve narrowed the impulse to 10 frames.\n\u003e\n\u003e   Note that this change to the production effects is WAI: this CL\n\u003e   actually fixes some long-standing bugs in effects handling. The\n\u003e   production effects should be more correct after this CL than before.\n\u003e\n\u003e Multiply: audio-core-fidelity-test\n\u003e Multiply: audio-renderer-pipeline-tests\n\u003e Multiply: audio-capturer-pipeline-tests\n\u003e Multiply: audio-policy-pipeline-tests\n\u003e Multiply: audio-clock-pipeline-tests\n\u003e Original-Fixed: 50669\n\u003e Original-Fixed: 73306\n\u003e Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/478521\n\n[audio_core] Fix flake in audio_policy_pipeline_test\n\nBefore capturing from loopback, we should wait until the first packet is\nrendered, i.e. until `play_time`. Each test captures just one 10-frame\npacket, so waiting for the first packet to render is sufficient.\n\nI also increased the lead time tolerance, just in case.\n\nMultiply: audio-policy-pipeline-test\nOriginal-Fixed: 95042\nOriginal-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/654306\nOriginal-Revision: 91302a9030c75a93b480ae5b5b70a7b1f44a34ad\nGitOrigin-RevId: ca0235a5efa445a7abd1326701920d21172af302\nChange-Id: I43528c05795882bb26ed61139f21c2676807b576\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b18784b55676ec17e709d256b068ddb42ce0f207",
      "old_mode": 33188,
      "old_path": "stem",
      "new_id": "10d6991e98cf12f75706bde8b1c64dfa7c03be20",
      "new_mode": 33188,
      "new_path": "stem"
    }
  ]
}
