Home of the Squeezebox™ & Transporter® network music players.
Page 5 of 5 FirstFirst ... 345
Results 41 to 45 of 45
  1. #41
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    535
    Quote Originally Posted by philippe_44 View Post
    But qobuz is remote but not live, I mean the Rx flow is determined by your connection bandwidth, not by realtime audio producing, so you buffer probably a lot at the beginning. A live stream will produce, e.g. 128kbits/s no more. You can buffer a few seconds but then your pumping process will be pacing at that speed, where if you have a local file or a non-live stream, it will peak much higher. I was just wondering if it had an impact on the syswrite blocking at a point.

    Sorry I'm just asking questions at this point and I'm not helpful, you can tell me to stop if you want.

    I did not used socketwrapper in the past in fact I did not touch that part of LMS expect as a user.

    In my case, because stdin and out cannot be used as sockets in Windows, I decided to change the shairtunes2 Perl part to use proper sockets and I also modified the helper to do the same, so that in Perl I'm able to use select() and all that jazz.

    Reading the posts you exchanged with bpa and the tests you've made, it seems that when you replace the pump/sink piece with a C native version that uses stdin/out, then socketwrapper does it job and LMS uses sockets, you use stdin/out and everything works fine. But when you replace the pump/sink with the perl wrapped as an exe, you have the problem of syswrite blocking at some point. Doesn't that mean that the problem is not in socketwrapper but somewhere in the stdin/out usage in the perl-made-an-exe piece? But I'm under the impression that you believe the culprit is socketwrapper.

    Again, candide questions and you can tell me to stop, I personally feel helpful sometimes when I'm banging my head against a wall that somebody forces me with such questions.
    Plese keep asking! I used to be a cobol programmer and too often've lost my mind looking for a bug and then a collegue come and say don't you need a dot here? And that was the soluton...

    I can't try C-3PO over web radios becouse C.3PO s not aimed to handle lossy formats at moment, I'll have to modify it to try, but for what I can see web radios sometime uses 'R' capabilities, sometime 'I', in that case being exactly the same as Qobuz, for the matter on how the command is built and run by LMS:

    Even using customconvert.conf, If you change the command making it different than '-' you should then specify capability by hand, so direct streaming is disabled, 'I' is required and T ignored, but - other than this - ANY transcoder I know (and C-3PO too) is still working even in windows, becose the flow is:

    LMS <-> transcoder | pipeline

    Meaning The first element in the transcoder pipeline receive the STDIN do what it has to do, then output to STDOUT, next in the chain read from STDIN and so on until the last, that return his STDOUT to LMS.

    I suppose is just becouse pipeline is defined as a filehandler: ($pipeline = FileHandle->new) NOT a socket (see song.pm)

    What is not working is when one of the elements in the transcoder pipeline try to delegate to a child process, transferring STDIN and STDOUT to him, i.e. using "''" or system.

    For what I can see, in that case if the first element of the child pipeline is a Perl wrapped in .exe, will blocks in reading form stdin after a little, while a C program instead go ahead and keep reading until EOF but both blocks on writing back to STDOUT, when SOCKETWRAPPER is involved.

    Perl in *NIX stystems works as expected both in reading and writing.

    If you try to emulate this process from a command prompt in windows, without engagging socketwrapper it runs, even using PERL, this is why I think is the way socketwrapper handle comunications that brokes, not win per se.

    Other is to say that the symplicistic way I designed the read/write process would eventually cause problem by itselt, it sure could be, but this is not depending on socketwrapper and/or windows.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  2. #42
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    535
    Attached here (https://drive.google.com/open?id=0B-...ldDbDBzdWttUTQ) a zip folder containing few very simple perl porgrams that you could use to simulat ethe process in command line:

    For each program you have:

    1. the .PL perl version
    2. the .EXE PARM/PAR produced executabe
    3. the compile*.bat script to be used to produce each .EXE from the .pl

    program are:

    1. FileToSTDOUT = read from a file and write to STDOUT
    2. STDINtoFile = read from STDIN and write fo a file
    3. STDINtoSTDOUT = read STDIN and write STDOUT. (Pump.exe is the c version of STDINtoSTDOUT, if you like to try it instead of perl one.)
    4. ExecuteChild = execute in a child thread the command: STDINtoSTDOUT | STDINtoSTDOUT.

    FileToSTDOUT needs a file in the same directory of the scripts namend: flac_16_44100.flac,
    STDINtoSTDOUT produces a file IDENTICAl to the other in the same folder, named: flac_16_44100_copy.flac

    The script "runTheCopy.bat" do the job:

    fileToSTDOUT.exe | ExecuteChild.exe |STDINToFile.exe

    this mean:

    read form the file, write to STDOUT | (read STDIN) execute a Child thread -> read STDIN , write STDOUT | read STDIN , write STDOUT -> back to main Thread (STDOUT) | Read STDIN write the cpy file.

    You should get the new flac_16_44100_copy.flac file in the folder and something like that at screen:

    Code:
    G:\Sviluppo\Promemoria\Prove\IPC>fileToSTDOUT.exe   | ExecuteChild.exe   | STDINToFile.exe
    Use of uninitialized value in do "file" at C:/Perl/site/lib/PAR.pm line 636.
    Use of uninitialized value in do "file" at C:/Perl/site/lib/PAR.pm line 636.
    Use of uninitialized value in do "file" at C:/Perl/site/lib/PAR.pm line 636.
    flac_16_44100.flac opened at script/fileToSTDOUT.pl line 42.
    start copy from flac_16_44100.flac at script/fileToSTDOUT.pl line 42.
    flac_16_44100_copy.flac opened at script/STDINToFile.pl line 43.
    start copy to  flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    Use of uninitialized value in do "file" at C:/Perl/site/lib/PAR.pm line 636.
    Use of uninitialized value in do "file" at C:/Perl/site/lib/PAR.pm line 636.
    start copy to STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    start copy to STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    
    ...
    
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk from flac_16_44100.flac TO STDOUT at script/fileToSTDOUT.pl line 42.
    end reading from flac_16_44100.flac to STDOUT at script/fileToSTDOUT.pl line 42.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO STDOUT at script/STDINtoSTDOUT.pl line 31.
    copied 64Kb chunk FROM STDIN TO flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    end writing to STDOUT at script/STDINtoSTDOUT.pl line 31.
    end writing to STDOUT at script/STDINtoSTDOUT.pl line 31.
    end writing to flac_16_44100_copy.flac at script/STDINToFile.pl line 43.
    
    RUN SUCCESSFUL (total time: 2s)
    This is a model of what C-3PO do, it works (also) in WIndows using .exe produced by PERL, but not when socketwrapper is involved, that's why I think is a matter of how socketwrapper handle communicatiions and I have to understand how it needs to be referred by the child threads to work.

    The Cprogram (cPump) could be used INSIDE socketwrapper to let READ from stdIn works, but Write still fails.
    Last edited by marcoc1712; 2016-10-02 at 11:11.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  3. #43
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,340
    Quote Originally Posted by marcoc1712 View Post
    What is not working is when one of the elements in the transcoder pipeline try to delegate to a child process, transferring STDIN and STDOUT to him, i.e. using "''" or system.

    For what I can see, in that case if the first element of the child pipeline is a Perl wrapped in .exe, will blocks in reading form stdin after a little, while a C program instead go ahead and keep reading until EOF but both blocks on writing back to STDOUT, when SOCKETWRAPPER is involved.
    Would you ne able to share the code? I've read a lot about Windowcracies and Perl when I was fighting with Shairtunes porting that it might help bringing some memories.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  4. #44
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    535
    Quote Originally Posted by philippe_44 View Post
    Would you ne able to share the code? I've read a lot about Windowcracies and Perl when I was fighting with Shairtunes porting that it might help bringing some memories.
    Sure:

    a. plugin repo is: http://www.marcoc1712.it/downloads/repository.xml
    b. github repository is: https://github.com/marcoc1712/C-3PO
    c. https://drive.google.com/open?id=0B-...ldDbDBzdWttUTQ zip folder containing the symplified code for testing (see previous post).
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  5. #45
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    535
    resurrected this thread becouse I had some more trials and investigation about socketWrapper:

    Seems to me SW always loose last chunk of data when moving more than 4Kb at once between threads. More than this, even if moving less than 4 KB last read (fread or sysread) from stdin in the client app hang up, not returning ANY data, errors or others.

    Tryed to test for EOF and others, but no way, my programs hang on read, then aborts.

    Please, could someone show to me - in any language - a working solution reading from STDIN when socketwrapper is involved?

    I just need this: Read from STDIN until there is data in it, then catch some condition like undefined, zero, error or whatever, stop receiving data and kindly close connection to the piped program, avoiding the very same problem.

    Many thanks, Marco.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

Posting Permissions

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