Jump to content


Photo

GStreamer 1.0

gstreamer 1.0 openpli

  • Please log in to reply
2520 replies to this topic

Re: GStreamer 1.0 #1481 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 3 July 2015 - 01:20

great work chris :)



Re: GStreamer 1.0 #1482 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 3 July 2015 - 08:44

I investigated further.

 

Normally on kernels 3.2 the cdrom link is made (in function off device capacity) by udev rules

 

In a stb we do not have udev. p.s. yes there is a folder in etc called udev with rules in for fuse, That has nothing to do with udev self.

 

What's the best  :

1) Making a deamon which runs after kernels devices are loaded (sr is a kernel module)

    This deamon will then create a link called cdrom to sr0 in /dev map if sr0 exists ?

 

2) Is there a better way in a stb which lacks the normally standard used udev (in most linux distro's) ?



Re: GStreamer 1.0 #1483 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 3 July 2015 - 10:59

Create an mdev rule instead (we use mdev instead of udev) or perhaps a helper tool which monitors medium insertion/removal.

I seem to remember I once wrote and added an mdev helper which does just this.
Perhaps it got removed from the image, in one of the major image updates

Re: GStreamer 1.0 #1484 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 3 July 2015 - 13:41

I checked then I think best is to do it via enigma2/python/Plugins/SystemPlugins/Hotplug

 

That one is used to mount the media tracks per track.



Re: GStreamer 1.0 #1485 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 3 July 2015 - 14:35

here it is:

http://sourceforge.n...r/tree/bdpoll.c

(turns out I didn't write it)

activated by the mdev rule:
sr0 0:0 664 */usr/bin/bdpoll sr0 -c

(in /etc/mdev/mdev.conf)

Re: GStreamer 1.0 #1486 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 3 July 2015 - 15:16

Yes I found that one already before and its installed by standard.

 

I will try if :

symlink(name1, name2)

Works also for devices.

unistd.h is included .


Re: GStreamer 1.0 #1487 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 3 July 2015 - 16:41

This is working with bdpoll.c modified to :

 

Now just make it better at this time it's just a brute code line whitout any protection and name 1 must become the var instead off fix name.

		case CDS_DISC_OK:
			/* some CD-ROMs report CDS_DISK_OK even with an open
			 * tray; if media check has the same value two times in
			 * a row then this seems to be the case and we must not
			 * report that there is a media in it. */
			if (support_media_changed &&
			    ioctl(fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT) &&
			    ioctl(fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT)) {
			} else {
				got_media = true;
				/*
				 * this is a bit of a hack; because we mount the cdrom, the eject button
				 * would not work, so we would never detect 'medium removed', and
				 * never umount the cdrom.
				 * So we unlock the door
				 */
				ioctl(fd, CDROM_LOCKDOOR, 0);
			}
			// just as test the brute form 
			symlink ("/dev/sr0", "/dev/cdrom");
			break;


Re: GStreamer 1.0 #1488 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 4 July 2015 - 11:28

Here the patch off hotplug-e2-helper for the audiocd case with gstreamer-1.0

 

 

Attached Files



Re: GStreamer 1.0 #1489 Beeker

  • PLi® Contributor
  • 1,602 posts

+203
Excellent

Posted 5 July 2015 - 18:44

It seems like that audio CD only works with libcdio 0.93 when removing cdfs from box.

With libcdio 0.82 CD does nothing at all anymore after removing cdfs in my case.

Patch cd-romlink is installed.

When upgrading libcdio in openpli-oe-core/meta-openembedded/meta-oe/recipes-multimedia/libcdio als a patch for cdtextinfo is required.

http://git.opendream...66a124f7ce94d34

When build. remove libcdio12 from box(due to not upgradable).

After that do.

opkg install gstreamer1.0-plugins-ugly-cdio --force-reinstall

This installs also libcdio16(0.93).

and

opkg install cdtextinfo --force-reinstall.

Now playing audio CD without cdfs.
 

Attached Files


Edited by Beeker, 5 July 2015 - 18:48.

Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: GStreamer 1.0 #1490 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 6 July 2015 - 07:01

Well what I just did here was a fresh build with everything standard like it is now in the gst-1  git.

 

I just aplied the cdrom-link.patch to hotplug-e2-helper.

 

Box freshly reflashed and cd-rom plays fine with all cdtextinfo avbl. Cdrom is mounted using cdfs.

 

A  note :

 

Just after cd insertion and You preshed ok by play cd,

cd starts playing and audio stops shortly after a whyle cd continus to play. If pause unpause or just select next song audio back.

This has nothing to to with gstreamer,mediasink,libcdio or driver . It is a basic sequencing error.

This sequencing error is also one off (most probably the one and only one) cause off all sync issues.

 

What is happening ?

After that the dvbmediasink's are passed from paused to playing, Enigma two is still in ready or paused state. The media starts playing fine and all in sync (audio,video,sub).

After that enigma2 passes to playing state audio stops playing.

 

This issue is for all media using servicemp3 by vuduo2 and dm8000 I gues it will be for all stb's.

 

I can solve it with an independent timer in the medisink's which just delays the effectif start off rendering till enigma2 passed to play state(+ 1 second) then no issues anymore.

I do not like such a hack with timers I'm trying to find a way so that enigma sends a event or message to all the syncs the moment it is passed from paused to playing and is really ok. Enigma2 is really ok after that it is passed from paused to playing + +- 500 ms.



Re: GStreamer 1.0 #1491 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 6 July 2015 - 07:09

p.s. It's indeed a good thing to upgrade libcdio that will be the best the day we are passing from gst-0.10 to gst-1.0 image. Also it will avoid the need off cdfs , and auto detect off file system will be used to mount the media.



Re: GStreamer 1.0 #1492 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 6 July 2015 - 09:27

@pieterg @littlesat

 

Well extensif testing showed that indeed this to early rendering from mediasinks is the cause from all the sync issues and others .....

 

What I did for testing now is :

 

I added to servicemp3.cpp the use off a servicemp3_state file located in /tmp directory.

 

code added to servicemp3.cpp

			switch(transition)
			{
				case GST_STATE_CHANGE_NULL_TO_READY:
				{
					sf = fopen("/tmp/servicemp3_state", "w");
					if (sf)
					{
						fprintf(sf,"READY\n");
						fclose(sf);
					}
				}	break;

/* a bit further * by ready to paused at the end */
					setAC3Delay(ac3_delay);
					setPCMDelay(pcm_delay);
					if(!m_cuesheet_loaded) /* cuesheet CVR */
						loadCuesheet();
					sf = fopen("/tmp/servicemp3_state", "w");
					if (sf)
					{
						fprintf(sf,"PAUSED\n");
						fclose(sf);
					}
				}	break;


/* by paused to playing */

					else
					{
						m_event((iPlayableService*)this, evGstreamerPlayStarted);
						sf = fopen("/tmp/servicemp3_state", "w");
						if (sf)
						{
							fprintf(sf,"PLAYING\n");
							fclose(sf);
						}
					}
				}	break;

/ * by playing to paused I setted the file back to paused */

/ * By service destruct I set the state file to NONE */

I added the #include <stdio.h> (file suport).

By the mediasinks audio and video , I added.

 

By state changing paused to playing if the servicemp3_state file is not NONE (that's to allow playing whitout enigma2 with gst_launch utility for testing)

 

self->playing = FALSE

self->paused = TRUE

and the dvbsink's are not launched yet (disabled the ioctl ... xxx_CONTINUE.)

 

By section rendering. I blocked the start off rendering until enigma2 passed from paused to playing.

 

Once enigma2 servicemp3 is in playing state :

the ioctl ..... xxxx_CONTINUE

self->playing = TRUE

self->paused = FALSE

 

All problems solved everything starts in sequence and in sync :)

 

code in sink's they are applied to video and audio same thing. This made them start exectly togheter on the correct segment.

(p.s. disregard the now code present about first paused , that must be removed since problem is there also when going to pause and back to play) that's the next step to come ..

static GstFlowReturn gst_dvbaudiosink_render(GstBaseSink *sink, GstBuffer *buffer)
{
	GstDVBAudioSink *self = GST_DVBAUDIOSINK(sink);
	GstBuffer *disposebuffer = NULL;
	GstFlowReturn retval = GST_FLOW_OK;
	GstClockTime duration = GST_BUFFER_DURATION(buffer);
	gsize buffersize;
	buffersize = gst_buffer_get_size(buffer);
	GstClockTime timestamp = GST_BUFFER_PTS(buffer);
	gint i = 0;

/*** wait on enigma2 to be ready before rendering after unpause **/
	if (!get_servicemp3_state_none() && self->first_paused)
	{
		while (!get_servicemp3_state_playing() && i < 20000)
		{
			i++;
		}
		if (self->fd >= 0) {ioctl(self->fd, AUDIO_CONTINUE);}
		if(self->first_paused) {self->first_paused = FALSE;}
		self->paused = FALSE;
		self->playing = TRUE;
	}
	if (i > 0)
	{
		GST_INFO_OBJECT(self,"PLAY AFTER UNPAUSED ENIGMA cycles %d", i);
		i = 0;
	}

video sink

static GstFlowReturn gst_dvbvideosink_render(GstBaseSink *sink, GstBuffer *buffer)
{
	GstDVBVideoSink *self = GST_DVBVIDEOSINK(sink);
	guint8 *pes_header;
	gsize pes_header_len = 0;
	gsize data_len;
	guint8 *data, *original_data;
	guint8 *codec_data = NULL;
	gsize codec_data_size = 0;
	gsize payload_len = 0;
	GstBuffer *tmpbuf = NULL;
	GstFlowReturn ret = GST_FLOW_OK;

	if (self->fd < 0)
	{
		return GST_FLOW_OK;
	}
	gint i = 0;

/*** wait on enigma2 to be ready before rendering after unpause **/
	if (!get_servicemp3_state_none() && self->first_paused)
	{
		while (!get_servicemp3_state_playing() && i < 20000)
		{
			i++;
		}
		if (self->fd >= 0) {ioctl(self->fd, VIDEO_CONTINUE);}
		if(self->first_paused) {self->first_paused = FALSE;}
		self->paused = FALSE;
		self->playing = TRUE;
	}
	if (i > 0)
	{
		GST_INFO_OBJECT(self,"PLAY AFTER UNPAUSED ENIGMA cycles %d", i);
		i = 0;
	}

The function get_servicemp3_state_xxxx() are in common now

gboolean get_servicemp3_state_none()
{
	gboolean ret = FALSE;
	FILE *f;
	char buffer[10] = {0};
	f = fopen("/tmp/servicemp3_state", "r");
	if (f)
	{
		fread(buffer, sizeof(buffer), 1, f);
		fclose(f);
	}
	ret = !strncmp(buffer, "NONE", 4);
	return ret;
}

gboolean get_servicemp3_state_playing()
{
	gboolean ret = FALSE;
	FILE *f;
	char buffer[10] = {0};
	f = fopen("/tmp/servicemp3_state", "r");
	if (f)
	{
		fread(buffer, sizeof(buffer), 1, f);
		fclose(f);
	}
	ret = !strncmp(buffer, "PLAYING", 7);
	return ret;
}

gboolean get_servicemp3_state_ready()
{
	gboolean ret = FALSE;
	FILE *f;
	char buffer[10] = {0};
	f = fopen("/tmp/servicemp3_state", "r");
	if (f)
	{
		fread(buffer, sizeof(buffer), 1, f);
		fclose(f);
	}
	ret = !strncmp(buffer, "READY", 5);
	return ret;
}

gboolean get_servicemp3_state_paused()
{
	gboolean ret = FALSE;
	FILE *f;
	char buffer[10] = {0};
	f = fopen("/tmp/servicemp3_state", "r");
	if (f)
	{
		fread(buffer, sizeof(buffer), 1, f);
		fclose(f);
	}
	ret = !strncmp(buffer, "PAUSED", 6);
	return ret;
}

I tried to find a better way but could not find one. then the use of such servicemp3_state file would i'm shure there must be a better way then that but a can't find out how.

 

When You start playing now we have this :

<162420.425602> [eServiceMP3] state transition PAUSED -> PLAYING
0:11:45.478334123 23245 0x74523550 INFO            dvbaudiosink gstdvbaudiosink.c:1228:gst_dvbaudiosink_render:<dvbaudiosink11> PLAY AFTER UNPAUSED ENIGMA cycles 3519
0:11:45.485103050 23245 0x74523600 INFO            dvbvideosink gstdvbvideosink.c:739:gst_dvbvideosink_render:<dvbvideosink3> PLAY AFTER UNPAUSED ENIGMA cycles 3591

If rendering only starts after enigma2 is in playing state all ok. If rendering starts before problems all over.



Re: GStreamer 1.0 #1493 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 7 July 2015 - 15:55

Here the enigma2 patches with implementation off temporary enigma2 servicemp3 file . It's for gst-1.5.1.

 

Here again the complete list off patches to apply to enigma in the order.

 

This needs to be used togheter with :

 

https://github.com/c...ee/experimental

 

It works good on vuduo2 and dm8000

 

The order is first subtitle then 01 02 03

Attached Files


Edited by christophecvr, 7 July 2015 - 15:56.


Re: GStreamer 1.0 #1494 cobus

  • Senior Member
  • 4,774 posts

+69
Good

Posted 7 July 2015 - 16:58

Nice work thanks when is it ready for Openpli

Groetjes Cobus R

 

VU+ UNO 4K SE FBC DVB-C (8x)

MUTANT HD66SE FBC DVB-C (3x)

MAXYTEC MULTIBOX COMBO

MUTANT HD60 DVB-S

 

 

Ziggo (digitaal) Kabel TV (FTV) op alle decoders met oa fallback tuner

 


Re: GStreamer 1.0 #1495 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 8 July 2015 - 13:18

After all the use off the thp file was not really the best solution disrgard the previous patch 3.

 

It is changed again also the sink's. But now it's pretty stable .

 

The only issue still with first lunch off cdrom which starts playing and then stops. There must to have this ok works on MediaPlayer and also we need's better also update upgrade the libcdiso. and ...

 

For gst-1.5.1:

 

If You now apply when building image.

 

The patch 01 and 02 posted before (enigma). You have the chapter support by mkv media. If the media does not have chapter support then You can set manual cuts.

For cdrom support apply patch cdrom-link.patch to hotplug-e2-helper.

 

Further the :

https://github.com/c.../commits/master

Is now pretty stable.

 

Tested on vuduo2 and dm8000.



Re: GStreamer 1.0 #1496 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 8 July 2015 - 14:56

@Beeker,

 

Just for info, Before I start an eventual modification off MediaPlayer (to improve).

 

I obviousely first will upgrade to libcdio 0.93. 0.83 is three years old and that's to much.

 

First a question , did You applied the cdrom-link.patch to hotplug-e2-helper ?



Re: GStreamer 1.0 #1497 Beeker

  • PLi® Contributor
  • 1,602 posts

+203
Excellent

Posted 8 July 2015 - 16:39


 

First a question , did You applied the cdrom-link.patch to hotplug-e2-helper ?

 

Yes i did. I flash the box and the symlink was present by default.

 

Removing cdfs simply with opkg remove.I have done nothing with cdfs in the build-envorinment.That will be the next step.

 

Libcdio 093 and cdparanoia installed.

 

This is what i have in enigma2.bbappend.

 

ENIGMA2_BRANCH ?= "master"
SRC_URI = "git://git.code.sf.net/p/openpli/enigma2;protocol=git;branch=${ENIGMA2_BRANCH} \
file://0001-dvb-decoder.cpp-workaround-for-Dreamboxes-DD.patch \
file://0002-Revert-HDMI-in.patch \
file://0003-disablesubtitleshack.patch \
file://0004-enigma2-serviceMP3-cuesheet.patch \
file://0005-enigma2-serviceMP3-chapters-support.patch \
file://0006-enigma2-serviceMP3-state-file.patch "

 

Patch 1 and 2 are patching dvbdecoder.cpp, so that has nothing to do with it.

 

Yesterday i play a CD and it stops after 10-20 minutes,like you said. After 30-40 seconds audio was back but player plays the CD about 1.5-2.5 times faster.

 

Now i try again with latest multibox from your git and without enigma2-serviceMP3-state-file.patch.


Edited by Beeker, 8 July 2015 - 16:41.

Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: GStreamer 1.0 #1498 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 8 July 2015 - 16:53

Note patch 01 and patch 02 have nothing to do with cd but also not with decoder.cpp those are just cue sheet and chapter support chapter supports works for mkv container movies.

 

There is well still somethings with MediaPLayer self. Now just launched a test to see iff cd stays playing.



Re: GStreamer 1.0 #1499 Beeker

  • PLi® Contributor
  • 1,602 posts

+203
Excellent

Posted 8 July 2015 - 17:42

A few breaks.Audio lost for about 0.5 second.But still playing.Further than ever.


Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: GStreamer 1.0 #1500 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 8 July 2015 - 17:57

The trick to let play it well = :

 

(best have a fresh reboot after you experimented a lot.)

 

Then insert cd.

 

When menu shows up push play cd.

 

That above You know off course.

 

But once the cd is playing. (or just started to play and then stopped) navigate to track two press ok. Once the song is playing well, navigate back to track one. Then press ok cd will play nicely whitout any interuption.

Pause unpause ok and navigating trough tracks ok.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users