Page 1 of 1

audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 6:29 am
by txutxe
hi,

i don't know if this is related to dvb-t or just audio/video playback.

i've got a dvb-t usb pen and i can watch life tv without problem. I bought the mpeg and vc1 codecs and I managed to watch tv almost out of the box.

my problem now is that some channels suffer from a small delay in audio playback.

from all channels i've got tunned, i've seen that some show a Mpeg-2 Audio symbol on the left hand side of the screen and other don't. Some, I think, show something like Dolby Audio and others show nothing.

Those showing mpeg-2 Audio, I guess that thanks to the codec I bought, are syncronized perfectly, but the rest, sometimes are not.

Does anyone have any idea why this may be hapenning?

I though that may be the processor was not fast enough or rasp didn't have enough memory. I tried overcloking my rasp to 900mhz but it didn't help, it still happens with the same channels.

just let me know if for now this is normal or I can do anything to fix it. May be there's another codec? I onfly found two in the Buy Codecs section.

Thanks.

Re: audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 10:06 am
by macey
txutxe wrote:.................i've seen that some show a Mpeg-2 Audio symbol on the left hand side of the screen........................
Sorry, can't help you with your sinc problem other than advise to use vlc when viewing, gives audio delay + or minus controls. I am interested in where
you see the Mpeg-2 audio symbol. I have a license key (validated install) and
I have never seen that symbol. What player are you using? I use oxmplayer,
vlc and mplayer. I also stream over internet using TVHeadEnd (play remotely using VLC) and never see that symbol. Concerned that I may not be taking advantage of hardware decoding.. :? :?

Re: audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 12:53 pm
by txutxe
hi,

i think there's a crossed question/answer here, let's hope someone clarifies this topic for both of us. :mrgreen:

i see this symbol on xbmc. Any video you watch, avi file or live tv, xbmc shows you some tags or symbols with the media format. Those with this symbol work like a charm while others, sometimes, suffer from some delay. The same channel, at different moments of the same day, may behave differently :?:

i haven't tried waching over vlc, as i'm using xbmc base distros like openlec or raspbmc, they don't have anything else than xbmc.
however, i did try with raspbian and archlinux and video playback was really bad. Then I read that xbmc is the only software that uses hardware emulation, while vlc and others don't, so I switched to xbmc for the only player I use.
Actually, not even live tv, but watching avi files in vlc or mplayer was really bad.

so... can someone say if I should use raspbian + tvheadend + vlc to watch dvb-t on my rasp? I mean using vlc from the very same rasp where tvheadend is running.
Is it any better than using tvheadend + xbmc?

Thanks.

Re: audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 1:21 pm
by macey
so... can someone say if I should use raspbian + tvheadend + vlc to watch dvb-t on my rasp? I mean using vlc from the very same rasp where tvheadend is running.
Is it any better than using tvheadend + xbmc?
I use oxmplayer with tvheadend on same rasp & vlc (still to tvheadend)
when remote. Can then use standard raspbian. Why use non 'standard'
build? My setup works just great. :D :D

Re: audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 4:41 pm
by txutxe
great!

thanks. well, then... I guess I'll try to use raspbian + tvheadend + omxplayer on the raspberry to watch live TV.

I'm curious to see if I still have the same problem with synchronization. I like xbmc, but this issue is a little bit annoying after a while.

I'll try playing TV the way you suggest and report back.

Sorry I cannot help you with you question, but I guess you can try one easy thing: disabling the MPEG codec in /boot/config.txt. Are you watching some video you are sure it is mpeg? If you remove the license you won't be able to watch it, just hear the audio channel, but not the video. I experimented this while setting tv on my rasp. In that precise moment I found out I had to buy the codec.

Re: audo/video sync in dvb-t

Posted: Wed Jul 03, 2013 9:37 pm
by itsonlyme
If you are still using XBMC try disabling the "I have a dolby capable receiver " option (or something similar - not by XBMC at the moment). I found this reduced the problem. Then try pause/resume if it recurs to a lesser extent.

Malcolm

Re: audo/video sync in dvb-t

Posted: Thu Jul 04, 2013 6:47 am
by linuxstb
Bit of a shameless plug:

https://github.com/linuxstb/pidvbip/

This is my tvheadend client for the Pi. It's still under development, and is a bit rough around the edges, but is working well for watching live TV, and I haven't noticed any A/V sync issues, with any audio codec.

Re: audo/video sync in dvb-t

Posted: Thu Jul 04, 2013 6:42 pm
by txutxe
macey wrote: I use oxmplayer with tvheadend on same rasp & vlc (still to tvheadend)
I've tried with raspbian 062013 build + tvheadend + oxmplayer and video won't show. Do you call oxmplayer with any special option? Could you please post the command you are using?
itsonlyme wrote: If you are still using XBMC try disabling the "I have a Dolby capable receiver " option
yes, there's an option similar to that but i can't check/uncheck it in my case. I forgot to say that I'm not using hdmi, but rca and scart. I don't expect high quality pictures, I know what rca is capable of, but It would be nice that there was no audio delay.
What i did find is an option in the configuration/video settings about sync video/audio:

A/V sync method [Audio Clock, Video Clock(resample audio) or Video Clock(Drop/Dupe Audio)]

for those channels using Mpeg audio I have to use Audio Clock to keep video and audio together, while for dolby I have to use resample audio. but even so, dolby channels get apart after a while.

can this be fixed somehow? I offer myself to do some testing of newer versions if necessary.

as for the pause/play option... well, it's live tv, I can't pause it, at least in my setup. I can only stop it and choose a new channel from the list. Avi videos work like a charm.
thanks for letting me know about it.

I've tried from raspbian and it doesn't work very well in my case. Again, I offer myself to do some testing, so if you are interested send me a pm and I can tell you what problems I've faced

Re: audo/video sync in dvb-t

Posted: Thu Jul 04, 2013 7:06 pm
by macey
txutxe wrote:
macey wrote: I use oxmplayer with tvheadend on same rasp & vlc (still to tvheadend)
I've tried with raspbian 062013 build + tvheadend + oxmplayer and video won't show. Do you call oxmplayer with any special option? Could you please post the command you are using?
omxplayer -r -o hdmi http://userid:password@localhost:9981/s ... $channelid"
For live TV, obviously, I pass $channelid.

Re: audo/video sync in dvb-t

Posted: Tue Jul 09, 2013 2:48 pm
by txutxe
Hi,

ok, I've spent some hours over the weekend on this problem and, just in case anyone is interested, I want to share with you my trials and later conclusions. (Just let me know If I'm terribly mistaken about something)

I've got two raspberries, ver B, 512MB, both made in the UK. Even though they say that such things as overcloking may perform differently in different units, the out of sync problem I'm facing is exactly the same in both of them. (By the way, I've tried overclocking up to 900mhz and the problem still persists)
I've also used different SD cards, of 2, 4 and 8GB, all Class 4.

I've done all my testing with 2 old tvs via rca or scart input, it doesn't matter which tv I use either, the result is the same.

I've tried installing Raspbmc, Xbian, Openlec, Raspbian and ArchLinux. I can't say that all give me the same result, but quite.

The thing is that, generally speaking, I can play files stored via NFS just fine: mp3, mp4, mpeg, avi, etc. I don't watch HD films or anything with DTS or similar quality. I don't care so much about audio/video quality (as long as it is in sync) and it wouldn't make any difference in my old tv anyway.

However, live tv doesn't work smoothly. I've tried with both VDR and TVheadend as a backend, and the results are very similar.
Some OSs seem to work better than others, but the thing is that MPEG2-audio streaming plays just fine, although sometimes, after a long period of time, (2 hours or so) it progressively gets out of sync.

The problem is that some tv channels broadcast in DTS and raspberry is not quite fit yet for this.
There are quite a few pots in this forum and others about DTS license for raspberry and emulation through software. For now there's no way to get the approval from DTS to issue those licenses, so the community is looking for other ways.
In my case... do you think it would help fixing the delay?

There's even the option to passthrough the audio, untouched, to the hdmi tv, which will process the audio.
As I'm using and old tv, I can't use the passthrough option unless I buy an hdmi to scart convertor which costs twice as much as the raspberry itself and as big. Still, I haven't read anyone with this setup, so I don't know if that would even work.

I've played with 2.0, 5.1, etc, audio option in Xbmc, also with downmix and "Sync playback to display" (I've tried the three options several times).

The delay in DTS is noticeable right from the start, no matter how many times I stop/start the channel, and it gets bigger and bigger over time. I've googled to check if these channels broadcast audio in different formats, but it doesn't seem to be the case. If I watch tv from a "proper" dtt box, it only shows one audio channel.

so... after trying everything I could think of, I would like you to tell me if there's a way to watch "almost-live" tv. I mean, It would be interesting that when I tune to a channel, this somehow caches the stream and then plays it synced. I don't mind the channel not showing until 5 seconds later. Obviously, every time I switched to a new channel I would have to wait for another 5 seconds. I'd rather wait than keep watching tv out of sync.

macey wrote: omxplayer -r -o hdmi http://userid:password@localhost:9981/s ... $channelid"
For live TV, obviously, I pass $channelid.
macey, thanks for your replay. I was already using omxplayer like this, but it didn't work. I guess that with all the things I compiled and changed, something got messed up. In a new raspbian installation I made, it started working.


thanks.

Re: audo/video sync in dvb-t

Posted: Wed Jul 10, 2013 7:45 am
by linuxstb
Hi txutxe,

Are you sure your TV channels are using DTS, and not AC-3 (or EAC-3) ? AC-3 audio is very common, but I'm not aware of any broadcasters using DTS, and would be extremely surprised if anyone was using it for SD TV. Where in the world are you?

Have you tried running "top" on your Pi (e.g. via an ssh session) whilst omxplayer is playing? This will show you how busy the CPU is, and whether that is causing your issue.

Have you tried making a recording with tvheadend or vdr, and then playing back that recording with omxplayer?

Re: audo/video sync in dvb-t

Posted: Wed Jul 10, 2013 1:58 pm
by txutxe
hi linuxstb,

to be honest, I'm not an expert on video/audio formats. I've read a lot of posts and people indistinctly use aac, ac3, dts, dolby digital, ...

As I said earlier in this post, Xbmc shows me different symbols on the bottom left-hand corner (audio properties, SD/HD channels etc.). Some channels show MPEG2-Audio (these generally work fine) and some Dolby Digital. Channels with Dolby Digital have a delay right from the start, the audio comes at least 1 second after the video and the gap increases progressively over time.
What I can tell for sure is that I see the SD and Dolby Digital symbols at the same time, I don't have any HD channel tuned in tvheadend. I don't know if I can do a screenshot from raspbian or raspbmc, I'll try.

I've also looked through the logs and found nothing relevant, at least nothing that keeps appearing and would interfere with rasp's performance.

I haven't tried playing a downloaded file with ac3 to compare with dvb-t, but I've read many people complaining about having to transcode downloaded videos because they are experiencing the same problem with their raspberries.

I've tried running top and I even installed munin once. There's no process constantly using all the CPU or memory that would explain this problem.
I also tried over-clocking up to 900mhz and 500 for memory. Navigating through xbmc's menu was better, real smooth, but the problem with audio still persisted.

As there is no option to change audio channel to mpeg2 for those channels, I don't know what else I can try.

The only thing I can think of is running tvheadend on a different machine and running only xbmc on the raspberry. I'd rather not try that, because if I need two machines two watch TV... I prefer keeping my old computer with a pci dvb-t card. It's big and noisy, but it does the job.

thanks.

EDIT: ok, I did some research on DTS and Dolby, sorry for not doing that previously, but people seemed to use these two and other terms indistinctly. I see now that DTS has a much higher transfer rate. Anyway, I rechecked and I can see both symbols at the same time, SD and Dolby. I'll monitor my raspberry for a long time with xmbc on to see if there's a bottleneck somewhere.

Re: audo/video sync in dvb-t

Posted: Fri Jul 19, 2013 8:27 am
by txutxe
Hi,

I'm updating this thread to let you know that the problem appears to be solved.

I had two different problems and I've applied two different solutions.

On the one hand, no matter what OS I tried to install, Xbmc was painfully slow. I tried overclocking, but then I would get sd data corruption. So, I tried many values and I've got Xbmc running relatively well (and without corruption) with these values:

arm_freq 800
core_freq 400
sdram_freq 400

On the other hand, I had a delay in audio playback while watching live tv. I've fixed this by compiling both tvheadend a Xbmc from nightly builds.
Compiling only tvheadend (the easy one) and installing Xbmc from repository, I would still get some delay. By using latest versions of both, I can watch dvb-t with Mpeg-2 or Dolby Digital audio with no problem.

I installed everything on a Raspbian, latest version and firmware from 11th July 2013 compilation.

I hope this will be of any use to somebody.