Page 1 of 1

Webclient not streaming whole song

PostPosted: Fri Jan 08, 2021 2:55 pm
by cdetroye
Hi all,

Whenever I stream a FLAC song in Subsonics webinterface, it doesn't completely stream the entire song. It works fine for mp3s.

Edit: It doesn't work for any song that is being transcoded. .m4a songs for example fail as well.

Assuming a FLAC song of 8:33 minutes.

When I press play in the webinterface I can see the player flashes 8:33 as the duration (on the player), and then when the transcoding starts it shows 2:05 (or so). When 2 minutes or so have played, a new chunk of the song is loaded and the player shows 3:37 (or so). And this goes on.
The problem is that usually around 3 minutes of song loaded, the player stops fetching the rest and goes to the next song as soon as 2:55 minutes have passed.

Image

I have transcoding enabled for the webplayer with the following command:
Code: Select all
ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -



Subsonic 6.1.6 (build 0cfa60) – November 10, 2019
Ffmpeg version 3.2.15-0+deb9u1
Firefox 84.0.1

Update:

I noticed that when I disable transcoding for the web player (which works apparently for FLAC files) it works as expected, and immediately loads the entire song.

Re: Webclient not streaming whole song

PostPosted: Mon Feb 01, 2021 1:43 pm
by cdetroye
Doesn't anyone have this problem?

Re: Webclient not streaming whole song

PostPosted: Tue Feb 02, 2021 7:56 pm
by J_T_W
Have you considered returning the transcoding back to the default, similar to:

Code: Select all
ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -

Re: Webclient not streaming whole song

PostPosted: Thu Mar 04, 2021 9:20 am
by cdetroye
Yes, that's what it was set to before as well. I just copied over an example from the logs instead of the template.

Re: Webclient not streaming whole song

PostPosted: Fri Mar 05, 2021 1:39 pm
by cdetroye
I think I have solved the problem. It was with the proxy that did not properly keep connections open. For other people with this issue, the following config should work as expected.

Code: Select all
server {
    server_name subsonic.example.com;

    location / {
        sendfile off;
        proxy_pass https://localhost:4041/;
        proxy_redirect off;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_max_temp_file_size 0;

        #this is the maximum upload size
        client_max_body_size 10m;
        client_body_buffer_size 128k;

        proxy_connect_timeout 90;
        proxy_send_timeout 90;
        #proxy_read_timeout         90;

        proxy_buffer_size 4k;
        proxy_buffers 4 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;

        ## Required for Websockets
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 36000s;
    }

    listen 443 ssl; # managed by Certbot

    ssl_certificate /etc/letsencrypt/live/subsonic.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/subsonic.example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = subsonic.example.com) {
        return 301 https://$host$request_uri;
        } # managed by Certbot

        server_name subsonic.example.com;
        listen 80;
        return 404; # managed by Certbot
}

Re: Webclient not streaming whole song

PostPosted: Sat Apr 23, 2022 5:00 am
by eb303
Hello,

I happen to have the issue you describe in your original post, so thanks for looking into it. For the moment, I've "solved" it by disabling transcoding, but I'm not sure this will work for all formats. I've tried to see if I have the same issue as you have with the proxy, but I just don't get in what file I have to look for the config to update. Where should I look for it?

Cheers!