Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43
  1. #1

    Looking for plugin which parses stream for sample rate/bits per sample

    Hey there,

    I'm wondering if anybody knows of a plugin out there which parses an incoming stream for the sample rate/number of bits per sample/number of channels. I need to modify an existing plugin to allow for a 24 bit/192 kHz/2 channel format, and was told that I need to do this by copying the parsing code of a plugin that did this into the plugin I'm using, and modifying it in order to pass hardcoded values to LMS. Any help is appreciated.

    Cheers,

    Michael

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

    Looking for plugin which parses streamfor sample rate/bits per sample

    LMS does scan streams before they are played. That information should be
    available then.

    Without more information it'll be hard to help you. Maybe you can ask
    the person who wrote the existing plugin you try to modify?

    Am 11.12.14 01:08, schrieb mike_b16:
    >
    > Hey there,
    >
    > I'm wondering if anybody knows of a plugin out there which parses an
    > incoming stream for the sample rate/number of bits per sample/number of
    > channels. I need to modify an existing plugin to allow for a 24 bit/192
    > kHz/2 channel format, and was told that I need to do this by copying the
    > parsing code of a plugin that did this into the plugin I'm using, and
    > modifying it in order to pass hardcoded values to LMS. Any help is
    > appreciated.
    >
    > Cheers,
    >
    > Michael
    >
    >
    > ------------------------------------------------------------------------
    > mike_b16's Profile: http://forums.slimdevices.com/member.php?userid=63606
    > View this thread: http://forums.slimdevices.com/showthread.php?t=102689
    >
    >

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,003
    Quote Originally Posted by mherger View Post
    LMS does scan streams before they are played. That information should be
    available then.
    OP is providing a PCM stream and wants to use WAVEInput plugin to send stream to players. Format info therefore will not be available as there is no header. Also OP mentions downsampling and also multiplexed stream so I am not sure what exactly the origin of the stream except coming in on Wolfson audio card.
    I am not sure how to achieve this in a LMS plugin and I suggested that a parseMeta data is likely hook to provide this info to LMS from a plugin (it si the approach I would look into first) since examining the stream is not possible. However since I ( and AFAICT nobody else) has done this it is an educated guess. I am v. busy at the moment (Christmas, tax returns, end of year audit ...) and haven't got the time to wade thro' LMS to investigate and verify and then give a ready made solution. I had suggested using formats with headers but OP wanted PCM.

  4. #4
    I have potentially found something that could help. The TranscodingHelper.pm file. Could the functionality I want be in here? In particular, a subfunction called getConvertCommand2. It looks like there could be a rate and format override. Could someone take a look in there and tell me if that's it?

    Thanks,

    Michael
    Last edited by mike_b16; 2014-12-11 at 16:41.

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,003
    I'm up to my eyes with real world and cannot be back to this until next week. You questions need time to look at LMS code as I don't know the answers offhand as you are asking for functionality which AFAICT nobody has done before so it is possible, LMS cannot do it at the moment.

    IIRC the getConvertCommand2 cannot be called by a plugin ProtocolHandler - the routine the plugin handler calls is tokenizeConvertCommand2.

    However reviewing that part of the plugin has given me the idea that perhaps the routine Slim::Music::Info::setBitrate (see how it is used in iPlayer plugin parserMetatdata routine) might do the trick in the "new" subroutine of the WAVIN.pm file just after Slim::Music::Info::setContentType. It would probably be quicker to write code and test (with various LMS logging enabled to confirm the action) than to trace LMS code.

  6. #6
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,003
    It was late when I posted the last suggestion but having slept on it I think setBitrate suggestion won't work as you need to set the sample rate and not the bit rate. Also I feel that the bit by bit approach of "give me a hint" will not work as I don't have the specific knowledge and all I am doing is suggesting the starting points I would try. However, your level of knowledge/skill means that I'm wasting your time as you're not able to recognise a dead end approach quickly.

    To get some sort of solution quickly I think you need to stream to player Flac not PCM and that you could look at the Forum threads which do upsampling of CD quality stream/file to IIRC 96kbits or192kbits to see if there are any special trick etc.

    Having a working Flac solution will give you time to see if a PCM one is possible.

  7. #7
    Senior Member Julf's Avatar
    Join Date
    Dec 2010
    Posts
    2,510
    Quote Originally Posted by bpa View Post
    Having a working Flac solution will give you time to see if a PCM one is possible.
    And is there any reason (beyond avoiding burning CVPU cycles) not to use flac?
    "To try to judge the real from the false will always be hard. In this fast-growing art of 'high fidelity' the quackery will bear a solid gilt edge that will fool many people" - Paul W Klipsch, 1953

  8. #8
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,003
    Quote Originally Posted by Julf View Post
    And is there any reason (beyond avoiding burning CVPU cycles) not to use flac?
    Not sure why OP doesn't use it. AFAICT OP created a convert.conf file for PCM, Flac and MP3 formats but only tests the PCM. OP has stated that lossless is required Flac or WAV.

  9. #9
    Senior Member Mnyb's Avatar
    Join Date
    Feb 2006
    Location
    Vństerňs Sweden
    Posts
    16,525
    And 192kHz which is not supported by any squeezebox ( in its original form ) so the application is a bit niche I'm groving slightly curious on what op is trying to do ?
    --------------------------------------------------------------------
    Main hifi: Rasbery PI digi+ MeridianG68J MeridianHD621 MeridianG98DH 2 x MeridianDSP5200 MeridianDSP5200HC 2 xMeridianDSP3100 +Rel Stadium 3 sub.
    Bedroom/Office: Boom
    Loggia: Raspi hifiberry dac + Adams
    Bathroom : Radio (with battery)
    iPad with iPengHD & SqueezePad
    (spares Touch, SB3, reciever ,controller )
    server Intel NUC Esxi VM Linux mint 18 LMS 7.9.2

    http://people.xiph.org/~xiphmont/demo/neil-young.html

  10. #10
    A bit of background would help here I'm sure.

    I have 3 Raspberry Pi units. One has a Wolfson audio card on it, and the other two have HiFiBerry DACs attached to them. I have a high quality audio source (capable of outputting 24/192/2ch analog audio) which I want to be able to pipe to the rest of my home, similar to a Sonos system. I wanted to do this using the RPi with the Wolfson card as a server which can pull this HQ audio stream in at 24/192/2ch and send it over the network to my 2 RPi units with the HiFiBerry DACs. The Wolfson card is capable of 24/192 recording/playback and the HiFiBerry DACs are capable of 24/192/2ch playback. After researching several solutions based on my requirements (playback sync, reliable stream, don't care too much about latency as long as it's within 5 seconds), I decided on using LMS on my Wolfson Pi with bpa's WaveInput plugin. Now, it appears that the plugin requires some modification if I want to allow this 24/192/2ch capability.

    As for what I want, I don't care whether the stream is sent as PCM or FLAC. As long as I get that 24/192/2ch playback at the sources. If I understand it, the format of the custom-convert.conf file in the WaveInput plugin needs to be written using a very specific format (including sections for PCM, mp3, and FLAC). However, if this can be modified to just send FLAC and I can skip this problem with PCM not containing format information in the headers, that would be great.

    Cheers,

    Michael

Tags for this Thread

Posting Permissions

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