[Bug 785937] alsasrc timestamps is sensitive to context switches.
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Mon Aug 7 11:16:42 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=785937
--- Comment #2 from Göran Jönsson <goran.jonsson at axis.com> ---
If I run Ftrace with attached Instrumentation I got.
...
irq/79-SSI-RX-3150 [003] .... 568.856203: snd_pcm_period_elapsed: Hello 1
irq/79-SSI-RX-3150 [003] d..2 568.856251: update_audio_tstamp: Hello 2 1
irq/79-SSI-RX-3150 [003] d..2 568.856261: update_audio_tstamp: Hello 3
568.829260520
irq/79-SSI-RX-3150 [003] d..2 568.856266: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.856464: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856475: update_audio_tstamp: Hello 3
568.829483940
alsasrc7:src-3151 [002] d..2 568.856480: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.856637: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856642: update_audio_tstamp: Hello 3
568.829662690
alsasrc7:src-3151 [002] d..2 568.856653: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.856675: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856680: update_audio_tstamp: Hello 3
568.829700740
alsasrc7:src-3151 [002] d..2 568.856685: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.856743: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856749: update_audio_tstamp: Hello 3
568.829768200
alsasrc7:src-3151 [002] d..2 568.856754: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] ...1 568.856818: tracing_mark_write: USER_SPACE
Hello 2
alsasrc7:src-3151 [002] ...1 568.856858: tracing_mark_write: USER_SPACE
Hello 3
alsasrc7:src-3151 [002] d..2 568.856886: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856892: update_audio_tstamp: Hello 3
568.829910820
alsasrc7:src-3151 [002] d..2 568.856897: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.856919: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.856924: update_audio_tstamp: Hello 3
568.829944705
alsasrc7:src-3151 [002] d..2 568.856928: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] ...1 568.856950: tracing_mark_write: USER_SPACE
Hello 4
alsasrc7:src-3151 [002] ...1 568.857632: tracing_mark_write: USER_SPACE
Hello 1
alsasrc7:src-3151 [002] d..2 568.857812: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.857829: update_audio_tstamp: Hello 3
568.830811315
alsasrc7:src-3151 [002] d..2 568.857836: update_audio_tstamp: Hello 3.1
9.088000000
alsasrc7:src-3151 [002] d..2 568.857878: update_audio_tstamp: Hello 2 1
alsasrc7:src-3151 [002] d..2 568.857885: update_audio_tstamp: Hello 3
568.830901195
alsasrc7:src-3151 [002] d..2 568.857890: update_audio_tstamp: Hello 3.1
9.088000000
...
With this trace we can see that the IRQ is updating the tstamp and audio stamp.
We can also se that snd_pcm_readi and snd_pcm_status_get_state also updating
the tstamp . So if a context switch occur the time stamp will not be as when
the interrupt occur . Also notice this is not true for audio timestamp.
Please find attached patch that uses audio stamp instead of tstamp.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list