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

Default stream endpoint changes when stream settings saved #1133

Closed
paddatrapper opened this issue Dec 16, 2020 · 10 comments
Closed

Default stream endpoint changes when stream settings saved #1133

paddatrapper opened this issue Dec 16, 2020 · 10 comments
Labels
is: bug status: stalled This issue or pull request is stalled

Comments

@paddatrapper
Copy link
Contributor

In both the Listen popup and the Streams settings menu, the URLs for the streams are incorrectly displayed.

  • Streams: http://192.168.xx.xx:8000/_a instead of http://192.168.xx.xx:8000/airtime_128 (default setup)
  • Listen: 127.0.0.1 Libretime Stream #1 instead of serverIP ... (default setup)

This is likely messing up the stream URL that's getting sent to the widgets. I've been digging for the part of the PHP code that either sets/retrieves the stream URL data but I haven't been able to find it.

Originally posted by @zklosko in #461 (comment)

I have noticed this too. The initial stream endpoint is /airtime_128 in icecast (and so liquidsoap), but the default shown in the interface (so I'm assuming somewhere in the DB) is /_a. This is all synchronized to /_a when you press Save on the stream settings for the first time, but before then there are inconsistencies, leading to the above

@zklosko
Copy link
Member

zklosko commented Dec 16, 2020

I just hit a major breakthrough in figuring out how to pass PHP variables to Vue! I can use this to come up with a band-aid fix while we figure out what's setting the URL incorrectly.

@zklosko
Copy link
Member

zklosko commented Dec 16, 2020

Update: turns out I can't... the variable isn't placed in the browser and is calculated from the database. We would need to change the database value. 😞

I've started by starting a reverse proxy in Apache, routing IP:8000/ to IP/streams/ (meaning the default stream would show up on IP/streams/airtime_128). This would allow us to call URLs on the same port as the web app. At the moment, this still causes display issues (and the player on the IP:8000/ page on the redirect doesn't work) but the stream IP/streams/streamURL does work. Might be an upstream issue with Icecast.

@zklosko
Copy link
Member

zklosko commented Dec 17, 2020

@paddatrapper @Robbt @hairmare How do you feel about switching players? I found a Javascript library for creating players in HTML5 (no Flash option) called Howler.js. Instead of needing to use a CDN or package manager, it only needs one file to run. An example player:

var sound = new Howl({
  src: ['stream1', 'stream2', 'stream3'],
  autoplay: true,
  volume: 0.5,
});

@paddatrapper
Copy link
Contributor Author

I do think having the dependency in a dependency manager is a good thing. That looks interesting, but I think the discussion should happen in #249

@zklosko
Copy link
Member

zklosko commented Dec 18, 2020

It does have an option for dependency managers such as Yarn or NPM as well.

@zklosko
Copy link
Member

zklosko commented Dec 26, 2020

All this is even more bizarre because the correct data appears to be inserted upon installation:

INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_enable', 'true', 'boolean');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_output', 'icecast', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_type', 'ogg', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_bitrate', '128', 'integer');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_host', '127.0.0.1', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_port', '8000', 'integer');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_user', '', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_pass', 'hackme', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_admin_user', 'admin', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_admin_pass', '', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_mount', 'airtime_128', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_url', 'https://libretime.org', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_description', 'LibreTime Radio! Stream #1', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_genre', 'genre', 'string');

@zklosko
Copy link
Member

zklosko commented Dec 26, 2020

@paddatrapper So, I was able to fix this by setting a string instead of calling from the database in StreamSetting.php:

    public static function getDefaults($prefix) {
        $config = Config::getConfig();
        return array(
            'host'   => $config['baseUrl'],
            'port'   => DEFAULT_ICECAST_PORT,
            'output' => 'icecast',
            'user'   => $config['stationId'],
            'pass'   => Application_Model_Preference::getDefaultIcecastPassword(),
            // Forcing default mountpoint string for now
            'mount'  => 'airtime_128',
        );
    }

Clicking on the Listen button in the interface now launches a play with the correct stream but the playback jumps back and forth, like skipping back 30 seconds occasionally... it doesn't make any sense. 😕

Using Firefox 81.0.1 on macOS Catalina if it helps.

@paddatrapper

This comment has been minimized.

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had activity in the last 5 months. It will be closed if no activity occurs in the next month.
Please chat to us on discourse or ask for help on our chat if you have any questions or need further support with getting this issue resolved.
You may also label an issue as pinned if you would like to make sure that it does not get closed by this bot.

@stale stale bot added the status: stalled This issue or pull request is stalled label Jun 11, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically closed after is was marked as stale and did not receive any further inputs.
Feel free to let us know on discourse or ask for help on our chat if you feel this issue should not have been closed.
Thank you for your contributions.

@stale stale bot closed this as completed Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug status: stalled This issue or pull request is stalled
Projects
None yet
Development

No branches or pull requests

2 participants