Garry's Mod

Garry's Mod

3D Stream Radio
This topic has been locked
Michak89 15 Jul, 2019 @ 5:53am
Error report
Hello

Click right mouse button on radio while in context menu and select option drive.
You will get error spam:

[ERROR] addons/server_modafinil/lua/entities/sent_streamradio/cl_init.lua:232: attempt to compare nil with number
1. GetWallVolumeFactor - addons/server_modafinil/lua/entities/sent_streamradio/cl_init.lua:232
2. GetWallVolumeFactorSmoothed - addons/server_modafinil/lua/entities/sent_streamradio/cl_init.lua:268
3. UpdateStream - addons/server_modafinil/lua/entities/sent_streamradio/cl_init.lua:312
4. unknown - addons/server_modafinil/lua/entities/sent_streamradio/cl_init.lua:420

Line 232 in ment file:

if self:GetVolume() <= 0 then

Quick fix? :

if self:GetVolume() = nil then return 0 end
if self:GetVolume() <= 0 then

Also youtube conventer died again: 29.06.2019
Last edited by Michak89; 15 Jul, 2019 @ 5:56am
< >
Showing 1-15 of 17 comments
Grocel  [developer] 16 Jul, 2019 @ 1:49pm 
Undeleted: There is no need to delete this, as this is a valid bug report.
Please keep in mind that I can not maintain the error reports 24/7. So reaction time is slow sometimes.

I would also recommend NOT to suggest fixing code unless you know what you are doing (Read: Understand all relevant addon code and structures). The function self:GetVolume() must not return nil. If it does anyways, then something goes very wrong. Adding your check would not help much to fix the problem. Its nice that you are trying to help, but usually the error message and the steps to reproduce the error is enough for me.

I will try the develop a fix for that soon, but I am quite busy at the moment, so no ETA.
This problem is related to the known problem of the radio being stuck at the song start and looping the first second sometimes. Thanks for reporting. This bug helps me to reproduce the other bug.

Youtube support is not broken, I just tested it today.
Last edited by Grocel; 16 Jul, 2019 @ 1:54pm
Michak89 16 Jul, 2019 @ 2:43pm 
I could not reproduce the error on clean gmod singleplayer, so thought it only happens on my sandbox server where over 100 addons could possibly be connected with this.
Now I know that networking on singleplayer is different.

Tried to fix it myself and broke the radio, You are absolutly right.
Amazing work Grocel.
Michak89 17 Jul, 2019 @ 5:51am 
And about youtube support, yeah now it works just tested with 5 friends.

I have one more problem, sometimes radio crashes game (not only my game). And yes, I'm 100% sure its the radio. I don't know how to reproduce the problem yet, just say a word and I can record my game. Why am I sure it's the radio? On spawn, crashed my game 5 times until server moderator removed it, today someone put it near me and - hl2 no response immediately. When I join and go to any place where such crashing radio is - crash after 1/2 seconds after I see it. In windows crash log I see crash is from vguimatsurface.dll - allways same reason, can radio gui crash game? Tried to get close looking in opposite direction - crash when I'm in radius.

Also found out that deleting gmod cache folder temporarily helps.
Last edited by Michak89; 17 Jul, 2019 @ 6:52am
Grocel  [developer] 17 Jul, 2019 @ 7:20am 
Usually the GUI does not crash the game. If it does it is more of a problem of the game. There is one known case where it could happen if all of these points are true:

1. The game is run with multi core render on
2. The radio is spawned
3. Lua error happens inside the gui rendering
4. The radio entity is rendered on screen (not necessarily visible)

The GMod cache folder is not involved in this crash by itself unless it contains conflicting addon code or it got simply to big so some radio addon code is missing.

There is another possible crash known (never had it my self) related to the sound engine (BASS) this addon use. This one is an engine bug and can not be fixed by this addon. All addons using BASS (via sound.PlayURL()) are affected by it equally.

To be able to investigate this Problem I need more details:
- Can you confirm the crash on a listen server (not single player) with no other addons?
- What Lua error does the radio throw if you try to reproduce the crash with multi core rendering off?
- Hardware information
- List of used addons
Last edited by Grocel; 17 Jul, 2019 @ 7:25am
Grocel  [developer] 17 Jul, 2019 @ 7:24am 
As far as I know you can not set the multi core rendering in the game settings (option grayed out). You can however set it via console. Multi core rendering is also still in an experimental state in GMod.

Multi core rendering on:
gmod_mcore_test 1 mat_queue_mode -1 cl_threaded_bone_setup 1 // Not strictly rendering, but it works now and will help if you are viewing lots of NPCs

Multi core rendering off:
gmod_mcore_test 0 mat_queue_mode 1 cl_threaded_bone_setup 0
Last edited by Grocel; 17 Jul, 2019 @ 7:27am
Michak89 17 Jul, 2019 @ 9:06am 
Good news, after 2 hours of experiments I can reproduce it.

Hardware information:
i7 6700k
gtx 1080ti asus rog strix
24 gb of ddr4
a lot of free space on ssd where both server and game.
running win 7 64bit

I don't use any gmod beta versions like chromium / x64 etc - game is clean.

Client info:
clean gmod, no addons, no cache, no downloads, no lua modifications, -noworkshop parameter it startup and no workshop subscriptions, fresh install.

I know about multi core rendering, never used it before and it's off.

Server info:
local server on same windows 7, fresh install, no addons, no ulx, no cfg, no lua modifications only Stream Radio as legacy addon in folder, gm_construct, default tickrate, 10 slots.

Answers to Your questions:

- Can you confirm the crash on a listen server (not single player) with no other addons?
- Yes

- What Lua error does the radio throw if you try to reproduce the crash with multi core rendering
off?
- It is off, no lua errors.

- List of used addons
- Only Stream Radio serverside.
-------------------------------------------------------------------------

I'm not using Bass, used to but not this time.
I discovered it is not gui crash and reproduction is simple:

First please type developer 1 in console if it's 0
Crash is based on duplicator (gmod default duplicator). When radio is normalny spawned it does not happen.

Spawn radio by "Radio spawner" tool and play anything. In developer mode when player is not in radius it looks like this: https://i.imgur.com/jQ3pwzN.png
And when You are in radius it looks like this: https://i.imgur.com/hpyV5V4.png

Player experiencing crash will never see file path.

This is how I discovered the following:
When this .dat file with sound does not exist in player data folder game crash like here:
https://i.imgur.com/qXOGyqv.png
And when radio comes from some duplications this file is not created.

Here is a video: https://www.youtube.com/watch?v=ZvtYwxsOVOA&feature=youtu.be

Tested with friends, when I put correct dat file in correct place where it should be it does not happen anymore. Now imagine sandbox servers where duplications are quite common. I'm crashing like 20 times a day, other players too.

Duplication used in this video: https://www93.zippyshare.com/v/3KsxBL4W/file.html

You may noticed lua files were not transfered to client on server joining, this is because I recorded it few times and cache generated. Missing model is from wiremod, can add it if You want.

Also if this is insufficient, I can make few more tests.
Crash happens when played .dat file does not exist on client.
Such radio on spawn == empty server :D

Last edited by Michak89; 17 Jul, 2019 @ 9:15am
Grocel  [developer] 17 Jul, 2019 @ 9:21am 
Thinks for the details. I see where it is going, now. The radio tries to play an non existing file and crashes doing so. I will fix that.

Other topic, you are using Bass when you are using the radio or a similar addon. Bass is the sound engine the game uses for streaming via the function sound.PlayURL() or via sound.PlayFile(). If the file does not exist these function are supposed to return an error code (error 2 in this case) instead of crashing. It is a known and reported problem with the game.
Michak89 17 Jul, 2019 @ 9:25am 
Oh I see, thought about external binary gm_bass3.
Last edited by Michak89; 17 Jul, 2019 @ 9:29am
Grocel  [developer] 17 Jul, 2019 @ 10:27am 
I just released a patch with crash fixes. Please check and tell me if it works for you now.
Last edited by Grocel; 17 Jul, 2019 @ 10:27am
Michak89 17 Jul, 2019 @ 10:56am 
Unfortunately, it's still the same in the same situation :/
Tested 8 times, also on few friends.
Michak89 17 Jul, 2019 @ 10:58am 
False positive, one more moment
Michak89 17 Jul, 2019 @ 11:06am 
It's fixed now omg thank You so much :D
Gmod did not download updated addon just extracted previously downloaded from
..Steam\steamapps\workshop\content\4000

I got new version from github and it works. Tried to delete .dat file while radio playing, allways new generates. Great job again :)
Last edited by Michak89; 17 Jul, 2019 @ 11:07am
Grocel  [developer] 17 Jul, 2019 @ 11:37am 
I have fixed that drive bug as well now. Please check if it is fixed for you. Make sure your addon version is 390 or above. Updates on Workshop take a while to arrive for all clients.
Last edited by Grocel; 17 Jul, 2019 @ 11:38am
Michak89 17 Jul, 2019 @ 12:16pm 
Can't spawn the radio, no errors.
ver. 390
Last edited by Michak89; 17 Jul, 2019 @ 12:17pm
Michak89 17 Jul, 2019 @ 12:18pm 
God, another false positive one more moment please :O
< >
Showing 1-15 of 17 comments
Per page: 1530 50