Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8

    Subsonic Plugin - player hang when format changes mp3 -> flac or flac -> mp3

    Hi all,

    I'm coding a plugin to use a subsonic server as stream source.

    Looks good so far but i face two issues i didn't figure out yet.
    For bandwidth reasons music is trancoded on the subsonic side, based on the settings of the plugin pannel.

    Transcoding options are mp3 ’64k’, ‘128k’, ‘256k’, ‘320k’, and raw/disabled -> streams the file as is. flac in my case.

    When switching from mp3 to flac or from flac to mp3 (switching from 64k to 320k works flawlessly), the player hang and there is noway to replay a song that have been played in the previous format. Songs that have never been played can be played after some delay and after a player (squeezeplay) restart.

    [18-03-27 14:12:05.1456] Plugins::Subsonic::ProtocolHandler::__ANON__ (173) stream: https://private.org:4443/rest/stream?id=128641&format=raw&u=jo&t=5cb7a95347f96da f923094015ef941c1&s=eBBctvSio&v=1.16.0&f=json&c=sl im
    [18-03-27 14:12:05.3434] Plugins::Subsonic::ProtocolHandler::parseDirectHea ders (104) type: audio/flac
    [18-03-27 14:12:05.3436] Plugins::Subsonic::ProtocolHandler::parseDirectHea ders (105) length: 12861304

    [18-03-27 14:13:04.6153] Plugins::Subsonic::ProtocolHandler::__ANON__ (173) stream: https://private.org:4443/rest/stream?id=128641&format=mp3&estimateContentLength= true&maxBitRate=256&u=jo&t=27408e82dff8c7ffabd6365 960b03923&s=D5ImY8mfA&v=1.16.0&f=json&c=slim
    [18-03-27 14:13:06.4006] Plugins::Subsonic::ProtocolHandler::parseDirectHea ders (104) type: audio/mpeg
    [18-03-27 14:13:06.4009] Plugins::Subsonic::ProtocolHandler::parseDirectHea ders (105) length: 5632000

    Header is updated as well as metadatas.

    I don't know where to go from there.

    Thanks for reading, any help appreciated guys.

    Jo

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,460
    I think we'd need much more information (or even the code...) to understand what really is going on there. Eg. are those URLs the URLs that you'd receive browsing the content? Or you use the protocol handler to convert something like myplugin://12345.mp3 into that URL?

    The latter actually is what I would recommend you to do. And make sure that URL already comes with the correct extension.
    Michael

    "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
    (LMS: Settings/Information)

  3. #3
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8
    Quote Originally Posted by mherger View Post
    I think we'd need much more information (or even the code...) to understand what really is going on there. Eg. are those URLs the URLs that you'd receive browsing the content? Or you use the protocol handler to convert something like myplugin://12345.mp3 into that URL?

    The latter actually is what I would recommend you to do. And make sure that URL already comes with the correct extension.
    It actually is a "subsonic://" url.

    Plugin can be downloaded there
    and here is repo xml

    I can provide an account to a subsonic server in pm if needed, as you probably don't have that under the hand.

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,460
    Before I even look at the code: use the version number in the download file name. Otherwise you'll be facing all kinds of issues due to caching.
    Michael

    "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
    (LMS: Settings/Information)

  5. #5
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8
    Quote Originally Posted by mherger View Post
    Before I even look at the code: use the version number in the download file name. Otherwise you'll be facing all kinds of issues due to caching.
    Ok thanks.
    done.
    jo

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,460

    Subsonic Plugin - player hang when format changesmp3 -> flac or flac -> mp3

    That's looking pretty promising! And quite snappy, too.

    As I mentioned in my first posting I would use a file extension defining
    the content type, plus even the bitrate as part of the "filename". I
    don't remember the details, but I remember that I failed to have generic
    URLs for TIDAL's FLAC/MP3 streams. Eventually went back to using the
    file extension, as somewhere deep in the code LMS makes assumptions
    about what the file might be based on this.

    I know that this means you define the sound quality when you browse the
    collection. But IMHO this shouldn't be a problem, as users hardly will
    change quality all the time.

    So... make it something like 123456-128.mp3 or abcdef.flac. Then use
    these chunks of information rather then the prefs to build the actual
    URL in the protocol handler.
    --

    Michael

  7. #7
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8
    I'm glad you liked it.

    I'll try that suffix thing and see.
    But as you said in a normal operation users won't change those settings often, so we may just prevent them that have to wait a little bit or restart and clear everything when they modify the transcoding thing.

    Whatevver thanks again Michael.
    Last edited by foobarjo; 2018-03-27 at 10:11.
    jo

  8. #8
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8
    Quote Originally Posted by mherger View Post
    That's looking pretty promising! And quite snappy, too.

    As I mentioned in my first posting I would use a file extension defining
    the content type, plus even the bitrate as part of the "filename". I
    don't remember the details, but I remember that I failed to have generic
    URLs for TIDAL's FLAC/MP3 streams. Eventually went back to using the
    file extension, as somewhere deep in the code LMS makes assumptions
    about what the file might be based on this.

    I know that this means you define the sound quality when you browse the
    collection. But IMHO this shouldn't be a problem, as users hardly will
    change quality all the time.

    So... make it something like 123456-128.mp3 or abcdef.flac. Then use
    these chunks of information rather then the prefs to build the actual
    URL in the protocol handler.
    --

    Michael
    Ola Michael,

    I did just as you said, recode the thing to get the suffix and bitrate into the url, and you know what?
    It did work i'd never figure that out by myself. thank you man, you really are the guy !

    By the way i've also implemented one or two more things and i think i'm getting close to a release.
    Have you got any idea of where to go next?
    Last edited by foobarjo; 2018-04-03 at 16:57.
    jo

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,460

    Subsonic Plugin - player hang when format changesmp3 -> flac or flac -> mp3

    > Have you got any idea of where to go next?

    Where to go next in what regard?

    --

    Michael

  10. #10
    Junior Member foobarjo's Avatar
    Join Date
    Mar 2018
    Posts
    8
    Quote Originally Posted by mherger View Post
    > Have you got any idea of where to go next?

    Where to go next in what regard?

    --

    Michael
    I mean, is there a place where to refrence the pluggin or something like that?
    jo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •