Jump to content

Ubuntu 20.04.02 LTS + Haswell i5 = Audio Sync Issues


Y2KFirehawk

Recommended Posts

Y2KFirehawk

As a preface, if it were up to me, I would ditch cable, buttttt happy wife, happy life. Emby Premier user since 2019 and was trouble-free for 1.5+ years. My OCD compels me to keep up with OS updates and Emby updates alike. Somewhere along the line (similar to this post albeit Windows), I developed audio sync issues when watching CBS and other channels that require transcoding.

Stats up front...

i5 Haswell ( i5-4310M), no discreet GPU, 16GB memory, SSD storage, gigabit networking running Ubuntu 20.04.02 LTS
Emby 4.6.1.0 completely stock install + backup config plugin, hardware encoding enabled (defaults)
SiliconDust HDHomeRun Prime (Firmware 20210210)
Client devices: Roku Ultra, NVidia Shield (2017), FireTV

emby_happy.png.d9d0fd22f3dfb43593be3063abbcbe84.png

Watching a channel such as above is happiness both "live" and recorded.

emby_sad.png.4469b70bbd366507b0351331aa615645.png

Watching a channel like the above is where the audio sync issues come in. Starts out OK but as the show goes on the audio gets further behind. In my triage, I came to the following discoveries.

  • Transcoding is done via VAAPI, not Intel Quick Sync. I reviewed the Emby Hardware Acceleration Guide to no avail.
  • If I change to "advanced" transcoding hardware acceleration and only check the QuickSync options (avoiding VAAPI), the streams fail to start.
  • Content that is transcoded MPEG-2 VAAPI > H.264 (AVC) VAAPI struggles
  • Content that is transcoded H.264 (AVC) VAAPI > H.264 (AVC) VAAPI is OK
  • Disabled hardware acceleration and, aside from the CPU utilization increase, the end results were the same.
  • The recent Emby 4.6 release information mentions "Improve Linux QuickSync support", perhaps there are actions I need to take to support? Drivers?

Anyone able to shed light? Thank you!

 

Link to comment
Share on other sites

Y2KFirehawk

Thanks for the reply @Luke. Unfortunately I don't have data specific to CBS HD as of yet, but apparently similar behavior happens on ABC HD... The strange part being that ABC HD is "direct streaming" versus transcoding like CBS HD. I am told that the ABC watching started approximately 1830 and was fine. Around 1820 the sync between audio and video started to fall apart.

Related logs attached. I am still running 4.6.1.0; did not upgrade to 4.6.2.0 yet.

image.png.ac9d4ccc93cadf72e68d854a0749a5e7.png

embyserverlog.txt ffmpeg-directstream-773668a2-7a5e-4a69-90bb-14aa6f77c89e_1.txt

Edited by Y2KFirehawk
Link to comment
Share on other sites

  • 3 weeks later...
Y2KFirehawk

Hey @Luke! Sadly upgraded to 4.6.2 and still saw the behavior. I then saw later version upgrades so I kept up with those in hope of them being the silver bullet. I am now running 4.6.4.0 and still seeing the same audio lag behavior.

Attached are the latest logs. Thank you!

ffmpeg-transcode-8923263c-197b-4773-a869-324a9e33b239_1.txt 20210704_embyserver.txt

Link to comment
Share on other sites

Y2KFirehawk

So I went full nuclear option for the heck of it... Rebuilt machine w/ Ubuntu 20.04.02 LTS and did a clean install of Emby 4.6.4.0 and restored backup via plugin. (carried over series recordings via manual JSON file moves) ABC HD recordings still suffering the same audio getting out of sync problems. 🤔

Edited by Y2KFirehawk
Link to comment
Share on other sites

Q-Droid

Is it only on Roku or does it happen on all of your clients - browser, mobile, etc?

 

Link to comment
Share on other sites

Y2KFirehawk
39 minutes ago, Q-Droid said:

Is it only on Roku or does it happen on all of your clients - browser, mobile, etc?

Great and valid question! It is seen on all devices leading me to thinking it is an encoding issue at the time of recording or live playback.

Link to comment
Share on other sites

  • 2 weeks later...
On 7/23/2021 at 2:47 PM, Y2KFirehawk said:

Any thoughts on the situation @Luke?

We are looking into it. Thanks.

  • Thanks 1
Link to comment
Share on other sites

As a test, if you disable hardware transcoding on the server, does that help?

Link to comment
Share on other sites

Y2KFirehawk
6 hours ago, Luke said:

As a test, if you disable hardware transcoding on the server, does that help?

Unfortunately the end result is the same. The only result is increased CPU load during recording and playback.

It's worth adding that Emby performed awesome from November 2019 till February 2021 when the audio lag started on some channels, live and recorded. The only changes during that time were 1) upgrades to Emby and OS 2) firmware upgrades to HDHR 3) recent nuclear reset of Emby environment

Link to comment
Share on other sites

On 7/28/2021 at 7:32 AM, Y2KFirehawk said:

Unfortunately the end result is the same. The only result is increased CPU load during recording and playback.

It's worth adding that Emby performed awesome from November 2019 till February 2021 when the audio lag started on some channels, live and recorded. The only changes during that time were 1) upgrades to Emby and OS 2) firmware upgrades to HDHR 3) recent nuclear reset of Emby environment

Can you please attach log file examples from that? Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
Y2KFirehawk
On 7/29/2021 at 8:46 AM, Luke said:

Can you please attach log file examples from that? Thanks.

Certainly! Sorry for the delay.

ffmpeg-directstream-82d4f2a4-699c-44d2-b402-4803807d3bbd_1 and ffmpeg-directstream-88e8158c-fcb8-4680-bfdc-df53f3bf923b_1 were with hardware acceleration enabled within transcoding. Audio was OK in the beginning but was separated by the time I stopped.

ffmpeg-directstream-5035c669-e228-4a6b-895b-dbe07bdee34d_1 was with hardware acceleration disabled within transcoding. Audio was OK in the beginning but was separated by the time I stopped.

embyserver1 was before making the hardware acceleration change

embyserver and hardware_detection-63763837307 were after making the hardware acceleration change

The above all noted as "direct play" likely because they were being watched "live" within the Emby dashboard, FWIW. I then unchecked the "Allow Video Stream Copy" within the Shileld/Android Emby client app Live TV settings and played a show for a bit...

No hardware transcoding; saw audio lag start around 15 minutes prior to stopping onward - ffmpeg-transcode-91b32be6-dd1e-4498-a1b4-465d0b95219c_1

Re-enabled hardware transcoding again, restated Emby. Same audio lag issues presented ~8 minutes prior to stopping onward - ffmpeg-transcode-b845744a-1a81-4c42-9b5d-7ce95f8c11de_1

 

ffmpeg-transcode-b845744a-1a81-4c42-9b5d-7ce95f8c11de_1.txt ffmpeg-transcode-91b32be6-dd1e-4498-a1b4-465d0b95219c_1.txt ffmpeg-directstream-5035c669-e228-4a6b-895b-dbe07bdee34d_1.txt embyserver.txt hardware_detection-63763837307.txt ffmpeg-directstream-88e8158c-fcb8-4680-bfdc-df53f3bf923b_1.txt ffmpeg-directstream-82d4f2a4-699c-44d2-b402-4803807d3bbd_1.txt embyserver1.txt

Link to comment
Share on other sites

  • 3 weeks later...
Y2KFirehawk

Have rebooted service since above and installed latest OS updates. Swapped back to NVIDIA Shield (2015) as primary device but still seeing the same conditions.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...
Y2KFirehawk

FWIW currently running 4.6.7.0 and overall performance seems to be better. That said, there are random times the behavior appears but overall improved. Will provide more data next time it occurs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...