Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GStreamer to 1.0 #34

Merged
merged 26 commits into from
Aug 18, 2018
Merged

Conversation

jonty-comp
Copy link
Contributor

NOTE! I have no actual broadcast infrastructure to test this on, just my trusty ThinkPad with Debian and JACK. That being said, it seems to work fine on there.

I don't recommend pushing this as a new version until at least someone else has tested it!

@JamesHarrison
Copy link
Owner

This looks fantastic - I'll try and get this set up for testing but on the face of it it looks good. Many thanks for breathing new life into the thing!

@scottgrobinson
Copy link

Seem to have problems with just firing up the TX side. RX seems happy. I'll start debugging, but posting here in the hope it's something you've come accross!

@jonty-comp @JamesHarrison

pi@ob-ob:~/openob $ openob 10.0.1.192 studio ob1 tx 10.0.1.192 -a test
2018-07-09 16:06:57,311 - openob.link.ob1.config - INFO - Connecting to configuration host 10.0.1.192
2018-07-09 16:06:57,325 - openob.node.studio - INFO - Link ob1 initial setup start on studio
2018-07-09 16:06:57,327 - openob.node.studio.link.ob1 - INFO - Starting up transmitter
2018-07-09 16:06:57,328 - openob.node.studio.link.ob1.tx - INFO - Creating transmission pipeline
<openob.rtp.tx.RTPTransmitter object at 0x75ba05f0>
Scott
<gi.GstAudioTestSrc object at 0x75ba16e8 (GstAudioTestSrc at 0x25e6cd8)>
(<gi.GstAudioTestSrc object at 0x75ba16e8 (GstAudioTestSrc at 0x25e6cd8)>,)
2018-07-09 16:06:57,399 - openob.node.studio.link.ob1 - ERROR - Transmitter crashed for some reason! Restarting...
Traceback (most recent call last):
File "build/bdist.linux-armv7l/egg/openob/node.py", line 45, in run_link
transmitter = RTPTransmitter(self.node_name, link_config, audio_interface)
File "build/bdist.linux-armv7l/egg/openob/rtp/tx.py", line 21, in init
self.build_pipeline()
File "build/bdist.linux-armv7l/egg/openob/rtp/tx.py", line 52, in build_pipeline
self.source = self.build_audio_interface()
File "build/bdist.linux-armv7l/egg/openob/rtp/tx.py", line 102, in build_audio_interface
level.set_property('message', True)
AttributeError: 'NoneType' object has no attribute 'set_property'

@jonty-comp
Copy link
Contributor Author

It looks like your GStreamer install is missing the level element - I may have to add a pre-setup check for all the required elements. Do you have the gstreamer-plugins-good package installed? I'm slightly confused because that same plugin set contains pretty much all the other required plugins for OpenOB to function.
Could you paste the output of the gst-inspect -a command here please?

@scottgrobinson
Copy link

scottgrobinson commented Jul 9, 2018

Disregard - I was being really impatient and getting too excited about it possible working, Missing a few packages! "Full" instructions from a base linux image to up and running:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-setuptools git python-gst-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-tools python-gobject python-gobject-2 gstreamer1.0-alsa python-redis
git clone https://github.com/JamesHarrison/openob.git
cd openob
git fetch origin +refs/pull/34/merge
git checkout FETCH_HEAD
sudo python setup.py install

Can also confirm I can RX & TX correctly with this package using alsa. Having a few issues running two streams at once (RX & TX on both ends) but that's probably local audio config as both 'clients' are running correctly.

Thanks for this PR, much appreciated!

@jonty-comp
Copy link
Contributor Author

Cool - no worries, gstreamer is a tangled mess of history!
I believe you should only need gstreamer1.0-plugins-base and gstreamer1.0-plugins-good nowadays and not all the bad/ugly ones, but it can't hurt to have them. Opus encoder is even in base now, which is exciting!

@jonty-comp
Copy link
Contributor Author

As you can see from above, i'm whipping up a little Travis build to test the basic functionality - it doesn't really work yet, but i'll hopefully look at it some more tomorrow!

@JamesHarrison
Copy link
Owner

@jonty-comp I've added Travis to the project, so that should auto-build on future commits.

@scottgrobinson If you could provide some feedback on how this is working for you, that'd be great - once it's looking stable we can merge this into master and roll a new "proper" release.

@scottgrobinson
Copy link

@JamesHarrison Will do! I'll be testing over the next few days in the hope it works nicely for an event at beginning of August.

@jonty-comp
Copy link
Contributor Author

There we go - i've updated the packages required in the documentation, and tested on Dockerized versions of Debian Jessie, Stretch and Buster, and Ubuntu Trusty, Xenial and Bionic. This sounds like a lot of testing but it's very much not real-world - as I said, I don't have any audio equipment here!

Jessie & Trusty require gstreamer1.0-plugins-bad and apparently have a bug where the mono Opus test stream is decoded as stereo, but there's not much I can do about that bar backporting newer versions of gstreamer.

@scottgrobinson
Copy link

If I fire up a new Pi, what's the best way of testing this end to end for you? I assume I can't use pip yet until it's released? I could just follow the docs end to end and sub out 'sudo pip install OpenOB' for

git clone, switch to pr, python setup.py install?

@jonty-comp
Copy link
Contributor Author

jonty-comp commented Jul 10, 2018

That's probably the easiest path, yes. In the most recent versions of pip you can run pip install git+https://github.com/JamesHarrison/openob.git@refs/pull/34/merge directly, but it looks like that's not in my Buster version of pip yet, so I doubt it'll be anywhere else.

e: looks like you can do pip install git+https://github.com/jonty-comp/[email protected], which will install directly from the fork that this PR is against.

@scottgrobinson
Copy link

scottgrobinson commented Jul 12, 2018

Neither of the above commands worked:
pi@ob-studio:~ $ /usr/local/bin/openob 10.0.1.192 studio ob1 rx -a alsa -d hw:1
-bash: /usr/local/bin/openob: No such file or directory

I had to checkout and run it as per previous comment. It's still referencing 3.1 as opposed to 4.0dev when building from git though.

Now having problems running without sudo so I'll start this over again.

Collecting git+https://github.com/jonty-comp/[email protected]
Cloning https://github.com/jonty-comp/openob.git (to gst1.0) to /tmp/pip-hwqvxA-build
Installing collected packages: OpenOB
Running setup.py install for OpenOB ... done
Successfully installed OpenOB-3.1.0

@jonty-comp
Copy link
Contributor Author

That's bizarre...I don't know enough about pip to make any assumptions.

...oh wait, I just noticed that setup.py still references it as version 3.1.0, that'll be why! You should still be getting the latest code.

@scottgrobinson
Copy link

scottgrobinson commented Jul 19, 2018

Maybe I was just too tired... Worked fine this time!

sudo apt install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gir1.2-gstreamer-1.0 python-gst-1.0 python-redis python-gi python-setuptools git redis-server python-pip
sudo sed -i.bak 's/bind 127.*/bind 0.0.0.0/' /etc/redis/redis.conf && sudo service redis-server restart
sudo pip install git+https://github.com/jonty-comp/[email protected]

I've tested alsa RX and TX, anything else that would want testing before a merge?

EDIT: I forgot. To get alsa working I needed some extra packages. Not sure if it's just the alsa package or all of the below as I just ran this to be on the safe side:
sudo apt-get install git python-gst-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-tools python-gobject python-gobject-2 gstreamer1.0-alsa python-redis

@jonty-comp
Copy link
Contributor Author

Ah right, gstreamer officially lists alsa as being in the base package but I guess debian/ubuntu splits it out. Bizarre, as it seems jack is in the main package!
I think if you could just continue to test it in your normal use-case, we can confirm that the stability hasn't been affected by the way I refactored the pipeline.

@LyonelB
Copy link

LyonelB commented Aug 16, 2018

It's works !
With two Raspberry Pi ( 1 RPi 3 B & 1 RPi 3 B+) :
$ sudo apt-get install python-gst-1.0 gstreamer1.0-plugins-ugly gstreamer1.0-tools python-gobject python-redis redis-server
$ sudo sed -i.bak 's/bind 127.*/bind 0.0.0.0/' /etc/redis/redis.conf && sudo service redis-server restart
$ sudo pip install git+https://github.com/jonty-comp/[email protected]

@scottgrobinson
Copy link

scottgrobinson commented Aug 16, 2018

FYI - Latest release is fully working and used in a 'production' environment successfully.

Both ends ran a TX & RX for two way (Only got the commands from studio end, OB end is somewhere in the field...)

RX: /usr/local/bin/openob 10.100.40.53 studio ob1 rx -a alsa -d hw:0
TX: /usr/local/bin/openob 10.100.40.53 studio ob2 tx 10.100.40.77 -a alsa -d hw:1 -p 3002

RX using RapsberryPi onboard
TX using Behringer UCA202

@JamesHarrison
Copy link
Owner

Alright - I'm inclined to merge this into the master branch and cut a new release on PyPi as a new major version, given the positive feedback thus far. Any objections, shout, but if not I'll cut it in a day or two.

@jonty-comp
Copy link
Contributor Author

Fine by me! I did some random work on another branch off this based on the daemon idea we discussed years ago, but I haven't finished it yet. Hopefully I'll get a chance to pick it up again sometime soon.

@whohoho
Copy link

whohoho commented Aug 18, 2018

This branch seems to work fine.

I put some patches in the issues to have the help display all options, and 1 to have jack autoconnect (portpattern). Should i submit these as a pull request?

#36

#35

@JamesHarrison JamesHarrison merged commit 94eeafd into JamesHarrison:master Aug 18, 2018
@JamesHarrison
Copy link
Owner

@whohoho Yes, absolutely!

@jonty-comp
Copy link
Contributor Author

Woo! Hopefully everyone can enjoy the new version without having to juggle old dependencies.

Just a quickie, I noticed setup.py and the documentation still reference old versions.

@jonty-comp jonty-comp deleted the gst1.0 branch August 18, 2018 18:42
@JamesHarrison
Copy link
Owner

@jonty-comp I'm planning to scrap the gh-pages docs and just stick the relevant bits in the wiki in GitHub, tbh. setup.py I'd just forgotten to commit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants