JamesHarrison / openob

The Open Outside Broadcast project for radio contribution links and studio-transmitter links.
158 stars 34 forks source link

Help with setup: ALSA fails, -a auto results in mono and no audio #40

Closed Matzeee closed 5 years ago

Matzeee commented 5 years ago

I installed OpenOB on two Debian machines by:

sudo aptitude install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gir1.2-gstreamer-1.0 python3-gst-1.0 python3-redis python3-gi python3-setuptools

sudo aptitude install redis-server
sudo sed -i.bak 's/bind 127.*/bind 0.0.0.0/' /etc/redis/redis.conf && sudo service redis-server restart

sudo aptitude install python3-pip
sudo pip3 install OpenOB

sudo aptitude install alsa-utils
sudo alsactl init

I think in the doc in "If you wish to use Python 3, you must install python3-redis, python3-gst-1.0 and python3-setuptools instead of the Python 2 equivalents." python3-gi is missing. Maybe two lines to copy would be easier. And maybe add python-pip/python3-pip

Here, Redis is at the transmitter.


TRANSMITTER

Quick test: arecord -D hw:1 -f CD test1.wav -V stereo which shows a moving vu meter.

However

 openob 192.168.0.188 test-tx-node test-link tx 192.168.0.137 -a alsa -d hw:1
2018-10-22 00:48:37,431 - openob.link.test-link.config - INFO - Connecting to configuration host 192.168.0.188
2018-10-22 00:48:37,449 - openob.node.test-tx-node - INFO - Link test-link initial setup start on test-tx-node
2018-10-22 00:48:37,450 - openob.node.test-tx-node.link.test-link - INFO - Starting up transmitter
2018-10-22 00:48:37,451 - openob.node.test-tx-node.link.test-link.tx - INFO - Creating transmission pipeline
2018-10-22 00:48:37,452 - openob.node.test-tx-node.link.test-link - ERROR - Transmitter crashed for some reason! Restarting...
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/openob/node.py", line 45, in run_link
    transmitter = RTPTransmitter(self.node_name, link_config, audio_interface)
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/tx.py", line 21, in __init__
    self.build_pipeline()
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/tx.py", line 52, in build_pipeline
    self.source = self.build_audio_interface()
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/tx.py", line 75, in build_audio_interface
    source.set_property('device', self.audio_interface.alsa_device)
AttributeError: 'NoneType' object has no attribute 'set_property'
2018-10-22 00:48:37,955 - openob.node.test-tx-node.link.test-link - INFO - Starting up transmitter
2018-10-22 00:48:37,957 - openob.node.test-tx-node.link.test-link.tx - INFO - Creating transmission pipeline
2018-10-22 00:48:37,959 - openob.node.test-tx-node.link.test-link - ERROR - Transmitter crashed for some reason! Restarting...

Invoking without -a alsa results in no audio and

openob 192.168.0.188 test-tx-node test-link tx 192.168.0.137  -d hw:1
2018-10-22 01:12:50,445 - openob.link.test-link.config - INFO - Connecting to configuration host 192.168.0.188
2018-10-22 01:12:50,463 - openob.node.test-tx-node - INFO - Link test-link initial setup start on test-tx-node
2018-10-22 01:12:50,464 - openob.node.test-tx-node.link.test-link - INFO - Starting up transmitter
2018-10-22 01:12:50,465 - openob.node.test-tx-node.link.test-link.tx - INFO - Creating transmission pipeline
2018-10-22 01:12:50,513 - openob.node.test-tx-node.link.test-link.tx - INFO - Set receiver to 192.168.0.137:3000
2018-10-22 01:12:50,537 - openob.node.test-tx-node.link.test-link.tx - WARNING - Waiting for audio interface/caps
2018-10-22 01:12:51,552 - openob.node.test-tx-node.link.test-link.tx - INFO - Started mono audio transmission

An external interface that was recognized at hw:2 gave the same result.


RECEIVER

Also did a successful quick test with aplay piano2.wav and aplay piano2.wav -D hw:0

openob 192.168.0.188 test-rx-node test-link rx -a alsa -d hw:0
2018-10-21 19:41:51,114 - openob.link.test-link.config - INFO - Connecting to configuration host 192.168.0.188
2018-10-21 19:41:51,120 - openob.node.test-rx-node - INFO - Link test-link initial setup start on test-rx-node
2018-10-21 19:41:51,122 - openob.node.test-rx-node.link.test-link - INFO - Waiting for transmitter capabilities...
2018-10-21 19:41:51,124 - openob.node.test-rx-node.link.test-link - INFO - Got caps from transmitter
2018-10-21 19:41:51,124 - openob.node.test-rx-node.link.test-link - INFO - Starting up receiver
2018-10-21 19:41:51,126 - openob.node.test-rx-node.link.test-link.rx - INFO - Creating reception pipeline
2018-10-21 19:41:51,139 - openob.node.test-rx-node.link.test-link - ERROR - Receiver crashed for some reason! Restarting...
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/openob/node.py", line 60, in run_link
    receiver = RTPReceiver(self.node_name, link_config, audio_interface)
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/rx.py", line 20, in __init__
    self.build_pipeline()
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/rx.py", line 42, in build_pipeline
    self.output = self.build_audio_interface()
  File "/usr/local/lib/python3.5/dist-packages/openob/rtp/rx.py", line 62, in build_audio_interface
    sink.set_property('device', self.audio_interface.alsa_device)
AttributeError: 'NoneType' object has no attribute 'set_property'
2018-10-21 19:41:51,244 - openob.node.test-rx-node.link.test-link - INFO - Waiting for transmitter capabilities...
2018-10-21 19:41:51,247 - openob.node.test-rx-node.link.test-link - INFO - Got caps from transmitter
2018-10-21 19:41:51,247 - openob.node.test-rx-node.link.test-link - INFO - Starting up receiver
2018-10-21 19:41:51,250 - openob.node.test-rx-node.link.test-link.rx - INFO - Creating reception pipeline
2018-10-21 19:41:51,260 - openob.node.test-rx-node.link.test-link - ERROR - Receiver crashed for some reason! Restarting...
 openob 192.168.0.188 test-rx-node test-link rx  -d hw:0
2018-10-21 19:49:56,249 - openob.link.test-link.config - INFO - Connecting to configuration host 192.168.0.188
2018-10-21 19:49:56,254 - openob.node.test-rx-node - INFO - Link test-link initial setup start on test-rx-node
2018-10-21 19:49:56,256 - openob.node.test-rx-node.link.test-link - INFO - Waiting for transmitter capabilities...
2018-10-21 19:49:56,257 - openob.node.test-rx-node.link.test-link - INFO - Got caps from transmitter
2018-10-21 19:49:56,258 - openob.node.test-rx-node.link.test-link - INFO - Starting up receiver
2018-10-21 19:49:56,267 - openob.node.test-rx-node.link.test-link.rx - INFO - Creating reception pipeline
2018-10-21 19:49:56,310 - openob.node.test-rx-node.link.test-link.rx - INFO - Listening for stream on 192.168.0.137:3000
2018-10-21 19:49:57,440 - openob.node.test-rx-node.link.test-link.rx - INFO - Receiving mono audio transmission

EDIT1: Using hw:1,0 instead hw:1 makes no difference for arecord and openob … tx My next try would be python2.


EDIT2: I also tried trx from http://www.pogo.org.uk/%7Emark/trx/ https://github.com/eugenehp/trx (old version only)

Installed via

sudo aptitude install libasound2-dev libopus-dev libortp-dev checkinstall
git clone http://www.pogo.org.uk/~mark/trx.git 
cd trx
make
sudo checkinstall

It works with tx -d plughw:1 -h 192.168.0.137 and just rx on the receiver. Interestingly, it gives me noise after the tx is stopped. OpenOB stays totally silent.

Invoking openob 192.168.0.188 test-tx-node test-link tx 192.168.0.137 -a alsa -d plughw:1 leads to the exact same error as written above.

Matzeee commented 5 years ago

Reinstalling with python 2.7 gave the exact same error(s).

Matzeee commented 5 years ago

Found it: the package gstreamer1.0-alsa was missing. This should be added to doc/source/tutorial.rst

Could you maybe add the setup instructions to the README.md or mention the doc-folder? Because right now, the first thing one finds is the outdated tutorial at https://jamesharrison.github.io/openob/tutorial.html#installing-prerequisites

Or may I add a pull request for it?

jonty-comp commented 5 years ago

I'm sure pull requests are very welcome - in my testing I found the alsa package was installed alongside the main gstreamer package I believe but it's always different for different versions and distributions.

On Wed, 24 Oct 2018, 23:19 Matthias, notifications@github.com wrote:

Found it: the package gstreamer1.0-alsa was missing. This should be added to doc/source/tutorial.rst

Could you maybe add the setup instructions to the README.md or mention the doc-folder? Because right now, the first thing one finds is the outdated tutorial at

https://jamesharrison.github.io/openob/tutorial.html#installing-prerequisites

Or may I add a pull request for it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JamesHarrison/openob/issues/40#issuecomment-432847938, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGxU99nCK3ST3zbu4e5D0UfBPvepbQlks5uoOddgaJpZM4XyunF .

-- Thanks,

Jonty Sewell