azlux/MumbleRadioPlayer

No sound output ?

Glowsome opened this issue · 13 comments

Hello,
In following all instructions i have the bot running on a clean/new (VM) Debian box, and its connectingto the mumble server and is responding to all commands issued in the mumble-server.

But when playing a stream the bot remains silent on Mumble
When playing :
!play [stream] - all works, no errors , just no sound on the mumble server
!np - output is correct streamtitle in/on mumble server (so it is playing /getting the stream)

Enabled in debug :

  • option mumbleConnection set to True
    => i see packets being transmtted in output, still bot remains silent

Any idea what i'm missing here ?

  • Glowsome

For some reason it started working ( without any significant changes)

azlux commented

Your tests show than everything is OK.
Maybe some rules in your firewall wasn't good.
Glad to know than it's working now.
Az

Well after some more analysis i am able to duplicate the issue i had.

When i am the only one on the mumble-server and fire up the bot it will :

  • respond correct to given typed commands
  • will NOT play music

Then i had another person joining mumble and spontaniusly it started outputting music (hearable)
No commands were given at that time, the !play -command was given like 5 minutes before the 2nd person joined.

What i can see in the logging when the bot joins is the following :

<W>2017-10-16 20:17:36.443 4 => <22:(-1)> New connection: xxx.xxx.xxx.xxx:55358 <W>2017-10-16 20:17:37.930 4 => <22:(-1)> Strong certificate for my@email.sometld <my@email.sometld> (signed by StartCom Class 1 Client CA) <W>2017-10-16 20:17:38.419 4 => <22:(-1)> Client version 1.2.19 (Win: 1.2.19) <W>2017-10-16 20:17:38.726 4 => <22:Glowsome(1)> Authenticated <W>2017-10-16 20:17:50.963 4 => <63:MusicBot(-1)> Moved MusicBot:63(-1) to The Lounge[1:0] <W>2017-10-16 20:18:25.463 4 => <22:Glowsome(1)> Connection closed: The remote host closed the connection [1] <W>2017-10-16 20:18:36.682 4 => <23:(-1)> New connection: 172.16.17.249:55394 <W>2017-10-16 20:18:36.805 4 => <23:(-1)> Strong certificate for my@email.sometld <my@email.sometld> (signed by StartCom Class 1 Client CA) <W>2017-10-16 20:18:36.860 4 => <23:(-1)> Client version 1.2.19 (Win: 1.2.19) <W>2017-10-16 20:18:37.441 4 => <23:Glowsome(1)> Authenticated <W>2017-10-16 20:19:34.543 4 => <63:MusicBot(-1)> Connection closed: The remote host closed the connection [1] <W>2017-10-16 20:19:34.603 4 => CELT codec switch ffffffff8000000b ffffffff80000010 (prefer ffffffff80000010) (Opus 1) <W>2017-10-16 20:19:39.574 4 => <24:(-1)> New connection: xxx.xxx.xxx.xxx:37716 <W>2017-10-16 20:19:39.645 4 => <24:(-1)> Client version 1.2.4 (PyMumble 0.2.1: PyMumble 0.2.1) <W>2017-10-16 20:19:39.718 4 => CELT codec switch ffffffff8000000b ffffffff80000010 (prefer ffffffff8000000b) (Opus 1) <W>2017-10-16 20:19:39.766 4 => <24:MusicBot(-1)> Authenticated <W>2017-10-16 20:19:39.850 4 => <24:MusicBot(-1)> Moved MusicBot:24(-1) to AFK or Busy[2:0] <W>2017-10-16 20:19:57.210 4 => <24:MusicBot(-1)> Moved MusicBot:24(-1) to The Lounge[1:0] <W>2017-10-16 20:26:47.035 4 => <25:(-1)> New connection: xxx.xxx.xxx.xxx:58848 <W>2017-10-16 20:26:47.221 4 => <25:(-1)> Client version 1.2.19 (Win: 1.2.19) <W>2017-10-16 20:26:47.449 4 => <25:someguy(33)> Authenticated
So i'm thinking of Codec issues, but as you can see this CELT codec switch is something i havent seen alot before and other users ( on high nights we have 35+ users online) have never complained.

Any idea ?

azlux commented

OK, found it into the log.
One of you use the old codec CELT, the server is parameter by default to fallback all client into the CELT codec if so.
In this case, pymumble cannot send music, I use the last codec on mumble : opuslib (CELT isn't implemented), that why when the server fallback in CELT, mumbleradioplayer isn't capable to send audio.
Tell your users to update their mumble client. (CELT is VERY old)

Ok i also was further looking at the issue , https://wiki.mumble.info/wiki/FAQ/English#How_do_I_force_usage_of_the_Opus_codec_.28opusthreshold.29.3F
In my ini on the server ther is no parameter for opusthreshold, so i have now added it and will see if this helps

The opusthreshold i have set to 0 , i will let you know in like 15 mins after testing

Weird,
As mentioned above i have now forced the codec to Opus and when i connect as 1st user i can see the codec being switched to Opus.

prior to this the bot was running, before restarting the server i did !kill it, connected myself and then tried to launch the bot, but it fails in starting up.

./mumbleRadioPlayer.py --server xxx.xxx.xxx.xxx --port 64741 -u MusicBot Traceback (most recent call last): File "./mumbleRadioPlayer.py", line 291, in <module> playbot = MumbleRadioPlayer() File "./mumbleRadioPlayer.py", line 51, in __init__ self.set_comment() File "./mumbleRadioPlayer.py", line 211, in set_comment self.mumble.users.myself.comment(txt + "<p /> " + self.config.get('bot', 'comment')) AttributeError: 'NoneType' object has no attribute 'comment'

After that i moved the install of the bot and re-pulled it from git to see if something went wrong with the bot, but it also fails - same reason ... i'm getting very confused :\

azlux commented

can you copy/paste your config file ? it's look like it cannot access to one variable.

Full configuration.ini :
-------Begin configuration.ini------------

[stream]
radio538 = http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO538.mp3
slamfm = https://streaming.slam.nl/web10_mp3
#luna = http://radio.ponyvillelive.com:8002/stream
#radiobrony = http://62.210.138.34:8000/live
#celestiaradio = http://celestia.aiverse.org:8000/mp3_256

[bot]
comment = MusicBot A stream bot for Mumble
allow_new_url = True
volume = 0.1
#Admin can be separated by ";" if multiple. ex: toto1;toto2;toto3

admin = Glowsome
music_folder = /home/dmichel/pymumble_v3/music/

[debug]
ffmpeg = False
mumbleConnection = False

[command]
play_stream = play
play_file = playfile
stop = stop
current_music = np
volume = v
kill = kill
stop_and_getout = getout
joinme = joinme
list = list
help = help

[strings]
current_volume = volume : %d%%
change_volume = volume : %d%% by %s
bad_command = Invalid command
not_admin = You are not an Admin!
not_playing = No stream or local file playing
bad_file = Bad file asked
no_file = No file here
help = <br/>!play [stream] - Stream choices : radio538, slamfm<br/>!joinme - join the channel i'm in<br/>!stop - stop playing stream<br/>!v 20 - adjust the volume in percentage<br/>!np - Now playing info<br/>!getout - stop playing and move to AFK

-------End configuration.ini------------

azlux commented

Check #7.
It's a connection error. (I need to had more checks on the connect part).

ok ty, i'll wait for the 'update'

azlux commented

You can come on my mumble when you want. We can check that together.

Problem solved, it was (together with your assistance (which was awesome! )) a case of connecting to a multi-ip machine to the correct ip the server was bound to (or for this matter correct dns-hostname).

The original issue where i had no sound when starting the bot is specifically controlled by the (as mentioned above) setting in the mumble-server's configuration file

opusthreshold=0 # set to zero to force codec to Opus

As i have run a mumble-server for years, and upgraded the binary the setting never was in my configuration file.
By adding this manually the bot plays fine from launch.