Mailing List Archive

Kernel options, Preemption model and Timer frequency
I am chasing Audio/Video sync problems, and was wondering what are the
best kernel options for the BE server. Amongst the three preemption
models (CONFIG_PREEMPT_NONE, CONFIG_PREEMPT_VOLUNTARY, CONFIG_PREEMPT)
which is the best choice. Likewise for Timer Frequency ( CONFIG_HZ_100,
CONFIG_HZ_250, CONFIG_HZ_300 and CONFIG_HZ_1000), which is the best choice.

At the moment on the FE i am seeing errors like so during LiveTV,

2018-05-12 15:44:39.163391 N  Player(0): Waited 4177ms for video buffers
AAAAAAAAAAAUUUUUUUUUUUuLAAAAAAAP
2018-05-12 15:44:39.180607 I  Player(0): Video is 11438.3 frames behind
audio (too slow), dropping frame to catch up.
2018-05-12 15:44:39.180639 I  Player(0): Video is 20016.2 frames behind
audio (too slow), dropping frame to catch up.
2018-05-12 15:44:39.180649 I  Player(0): Waiting for video buffers...
2018-05-12 15:44:39.281204 N  Player(0): Waited 101ms for video buffers
AAAAAAAAAAAAAAUUUUUUUUUUuAAAAAAP
2018-05-12 15:44:39.321036 I  Player(0): Video is 26449.5 frames behind
audio (too slow), dropping frame to catch up.
2018-05-12 15:44:39.321056 I  Player(0): Waiting for video buffers...
2018-05-12 15:44:39.325482 I  Player(0): Video is 31274.3 frames behind
audio (too slow), dropping frame to catch up.
2018-05-12 15:44:39.325501 I  Player(0): Waiting for video buffers...
2018-05-12 15:44:39.344897 I  Player(0): Video is 29468.8 frames ahead
of audio,
                        doubling video frame interval to slow down.

Thanks

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
Hoi Rajil,

Saturday, May 12, 2018, 10:49:11 PM, you wrote:

> I am chasing Audio/Video sync problems, and was wondering what are the
> best kernel options for the BE server. Amongst the three preemption
> models (CONFIG_PREEMPT_NONE, CONFIG_PREEMPT_VOLUNTARY, CONFIG_PREEMPT)
> which is the best choice. Likewise for Timer Frequency ( CONFIG_HZ_100,
> CONFIG_HZ_250, CONFIG_HZ_300 and CONFIG_HZ_1000), which is the best choice.

> At the moment on the FE i am seeing errors like so during LiveTV,

> 2018-05-12 15:44:39.163391 N  Player(0): Waited 4177ms for video buffers
> AAAAAAAAAAAUUUUUUUUUUUuLAAAAAAAP
> 2018-05-12 15:44:39.180607 I  Player(0): Video is 11438.3 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.180639 I  Player(0): Video is 20016.2 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.180649 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.281204 N  Player(0): Waited 101ms for video buffers
> AAAAAAAAAAAAAAUUUUUUUUUUuAAAAAAP
> 2018-05-12 15:44:39.321036 I  Player(0): Video is 26449.5 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.321056 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.325482 I  Player(0): Video is 31274.3 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.325501 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.344897 I  Player(0): Video is 29468.8 frames ahead
> of audio,
>                         doubling video frame interval to slow down.

> Thanks

I infer that you have separate back and frontend. What are the specks,
- what else are they doing while you are watching?
- what else is going on on your network?
- how is the health statust of your drives?

Just a few questions to answer first


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
On 05/12/2018 04:01 PM, Hika van den Hoven wrote:

I infer that you have separate back and frontend. What are the specks,

- what else are they doing while you are watching?
- what else is going on on your network?
- how is the health statust of your drives?

Just a few questions to answer first



The backend is xeon server with 16GB memory with OS on SSD. The backend is
not much loaded (load average: 0.23, 0.21, 0.14). The frontend is a high
spec machine xeon machine as well with not much load (also on SSD). The
network is 1G between the machines.

One of the potential issues on the FE is that i am using a USB sound card
(0ccd:0028 TerraTec Electronic GmbH Aureon 5.1 MkII). I get the following
messages on startup,

2018-05-12 15:43:08.631560 I AOBase: Opening audio device
'default:CARD=Aureon51MkII' ch 2(2) sr 48000 sf signed 16 bit reenc 0
2018-05-12 15:43:08.635287 W ALSA: Requested 500000us got 341333 buffer
time
2018-05-12 15:43:08.635324 E ALSA: Error opening
/proc/asound/card1/pcm0p/sub0/prealloc. Fix reading permissions.
2018-05-12 15:43:08.637639 E ALSA: failed to register mixer device
/dev/mixer: No such file or directory

Myth is trying to do some preallocation, but i dont have this setting for
the USB sound card,

$ ls -la /proc/asound/card1/pcm0p/sub0/prealloc
ls: cannot access '/proc/asound/card1/pcm0p/sub0/prealloc': No such file or
directory

These issues may likely be due to FE setup, however I am still interested
in the best kernel options for the BE.
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
Hoi Rajil,

Saturday, May 12, 2018, 11:24:41 PM, you wrote:

> On 05/12/2018 04:01 PM, Hika van den Hoven wrote:

> I infer that you have separate back and frontend. What are the specks,
> - what else are they doing while you are watching?
> - what else is going on on your network?
> - how is the health statust of your drives?

> Just a few questions to answer first



>
> The backend is xeon server with 16GB memory with OS on SSD.
> The backend is not much loaded (load average: 0.23, 0.21, 0.14).
> The frontend is a high spec machine xeon machine as well with
> not much load (also on SSD). The network is 1G between the machines.
>
> One of the potential issues on the FE is that i am using a USB
> sound card (0ccd:0028 TerraTec Electronic GmbH Aureon 5.1 MkII).
> I get the following messages on startup,

> 2018-05-12 15:43:08.631560 I  AOBase: Opening audio device
> 'default:CARD=Aureon51MkII' ch 2(2) sr 48000 sf signed 16 bit reenc 0
> 2018-05-12 15:43:08.635287 W  ALSA: Requested 500000us got 341333 buffer time
> 2018-05-12 15:43:08.635324 E  ALSA: Error opening
> /proc/asound/card1/pcm0p/sub0/prealloc. Fix reading permissions.
> 2018-05-12 15:43:08.637639 E  ALSA: failed to register mixer device
> /dev/mixer: No such file or directory


> Myth is trying to do some preallocation, but i dont have this setting for the USB sound card,

> $ ls -la /proc/asound/card1/pcm0p/sub0/prealloc
> ls: cannot access '/proc/asound/card1/pcm0p/sub0/prealloc': No such file or directory



> These issues may likely be due to FE setup, however I am still
> interested in the best kernel options for the BE.
>

Is your user member of both the audio and the usb group?

For the backend I, as it is dedicated I would use default server
settings. Other choices are mostly aimed at a reactive desktop. So
No forced preemption and a low timer frequency.

Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
Hi Rajil,

Oh and kill X and only start it if needed.


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
On 05/12/2018 05:07 PM, Hika van den Hoven wrote:
>
> Is your user member of both the audio and the usb group?
Yes, it is. The USB sound actually doesnt expose that prealloc setting.
# tree /proc/asound/card1
/proc/asound/card1
??? id
??? oss_mixer
??? pcm0c
?   ??? info
?   ??? oss
?   ??? sub0
?       ??? hw_params
?       ??? info
?       ??? status
?       ??? sw_params
??? pcm0p
?   ??? info
?   ??? oss
?   ??? sub0
?       ??? hw_params
?       ??? info
?       ??? status
?       ??? sw_params
??? stream0
??? usbbus
??? usbid
??? usbmixer

4 directories, 18 files
> For the backend I, as it is dedicated I would use default server
> settings. Other choices are mostly aimed at a reactive desktop. So
> No forced preemption and a low timer frequency.
What about a dedicated combined BE/FE?
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
Hoi Rajil,

Sunday, May 13, 2018, 12:32:57 AM, you wrote:

> On 05/12/2018 05:07 PM, Hika van den Hoven wrote:
>>
>> Is your user member of both the audio and the usb group?
> Yes, it is. The USB sound actually doesnt expose that prealloc setting.
> # tree /proc/asound/card1
> /proc/asound/card1
> ??? id
> ??? oss_mixer
> ??? pcm0c
> ?   ??? info
> ?   ??? oss
> ?   ??? sub0
> ?       ??? hw_params
> ?       ??? info
> ?       ??? status
> ?       ??? sw_params
> ??? pcm0p
> ?   ??? info
> ?   ??? oss
> ?   ??? sub0
> ?       ??? hw_params
> ?       ??? info
> ?       ??? status
> ?       ??? sw_params
> ??? stream0
> ??? usbbus
> ??? usbid
> ??? usbmixer

> 4 directories, 18 files
>> For the backend I, as it is dedicated I would use default server
>> settings. Other choices are mostly aimed at a reactive desktop. So
>> No forced preemption and a low timer frequency.
> What about a dedicated combined BE/FE?
> _______________________________________________

It still mostly is a single purpose machine.

As said a lower timer frequency means that any running proces is less
interrupted, so runs slightly more efficient. A higher rate means
faster reactions to external interrupts, mostly from the user on the
desktop.

Forced preemption means that no matter what a process will be
interrupted to give time to other processes, which for a timing
sensitive process like recording can have a negative effect. However
it means that you as a user get a more reactive machine.

So I would choose intermediate timer frequency. Say 250/300 and keep
the "No forced preemption" in place. If you find the frontend to slow
in reaction, you can try "Voluntary preemption" or raise the
frequency.

Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
Hoi Rajil,

Oh and how is live-TV performing on the frontend on the backend. If
that performs OK the bottle-neck is very likely the network and or the
frontend.


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Kernel options, Preemption model and Timer frequency [ In reply to ]
On 05/12/2018 04:49 PM, Rajil Saraswat wrote:
> I am chasing Audio/Video sync problems, and was wondering what are the
> best kernel options for the BE server. Amongst the three preemption
> models (CONFIG_PREEMPT_NONE, CONFIG_PREEMPT_VOLUNTARY, CONFIG_PREEMPT)
> which is the best choice. Likewise for Timer Frequency ( CONFIG_HZ_100,
> CONFIG_HZ_250, CONFIG_HZ_300 and CONFIG_HZ_1000), which is the best choice.
>
> At the moment on the FE i am seeing errors like so during LiveTV,
>
> 2018-05-12 15:44:39.163391 N  Player(0): Waited 4177ms for video buffers
> AAAAAAAAAAAUUUUUUUUUUUuLAAAAAAAP
> 2018-05-12 15:44:39.180607 I  Player(0): Video is 11438.3 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.180639 I  Player(0): Video is 20016.2 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.180649 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.281204 N  Player(0): Waited 101ms for video buffers
> AAAAAAAAAAAAAAUUUUUUUUUUuAAAAAAP
> 2018-05-12 15:44:39.321036 I  Player(0): Video is 26449.5 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.321056 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.325482 I  Player(0): Video is 31274.3 frames behind
> audio (too slow), dropping frame to catch up.
> 2018-05-12 15:44:39.325501 I  Player(0): Waiting for video buffers...
> 2018-05-12 15:44:39.344897 I  Player(0): Video is 29468.8 frames ahead
> of audio,
>                         doubling video frame interval to slow down.
>
> Thanks
>
> _______________________________________________
>
It seems to be suffering from very slow decoding of video. Check your
playback profile and whether it can use hardware decoding for the type
of video. If it is a high end Frontend machine as you say, this should
not happen, even without hardware decoding. I suggest run top and see
what the cpu usage is, and if it is doing swapping.

Peter
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org