Menu

#8 Sample buffer compute logic, and selection of custom channel mapping

1.0
open
None
2017-11-26
2016-11-07
artnow
No

Hello Didier,

Thanks four your software.

Indeed, ASIO2 has a better SQ than official plugin, especially if no samples are lost, what trace logs in Foobar console can show.

However Il would like to know the logic behind the compute of the sample buffer (not the endpoint one).
For example, I have to manually set a 16x factor and disable "alignment optimisation" to have a buffer size that match all playback cases (from Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
ASIO buffer is 1024.

In case "alignment optimisation" is checked, with a 8x factor, I get a 8192 samples buffer that fits for Youtube but not for flac. There is lost samples.
If not checked : ASIO2 plugin compute a 12k sample buffer (computer minimum), and it's ok.
So finally I set 16x factor without alignment optimisation, and so a 16384 sample buffer is computed.

Is it normal ?

One additional question : in Foobar, in output selection, it seems that ASIO2 do not permit to select any custom ASIO channel mapping.

Regards,
AF.

Related

Tickets: #8

Discussion

1 2 > >> (Page 1 of 2)
  • Didier Galardon

    Didier Galardon - 2016-11-07

    Hello artnow,

    In your case, the cache size should not change wether you disable or not "alignment optimization". The only difference on the cache size that could occur in theory when changing "alignment optimization" option is when the calculated cache size (sample cache factor x endpoint buffer size) is not a multiple of the chunk size (e.g. endpoint size=64, chunk size=1024,cache factor=100): when "alignment optimisation" is enabled, asio2 plugin adjusts the cache size in order to make it a multiple of both the endpoint buffer size and the input chunk maximum size, whereas when "alignment optimisation" is disabled, it keeps the calculated cache size as is. (by the way, there is a bug on the adjustment that I need to fix in the next version, but I set this aside for now)

    I understand that you have 2 types of input: youtube streaming and Flac. the input chunk size vary depending on the type of input: e.g for 1024 or .wav, 4096 for flac,..) when switching from one track in a given format to another track in another format, asio2 plugin reopen the driver and reinitialize automatically the sample cache. In your case, considering that you have a 8x sample cache factor when you listen to Youtube input (chunk size = 1024), the cache size will be 8192 (8 x endpoint buffer size). Then when you switch to a flac input track (chunk size = 4096), the cache size is changed automatically to 3 * 4096 (minimum sample cache size is automatically adjusted to 3 x chunk size by asio2 plugin), because your configured cache size (8192) is not large enough for flac huge samples. When you change the sample cache factor to x 16, automatic adjustment is not necessary.

    Then, again, you should be able to keep the "alignment optimisation" enabled. Just one word concerning this option: In general it is better for SQ to keep this option enabled, but, depending on your type of input, it may be necessary to disable it. Typically, when listening to input format whose chunk size may dynamically increase over time (e.g. MP3), asio2 plugin is not able to manage cache/chunk alignment, because it assumes that the input track chunk maximum size will be the size of the first chunk received. Playback will fail with an explicit error message in that case.

    Finally, you are right concerning the custom ASIO channel mapping: I have not implemented it yet in ASIO2.

    Regards,

    Didier

     
    • artnow

      artnow - 2016-11-07

      Hi Didier,

      Thank you very much for all your explanations.

      So to summarize a bit, I can keep 16x factor and < alignment optimisation >.

      From: Didier Galardon [mailto:didier22@users.sf.net]
      Sent: lundi 07 novembre 2016 16:40
      To: [foobar2000-wasap2-output:tickets]
      Subject: [foobar2000-wasap2-output:tickets] #8 Sample buffer compute logic,
      and selection of custom channel mapping

      Hello artnow,

      In your case, the cache size should not change wether you disable or not
      "alignment optimization". The only difference on the cache size that could
      occur in theory when changing "alignment optimization" option is when the
      calculated cache size (sample cache factor x endpoint buffer size) is not a
      multiple of the chunk size (e.g. endpoint size=64, chunk size=1024,cache
      factor=100): when "alignment optimisation" is enabled, asio2 plugin adjusts
      the cache size in order to make it a multiple of both the endpoint buffer
      size and the input chunk maximum size, whereas when "alignment optimisation"
      is disabled, it keeps the calculated cache size as is. (by the way, there is
      a bug on the adjustment that I need to fix in the next version, but I set
      this aside for now)

      I understand that you have 2 types of input: youtube streaming and Flac. the
      input chunk size vary depending on the type of input: e.g for 1024 or .wav,
      4096 for flac,..) when switching from one track in a given format to another
      track in another format, asio2 plugin reopen the driver and reinitialize
      automatically the sample cache. In your case, considering that you have a 8x
      sample cache factor when you listen to Youtube input (chunk size = 1024),
      the cache size will be 8192 (8 x endpoint buffer size). Then when you switch
      to a flac input track (chunk size = 4096), the cache size is changed
      automatically to 3 * 4096 (minimum sample cache size is automatically
      adjusted to 3 x chunk size by asio2 plugin), because your configured cache
      size (8192) is not large enough for flac huge samples. When you change the
      sample cache factor to x 16, automatic adjustment is not necessary.

      Then, again, you should be able to keep the "alignment optimisation"
      enabled. Just one word concerning this option: In general it is better for
      SQ to keep this option enabled, but, depending on your type of input, it may
      be necessary to disable it. Typically, when listening to input format whose
      chunk size may dynamically increase over time (e.g. MP3), asio2 plugin is
      not able to manage cache/chunk alignment, because it assumes that the input
      track chunk maximum size will be the size of the first chunk received.
      Playback will fail with an explicit error message in that case.

      Finally, you are right concerning the custom ASIO channel mapping: I have
      not implemented it yet in ASIO2.

      Regards,

      Didier


      [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
      Sample buffer compute logic, and selection of custom channel mapping

      Status: open
      Milestone: 1.0
      Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
      Last Updated: Mon Nov 07, 2016 11:46 AM UTC
      Owner: Didier Galardon

      Hello Didier,

      Thanks four your software.

      Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
      are lost, what trace logs in Foobar console can show.

      However Il would like to know the logic behind the compute of the sample
      buffer (not the endpoint one).
      For example, I have to manually set a 16x factor and disable "alignment
      optimisation" to have a buffer size that match all playback cases (from
      Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
      ASIO buffer is 1024.

      In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
      samples buffer that fits for Youtube but not for flac. There is lost
      samples.
      If not checked : ASIO2 plugin compute a 12k sample buffer (computer
      minimum), and it's ok.
      So finally I set 16x factor without alignment optimisation, and so a 16384
      sample buffer is computed.

      Is it normal ?

      One additional question : in Foobar, in output selection, it seems that
      ASIO2 do not permit to select any custom ASIO channel mapping.

      Regards,
      AF.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #8

  • Didier Galardon

    Didier Galardon - 2016-11-08

    Hi Artnow,

    yes, you can keep this setting. You can also try with a larger sample cache factor. Today I use the future Asio2 plugin release implementing some code improvements and I get better SQ results with a small endpoint buffer size (e.g. 32 samples) and a relatively large cache size (sample cache factor=1024, i.e. sample cache size = 32k), than with the smallest possible cache size as I advise to use in the plugin documentation.

    Regards,

    Didier

     
    • artnow

      artnow - 2016-11-11

      Hello Didier,

      Just to inform you : I tried today to seek through a 300MB flac file. The
      flac file was exported from Audacity in 16-bit format.

      I begin to read the file, then tried to seek through 2 or 3 times. The sound
      begins to stutter, then it Foobar crashes (logs attached).

      Don't know if it's due to ASIO2 plugin and its cache/buffering but I prefer
      to inform you.

      Regards,

      AF.

      From: Didier Galardon [mailto:didier22@users.sf.net]
      Sent: mardi 08 novembre 2016 08:55
      To: [foobar2000-wasap2-output:tickets]
      Subject: [foobar2000-wasap2-output:tickets] #8 Sample buffer compute logic,
      and selection of custom channel mapping

      Hi Artnow,

      yes, you can keep this setting. You can also try with a larger sample cache
      factor. Today I use the future Asio2 plugin release implementing some code
      improvements and I get better SQ results with a small endpoint buffer size
      (e.g. 32 samples) and a relatively large cache size (sample cache
      factor=1024, i.e. sample cache size = 32k), than with the smallest possible
      cache size as I advise to use in the plugin documentation.

      Regards,

      Didier


      [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
      Sample buffer compute logic, and selection of custom channel mapping

      Status: open
      Milestone: 1.0
      Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
      Last Updated: Mon Nov 07, 2016 03:40 PM UTC
      Owner: Didier Galardon

      Hello Didier,

      Thanks four your software.

      Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
      are lost, what trace logs in Foobar console can show.

      However Il would like to know the logic behind the compute of the sample
      buffer (not the endpoint one).
      For example, I have to manually set a 16x factor and disable "alignment
      optimisation" to have a buffer size that match all playback cases (from
      Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
      ASIO buffer is 1024.

      In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
      samples buffer that fits for Youtube but not for flac. There is lost
      samples.
      If not checked : ASIO2 plugin compute a 12k sample buffer (computer
      minimum), and it's ok.
      So finally I set 16x factor without alignment optimisation, and so a 16384
      sample buffer is computed.

      Is it normal ?

      One additional question : in Foobar, in output selection, it seems that
      ASIO2 do not permit to select any custom ASIO channel mapping.

      Regards,
      AF.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #8

      • Didier Galardon

        Didier Galardon - 2016-11-22

        Hello Artnow,

        I have uploaded an new release of asio2 plugin. Sample cache management is now more simple than before. your problem when you are seeking through a flac file should not occur anymore. SQ should be improved too. Let me know if you hear a difference.

        Regards,

        Didier

         
        • artnow

          artnow - 2016-11-22

          Hi Didier,

          Thank for your reply.

          I just tested, both with my main soundcard (Focusrite Saffire Pro26) native
          ASIO driver, and my internal soundcard through ASIO4All.

          Both tries leads to crashes (I see < Starting playback >, then Foobar
          crashes).

          Please find attached Foobar dumps.

          Cordialement,

          AF.

          From: Didier Galardon [mailto:didier22@users.sf.net]
          Sent: mardi 22 novembre 2016 18:37
          To: [foobar2000-wasap2-output:tickets]
          Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
          logic, and selection of custom channel mapping

          Hello Artnow,

          I have uploaded an new release of asio2 plugin. Sample cache management is
          now more simple than before. your problem when you are seeking through a
          flac file should not occur anymore. SQ should be improved too. Let me know
          if you hear a difference.

          Regards,

          Didier


          [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
          Sample buffer compute logic, and selection of custom channel mapping

          Status: open
          Milestone: 1.0
          Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
          Last Updated: Tue Nov 08, 2016 07:54 AM UTC
          Owner: Didier Galardon

          Hello Didier,

          Thanks four your software.

          Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
          are lost, what trace logs in Foobar console can show.

          However Il would like to know the logic behind the compute of the sample
          buffer (not the endpoint one).
          For example, I have to manually set a 16x factor and disable "alignment
          optimisation" to have a buffer size that match all playback cases (from
          Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
          ASIO buffer is 1024.

          In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
          samples buffer that fits for Youtube but not for flac. There is lost
          samples.
          If not checked : ASIO2 plugin compute a 12k sample buffer (computer
          minimum), and it's ok.
          So finally I set 16x factor without alignment optimisation, and so a 16384
          sample buffer is computed.

          Is it normal ?

          One additional question : in Foobar, in output selection, it seems that
          ASIO2 do not permit to select any custom ASIO channel mapping.

          Regards,
          AF.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Tickets: #8

          • Didier Galardon

            Didier Galardon - 2016-11-22
            Hi Artnow,
            
            sorry for this. it seems to be related to a mistake in assembly code offset calculation. I remove the version for now until I fix it.
            
            Regards
            
            Didier
            
             
            • artnow

              artnow - 2016-11-22

              Hi,

              No problem J

              From: Didier Galardon [mailto:didier22@users.sf.net]
              Sent: mardi 22 novembre 2016 20:11
              To: [foobar2000-wasap2-output:tickets]
              Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
              logic, and selection of custom channel mapping

              Hi Artnow,

              sorry for this. it seems to be related to a mistake in assembly code offset
              calculation. I remove the version for now until I fix it.

              Regards

              Didier


              [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
              Sample buffer compute logic, and selection of custom channel mapping

              Status: open
              Milestone: 1.0
              Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
              Last Updated: Tue Nov 08, 2016 07:54 AM UTC
              Owner: Didier Galardon

              Hello Didier,

              Thanks four your software.

              Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
              are lost, what trace logs in Foobar console can show.

              However Il would like to know the logic behind the compute of the sample
              buffer (not the endpoint one).
              For example, I have to manually set a 16x factor and disable "alignment
              optimisation" to have a buffer size that match all playback cases (from
              Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
              ASIO buffer is 1024.

              In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
              samples buffer that fits for Youtube but not for flac. There is lost
              samples.
              If not checked : ASIO2 plugin compute a 12k sample buffer (computer
              minimum), and it's ok.
              So finally I set 16x factor without alignment optimisation, and so a 16384
              sample buffer is computed.

              Is it normal ?

              One additional question : in Foobar, in output selection, it seems that
              ASIO2 do not permit to select any custom ASIO channel mapping.

              Regards,
              AF.


              Sent from sourceforge.net because you indicated interest in
              https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

              To unsubscribe from further messages, please visit
              https://sourceforge.net/auth/subscriptions/

               

              Related

              Tickets: #8

              • Didier Galardon

                Didier Galardon - 2016-11-22

                Hi,
                Normally the bug should be fixed with the attached patch.
                May you give it a try if you have time, before I upload it for everybody ? (I could not reproduce the crash by myself because it occurs when AVX is not supported and I have AVX)

                Regards,

                Didier

                 
                • artnow

                  artnow - 2016-11-22

                  Hi,

                  Yes. I can test tomorrow.

                  But it seems there is no attachment J

                  From: Didier Galardon [mailto:didier22@users.sf.net]
                  Sent: mercredi 23 novembre 2016 00:24
                  To: [foobar2000-wasap2-output:tickets]
                  Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
                  logic, and selection of custom channel mapping

                  Hi,
                  Normally the bug should be fixed with the attached patch.
                  May you give it a try if you have time, before I upload it for everybody ?
                  (I could not reproduce the crash by myself because it occurs when AVX is not
                  supported and I have AVX)

                  Regards,

                  Didier


                  [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
                  Sample buffer compute logic, and selection of custom channel mapping

                  Status: open
                  Milestone: 1.0
                  Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
                  Last Updated: Tue Nov 08, 2016 07:54 AM UTC
                  Owner: Didier Galardon

                  Hello Didier,

                  Thanks four your software.

                  Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
                  are lost, what trace logs in Foobar console can show.

                  However Il would like to know the logic behind the compute of the sample
                  buffer (not the endpoint one).
                  For example, I have to manually set a 16x factor and disable "alignment
                  optimisation" to have a buffer size that match all playback cases (from
                  Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
                  ASIO buffer is 1024.

                  In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
                  samples buffer that fits for Youtube but not for flac. There is lost
                  samples.
                  If not checked : ASIO2 plugin compute a 12k sample buffer (computer
                  minimum), and it's ok.
                  So finally I set 16x factor without alignment optimisation, and so a 16384
                  sample buffer is computed.

                  Is it normal ?

                  One additional question : in Foobar, in output selection, it seems that
                  ASIO2 do not permit to select any custom ASIO channel mapping.

                  Regards,
                  AF.


                  Sent from sourceforge.net because you indicated interest in
                  https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

                  To unsubscribe from further messages, please visit
                  https://sourceforge.net/auth/subscriptions/

                   

                  Related

                  Tickets: #8

                  • Didier Galardon

                    Didier Galardon - 2016-11-23

                    Hi,
                    the attachment is the asio plugin dll foo_out_asio2.dll. I have attached it to my previous answer. I do it again here. Let me now if you have it. If not I will upload it as for a normal release

                    Regards

                    Didier

                     
                    • artnow

                      artnow - 2016-11-23

                      Hi Dider,

                      Sorry, I had not see the attachment on SF.

                      So, with the new version of the dll :

                      • No crash anymore

                      • But it seems, there is some issues in buffer transfer : for
                        content @48kHz everything seems to work fine, but for 44.1kHz the sound is
                        very choppy and play slower than expected

                      o I attached the console log (but see any difference)

                      • I don't tested yet on my main sound system, so I cannot
                        pronounce myself on SQ for the moment

                      Regards,

                      AF.

                      From: Didier Galardon [mailto:didier22@users.sf.net]
                      Sent: mercredi 23 novembre 2016 07:49
                      To: [foobar2000-wasap2-output:tickets]
                      Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
                      logic, and selection of custom channel mapping

                      Hi,
                      the attachment is the asio plugin dll foo_out_asio2.dll. I have attached it
                      to my previous answer. I do it again here. Let me now if you have it. If not
                      I will upload it as for a normal release

                      Regards

                       
                      • Didier Galardon

                        Didier Galardon - 2016-11-23

                        ok . thanks for the feedback. I can reproduce the problem using the same youtube tracks than yours. I will check this

                        Regards

                         
                        • Didier Galardon

                          Didier Galardon - 2016-11-23

                          I hope this attached patch will be better. The problem was not related to the track sample rate but to the fact that the size of input chunks was stable for the first track whereas it changed continuously for the second track, which yields the bug in the plugin.

                          Regards

                           
                          • artnow

                            artnow - 2016-11-23

                            Hi Didier,

                            I'll made new test this evening and let you know.
                            For my info, in case of variable Foobar chunk size, you make a variable padding up to the calculated buffer size, rig ht  ?

                            ----- Mail original -----

                            De: "Didier Galardon" didier22@users.sf.net
                            À: "[foobar2000-wasap2-output:tickets]" 8@tickets.foobar2000-wasap2-output.p.re.sf.net
                            Envoyé: Mercredi 23 Novembre 2016 14:53:23
                            Objet: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

                            I hope this attached patch will be better. The problem was not related to the track sample rate but to the fact that the size of input chunks was stable for the first track whereas it changed continuously for the second track, which yields the bug in the plugin.
                            Regards

                            [tickets:#8] Sample buffer compute logic, and selection of custom channel mapping
                            Status: open
                            Milestone: 1.0
                            Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
                            Last Updated: Tue Nov 08, 2016 07:54 AM UTC
                            Owner: Didier Galardon
                            Hello Didier,
                            Thanks four your software.
                            Indeed, ASIO2 has a better SQ than official plugin, especially if no samples are lost, what trace logs in Foobar console can show.
                            However Il would like to know the logic behind the compute of the sample buffer (not the endpoint one).
                            For example, I have to manually set a 16x factor and disable "alignment optimisation" to have a buffer size that match all playback cases (from Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
                            ASIO buffer is 1024.
                            In case "alignment optimisation" is checked, with a 8x factor, I get a 8192 samples buffer that fits for Youtube but not for flac. There is lost samples.
                            If not checked : ASIO2 plugin compute a 12k sample buffer (computer minimum), and it's ok.
                            So finally I set 16x factor without alignment optimisation, and so a 16384 sample buffer is computed.
                            Is it normal ?
                            One additional question : in Foobar, in output selection, it seems that ASIO2 do not permit to select any custom ASIO channel mapping.
                            Regards,
                            AF.

                            Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
                            To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

                             

                            Related

                            Tickets: #8

                            • Didier Galardon

                              Didier Galardon - 2016-11-23

                              Hi Artnow,
                              There is different way to manage chunk size variation. When this is only the last chunk or the first chunk of a track whose differ from the others (as it may occur with FLAC, WAV or MP3 input), thus chunk is padded in order to keep the sample cache record size constant. When chunk size varies in the middle of a track (as it was the case for your second youtube track) or when chunk size is not aligned on the endpoint buffer size, a secondary buffer is used : when this buffer is filled with chunks, it is written to the sample cache

                              Regards

                              Didier

                               
                              • artnow

                                artnow - 2016-11-23

                                Hi Didier,

                                I'm currently testing your latest patch.

                                For the moment, this works quite perfectly J

                                What I also remarked :

                                • Seeking : after the position slider is moved, some samples from
                                  previous position are still heard, then suddenly samples of the new position
                                  are heard

                                o Maybe this could be fixed by change on flush code ?

                                • Buffer calculation : with manual settings (factor : 16, endpoint
                                  : 1024), the calculation leads to 49152 sample cache size (ie. minimum
                                  computed cache size)

                                Anyway SQ is very very good. Well done !

                                I'm currently testing with my studio headphones. I'll test by end of the
                                week on my main system.

                                Could you be also interested by < perfect null test > ? (file played through
                                Foobar/Asio2, recorded from soundcard digital loopback input, then recorded
                                content is time aligned/phase inversed/mixed back to original to check for
                                any residue).

                                Regards,

                                AF.

                                From: Didier Galardon [mailto:didier22@users.sf.net]
                                Sent: mercredi 23 novembre 2016 18:15
                                To: [foobar2000-wasap2-output:tickets]
                                Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
                                logic, and selection of custom channel mapping

                                Hi Artnow,
                                There is different way to manage chunk size variation. When this is only the
                                last chunk or the first chunk of a track whose differ from the others (as it
                                may occur with FLAC, WAV or MP3 input), thus chunk is padded in order to
                                keep the sample cache record size constant. When chunk size varies in the
                                middle of a track (as it was the case for your second youtube track) or when
                                chunk size is not aligned on the endpoint buffer size, a secondary buffer is
                                used : when this buffer is filled with chunks, it is written to the sample
                                cache

                                Regards

                                Didier


                                [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
                                Sample buffer compute logic, and selection of custom channel mapping

                                Status: open
                                Milestone: 1.0
                                Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
                                Last Updated: Tue Nov 08, 2016 07:54 AM UTC
                                Owner: Didier Galardon

                                Hello Didier,

                                Thanks four your software.

                                Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
                                are lost, what trace logs in Foobar console can show.

                                However Il would like to know the logic behind the compute of the sample
                                buffer (not the endpoint one).
                                For example, I have to manually set a 16x factor and disable "alignment
                                optimisation" to have a buffer size that match all playback cases (from
                                Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
                                ASIO buffer is 1024.

                                In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
                                samples buffer that fits for Youtube but not for flac. There is lost
                                samples.
                                If not checked : ASIO2 plugin compute a 12k sample buffer (computer
                                minimum), and it's ok.
                                So finally I set 16x factor without alignment optimisation, and so a 16384
                                sample buffer is computed.

                                Is it normal ?

                                One additional question : in Foobar, in output selection, it seems that
                                ASIO2 do not permit to select any custom ASIO channel mapping.

                                Regards,
                                AF.


                                Sent from sourceforge.net because you indicated interest in
                                https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

                                To unsubscribe from further messages, please visit
                                https://sourceforge.net/auth/subscriptions/

                                 

                                Related

                                Tickets: #8

  • artnow

    artnow - 2016-11-23

    Also, in later releases, would it be possible to < dynamically > take into
    account change in ASIO driver without having to restart playback ?

    I mean for example change in ASIO buffer size (endpoint buffer size) ?

    From: Arnaud Fioravanti [mailto:arnaud.fioravanti@free.fr]
    Sent: mercredi 23 novembre 2016 20:12
    To: '[foobar2000-wasap2-output:tickets] '
    Subject: RE: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
    logic, and selection of custom channel mapping

    Hi Didier,

    I'm currently testing your latest patch.

    For the moment, this works quite perfectly J

    What I also remarked :

    • Seeking : after the position slider is moved, some samples from
      previous position are still heard, then suddenly samples of the new position
      are heard

    o Maybe this could be fixed by change on flush code ?

    • Buffer calculation : with manual settings (factor : 16, endpoint
      : 1024), the calculation leads to 49152 sample cache size (ie. minimum
      computed cache size)

    Anyway SQ is very very good. Well done !

    I'm currently testing with my studio headphones. I'll test by end of the
    week on my main system.

    Could you be also interested by < perfect null test > ? (file played through
    Foobar/Asio2, recorded from soundcard digital loopback input, then recorded
    content is time aligned/phase inversed/mixed back to original to check for
    any residue).

    Regards,

    AF.

    From: Didier Galardon [mailto:didier22@users.sf.net]
    Sent: mercredi 23 novembre 2016 18:15
    To: [foobar2000-wasap2-output:tickets]
    Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
    logic, and selection of custom channel mapping

    Hi Artnow,
    There is different way to manage chunk size variation. When this is only the
    last chunk or the first chunk of a track whose differ from the others (as it
    may occur with FLAC, WAV or MP3 input), thus chunk is padded in order to
    keep the sample cache record size constant. When chunk size varies in the
    middle of a track (as it was the case for your second youtube track) or when
    chunk size is not aligned on the endpoint buffer size, a secondary buffer is
    used : when this buffer is filled with chunks, it is written to the sample
    cache

    Regards

    Didier


    [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
    Sample buffer compute logic, and selection of custom channel mapping

    Status: open
    Milestone: 1.0
    Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
    Last Updated: Tue Nov 08, 2016 07:54 AM UTC
    Owner: Didier Galardon

    Hello Didier,

    Thanks four your software.

    Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
    are lost, what trace logs in Foobar console can show.

    However Il would like to know the logic behind the compute of the sample
    buffer (not the endpoint one).
    For example, I have to manually set a 16x factor and disable "alignment
    optimisation" to have a buffer size that match all playback cases (from
    Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
    ASIO buffer is 1024.

    In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
    samples buffer that fits for Youtube but not for flac. There is lost
    samples.
    If not checked : ASIO2 plugin compute a 12k sample buffer (computer
    minimum), and it's ok.
    So finally I set 16x factor without alignment optimisation, and so a 16384
    sample buffer is computed.

    Is it normal ?

    One additional question : in Foobar, in output selection, it seems that
    ASIO2 do not permit to select any custom ASIO channel mapping.

    Regards,
    AF.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Tickets: #8

  • artnow

    artnow - 2016-11-23

    Hi Didier,

    I just try to play a mp3 file with very little chunk size (47 samples).

    There is sound skips (I test with Audacity + ASIO and it's ok).

    Here is an extract of the MP3 and console log.

    From: Arnaud Fioravanti [mailto:arnaud.fioravanti@free.fr]
    Sent: mercredi 23 novembre 2016 20:12
    To: '[foobar2000-wasap2-output:tickets] '
    Subject: RE: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
    logic, and selection of custom channel mapping

    Hi Didier,

    I'm currently testing your latest patch.

    For the moment, this works quite perfectly J

    What I also remarked :

    • Seeking : after the position slider is moved, some samples from
      previous position are still heard, then suddenly samples of the new position
      are heard

    o Maybe this could be fixed by change on flush code ?

    • Buffer calculation : with manual settings (factor : 16, endpoint
      : 1024), the calculation leads to 49152 sample cache size (ie. minimum
      computed cache size)

    Anyway SQ is very very good. Well done !

    I'm currently testing with my studio headphones. I'll test by end of the
    week on my main system.

    Could you be also interested by < perfect null test > ? (file played through
    Foobar/Asio2, recorded from soundcard digital loopback input, then recorded
    content is time aligned/phase inversed/mixed back to original to check for
    any residue).

    Regards,

    AF.

    From: Didier Galardon [mailto:didier22@users.sf.net]
    Sent: mercredi 23 novembre 2016 18:15
    To: [foobar2000-wasap2-output:tickets]
    Subject: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute
    logic, and selection of custom channel mapping

    Hi Artnow,
    There is different way to manage chunk size variation. When this is only the
    last chunk or the first chunk of a track whose differ from the others (as it
    may occur with FLAC, WAV or MP3 input), thus chunk is padded in order to
    keep the sample cache record size constant. When chunk size varies in the
    middle of a track (as it was the case for your second youtube track) or when
    chunk size is not aligned on the endpoint buffer size, a secondary buffer is
    used : when this buffer is filled with chunks, it is written to the sample
    cache

    Regards

    Didier


    [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
    Sample buffer compute logic, and selection of custom channel mapping

    Status: open
    Milestone: 1.0
    Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
    Last Updated: Tue Nov 08, 2016 07:54 AM UTC
    Owner: Didier Galardon

    Hello Didier,

    Thanks four your software.

    Indeed, ASIO2 has a better SQ than official plugin, especially if no samples
    are lost, what trace logs in Foobar console can show.

    However Il would like to know the logic behind the compute of the sample
    buffer (not the endpoint one).
    For example, I have to manually set a 16x factor and disable "alignment
    optimisation" to have a buffer size that match all playback cases (from
    Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
    ASIO buffer is 1024.

    In case "alignment optimisation" is checked, with a 8x factor, I get a 8192
    samples buffer that fits for Youtube but not for flac. There is lost
    samples.
    If not checked : ASIO2 plugin compute a 12k sample buffer (computer
    minimum), and it's ok.
    So finally I set 16x factor without alignment optimisation, and so a 16384
    sample buffer is computed.

    Is it normal ?

    One additional question : in Foobar, in output selection, it seems that
    ASIO2 do not permit to select any custom ASIO channel mapping.

    Regards,
    AF.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Tickets: #8

    • Didier Galardon

      Didier Galardon - 2016-11-24

      Hi Artnow,

      I think that the problem with the MP3 file is related to the fact that is a mono channel track. I take a look at this today as for the other points.

      Regards,

      Didier

       
    • Didier Galardon

      Didier Galardon - 2016-11-24

      Hi Artnow,

      Thank you again for your feedback wich really helps me to improve the plugin.
      The bug related to mono channel management which occured with your last MP3 file should be fixed with the attached patch.
      Also, now I pad the sample cache with silence when seeking.
      Then, calculation of the minimum sample cache size takes now into account the current chunk size instead of the maximum one (16k) used only when chunk size varies too much. (you are really accurate in your observations ! :-))
      What is your purpose concerning your proposal to change dynamically endpoint setting .? I am a bit reluctant to implement this because this requires to reinit the asio driver, flush the sample cache , and so on.., . moreover, Il will need to add code to check regularly for config context changes during playback whereas my logic is to keep playback instruction path as straighforward as possible.

      concerning < perfect null test > : yes , I am interested, but you will have to explain me how to used it !

      Regards

      Didier

       
      • artnow

        artnow - 2016-11-24

        Hi Didier,

        You're welcomed. Your Foobar plugins are very useful and I support every tentative to improve audio quality ;)
        I'll pursue my tes ts and let you know.

        For the endpoint and ASIO buffer setting : currently it's a "nice to have" feature. But basically, most of ASIO soundcards' drivers configuration panel have a setting to change ASIO buffer size (and many other settings).
        Currently this setting can be set in ASIO2 a dvanced config, or in ASIO panel of the soundcard. But it has to be done when no audio s tream are playing.
        It could be handy to change the ASIO endpoint buffer from the souncard's config so it is taken in account by ASIO2 plugin without to have to stop playing and restart the stream .
        I'm not so familiar with ASIO api, but I thank there is a kind of callback function so it's not necessary to poll the status regularly.

        For the perfect null test (PN T), its purpose is to check digital path "purity" (bitperfect is bitperfect !).
        If the digital path is really bit perfect, a played  digital content and its  time-aligned and  phase-re versed recorded content  results in null/ silence when summed together.  

        For example, 2 or 3 weeks ago, I discover that my digital path alter the signal !

        I previously use SPDIF output of my soundcard, linked in SPDIF to a SRC-2496 (for AES/EBU conversion), itself linked in AES/EBU to my digital processor (BSS 366).
        I first made a PNT making a loopback between SPDIF in and out . This results in perfect null.
        I after made a PNT using the digital output of the SRC. This result in digital noise (tiny but existent ). Zooming at the signal in Audacity show slight differences in sample position .

        So currently, I use analog outputs which show less noise... a nd indeed, the sound is better.

        Regards,
        AF.

        ----- Mail original -----

        De: "Didier Galardon" didier22@users.sf.net
        À: "[foobar2000-wasap2-output:tickets]" 8@tickets.foobar2000-wasap2-output.p.re.sf.net
        Envoyé: Jeudi 24 Novembre 2016 14:11:11
        Objet: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

        Hi Artnow,
        Thank you again for your feedback wich really helps me to improve the plugin.
        The bug related to mono channel management which occured with your last MP3 file should be fixed with the attached patch.
        Also, now I pad the sample cache with silence when seeking.
        Then, calculation of the minimum sample cache size takes now into account the current chunk size instead of the maximum one (16k) used only when chunk size varies too much. (you are really accurate in your observations ! :-))
        What is your purpose concerning your proposal to change dynamically endpoint setting .? I am a bit reluctant to implement this because this requires to reinit the asio driver, flush the sample cache , and so on.., . moreover, Il will need to add code to check regularly for config context changes during playback whereas my logic is to keep playback instruction path as straighforward as possible.
        concerning < perfect null test > : yes , I am interested, but you will have to explain me how to used it !
        Regards
        Didier

        [tickets:#8] Sample buffer compute logic, and selection of custom channel mapping
        Status: open
        Milestone: 1.0
        Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
        Last Updated: Tue Nov 08, 2016 07:54 AM UTC
        Owner: Didier Galardon
        Hello Didier,
        Thanks four your software.
        Indeed, ASIO2 has a better SQ than official plugin, especially if no samples are lost, what trace logs in Foobar console can show.
        However Il would like to know the logic behind the compute of the sample buffer (not the endpoint one).
        For example, I have to manually set a 16x factor and disable "alignment optimisation" to have a buffer size that match all playback cases (from Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
        ASIO buffer is 1024.
        In case "alignment optimisation" is checked, with a 8x factor, I get a 8192 samples buffer that fits for Youtube but not for flac. There is lost samples.
        If not checked : ASIO2 plugin compute a 12k sample buffer (computer minimum), and it's ok.
        So finally I set 16x factor without alignment optimisation, and so a 16384 sample buffer is computed.
        Is it normal ?
        One additional question : in Foobar, in output selection, it seems that ASIO2 do not permit to select any custom ASIO channel mapping.
        Regards,
        AF.

        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/
        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

        Related

        Tickets: #8

        • artnow

          artnow - 2016-11-24

          Hi Didier,

          I just tested your latest patch. So, basically :

          • Playback of mono content works fine

          • Silence when seeking is ok

          • However the minimum buffer size calculation seems to not be « fixed »

          Regards,

          AF.

          From: arnaud.fioravanti@free.fr [mailto:arnaud.fioravanti@free.fr]
          Sent: jeudi 24 novembre 2016 15:03
          To: [foobar2000-wasap2-output:tickets]
          Subject: Re: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

          Hi Didier,

          You're welcomed. Your Foobar plugins are very useful and I support every tentative to improve audio quality ;)

          I'll pursue my tests and let you know.

          For the endpoint and ASIO buffer setting : currently it's a "nice to have" feature. But basically, most of ASIO soundcards' drivers configuration panel have a setting to change ASIO buffer size (and many other settings).

          Currently this setting can be set in ASIO2 advanced config, or in ASIO panel of the soundcard. But it has to be done when no audio stream are playing.

          It could be handy to change the ASIO endpoint buffer from the souncard's config so it is taken in account by ASIO2 plugin without to have to stop playing and restart the stream.

          I'm not so familiar with ASIO api, but I thank there is a kind of callback function so it's not necessary to poll the status regularly.

          For the perfect null test (PNT), its purpose is to check digital path "purity" (bitperfect is bitperfect !).

          If the digital path is really bitperfect, a played digital content and its time-aligned and phase-reversed recorded content results in null/silence when summed together.

          For example, 2 or 3 weeks ago, I discover that my digital path alter the signal !

          I previously use SPDIF output of my soundcard, linked in SPDIF to a SRC-2496 (for AES/EBU conversion), itself linked in AES/EBU to my digital processor (BSS366).

          I first made a PNT making a loopback between SPDIF in and out. This results in perfect null.

          I after made a PNT using the digital output of the SRC. This result in digital noise (tiny but existent). Zooming at the signal in Audacity show slight differences in sample position.

          So currently, I use analog outputs which show less noise... and indeed, the sound is better.

          Regards,
          AF.


          De: "Didier Galardon" <didier22@users.sf.net <a="" href="mailto:didier22@users.sf.net">didier22@users.sf.net >
          À: "[foobar2000-wasap2-output:tickets]" <8@tickets.foobar2000-wasap2-output.p.re.sf.net 8@tickets.foobar2000-wasap2-output.p.re.sf.net >
          Envoyé: Jeudi 24 Novembre 2016 14:11:11
          Objet: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

          Hi Artnow,

          Thank you again for your feedback wich really helps me to improve the plugin.
          The bug related to mono channel management which occured with your last MP3 file should be fixed with the attached patch.
          Also, now I pad the sample cache with silence when seeking.
          Then, calculation of the minimum sample cache size takes now into account the current chunk size instead of the maximum one (16k) used only when chunk size varies too much. (you are really accurate in your observations ! :-))
          What is your purpose concerning your proposal to change dynamically endpoint setting .? I am a bit reluctant to implement this because this requires to reinit the asio driver, flush the sample cache , and so on.., . moreover, Il will need to add code to check regularly for config context changes during playback whereas my logic is to keep playback instruction path as straighforward as possible.

          concerning < perfect null test > : yes , I am interested, but you will have to explain me how to used it !

          Regards

          Didier


          [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/ Sample buffer compute logic, and selection of custom channel mapping

          Status: open
          Milestone: 1.0
          Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
          Last Updated: Tue Nov 08, 2016 07:54 AM UTC
          Owner: Didier Galardon

          Hello Didier,

          Thanks four your software.

          Indeed, ASIO2 has a better SQ than official plugin, especially if no samples are lost, what trace logs in Foobar console can show.

          However Il would like to know the logic behind the compute of the sample buffer (not the endpoint one).
          For example, I have to manually set a 16x factor and disable "alignment optimisation" to have a buffer size that match all playback cases (from Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
          ASIO buffer is 1024.

          In case "alignment optimisation" is checked, with a 8x factor, I get a 8192 samples buffer that fits for Youtube but not for flac. There is lost samples.
          If not checked : ASIO2 plugin compute a 12k sample buffer (computer minimum), and it's ok.
          So finally I set 16x factor without alignment optimisation, and so a 16384 sample buffer is computed.

          Is it normal ?

          One additional question : in Foobar, in output selection, it seems that ASIO2 do not permit to select any custom ASIO channel mapping.

          Regards,
          AF.


          Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

          To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

           

          Related

          Tickets: #8

  • artnow

    artnow - 2016-11-24

    One other thing : when doing « pause », the sound doesn’t stop immediately.

    Nonetheless, « pause » to « play » has no delay.

    From: Arnaud Fioravanti [mailto:arnaud.fioravanti@free.fr]
    Sent: jeudi 24 novembre 2016 21:52
    To: '[foobar2000-wasap2-output:tickets]'
    Subject: RE: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

    Hi Didier,

    I just tested your latest patch. So, basically :

    • Playback of mono content works fine

    • Silence when seeking is ok

    • However the minimum buffer size calculation seems to not be « fixed »

    Regards,

    AF.

    From: arnaud.fioravanti@free.fr arnaud.fioravanti@free.fr [mailto:arnaud.fioravanti@free.fr]
    Sent: jeudi 24 novembre 2016 15:03
    To: [foobar2000-wasap2-output:tickets]
    Subject: Re: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

    Hi Didier,

    You're welcomed. Your Foobar plugins are very useful and I support every tentative to improve audio quality ;)

    I'll pursue my tests and let you know.

    For the endpoint and ASIO buffer setting : currently it's a "nice to have" feature. But basically, most of ASIO soundcards' drivers configuration panel have a setting to change ASIO buffer size (and many other settings).

    Currently this setting can be set in ASIO2 advanced config, or in ASIO panel of the soundcard. But it has to be done when no audio stream are playing.

    It could be handy to change the ASIO endpoint buffer from the souncard's config so it is taken in account by ASIO2 plugin without to have to stop playing and restart the stream.

    I'm not so familiar with ASIO api, but I thank there is a kind of callback function so it's not necessary to poll the status regularly.

    For the perfect null test (PNT), its purpose is to check digital path "purity" (bitperfect is bitperfect !).

    If the digital path is really bitperfect, a played digital content and its time-aligned and phase-reversed recorded content results in null/silence when summed together.

    For example, 2 or 3 weeks ago, I discover that my digital path alter the signal !

    I previously use SPDIF output of my soundcard, linked in SPDIF to a SRC-2496 (for AES/EBU conversion), itself linked in AES/EBU to my digital processor (BSS366).

    I first made a PNT making a loopback between SPDIF in and out. This results in perfect null.

    I after made a PNT using the digital output of the SRC. This result in digital noise (tiny but existent). Zooming at the signal in Audacity show slight differences in sample position.

    So currently, I use analog outputs which show less noise... and indeed, the sound is better.

    Regards,
    AF.


    De: "Didier Galardon" <didier22@users.sf.net <a="" href="mailto:didier22@users.sf.net">didier22@users.sf.net >
    À: "[foobar2000-wasap2-output:tickets]" <8@tickets.foobar2000-wasap2-output.p.re.sf.net 8@tickets.foobar2000-wasap2-output.p.re.sf.net >
    Envoyé: Jeudi 24 Novembre 2016 14:11:11
    Objet: [foobar2000-wasap2-output:tickets] Re: #8 Sample buffer compute logic, and selection of custom channel mapping

    Hi Artnow,

    Thank you again for your feedback wich really helps me to improve the plugin.
    The bug related to mono channel management which occured with your last MP3 file should be fixed with the attached patch.
    Also, now I pad the sample cache with silence when seeking.
    Then, calculation of the minimum sample cache size takes now into account the current chunk size instead of the maximum one (16k) used only when chunk size varies too much. (you are really accurate in your observations ! :-))
    What is your purpose concerning your proposal to change dynamically endpoint setting .? I am a bit reluctant to implement this because this requires to reinit the asio driver, flush the sample cache , and so on.., . moreover, Il will need to add code to check regularly for config context changes during playback whereas my logic is to keep playback instruction path as straighforward as possible.

    concerning < perfect null test > : yes , I am interested, but you will have to explain me how to used it !

    Regards

    Didier


    [tickets:#8] https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/ Sample buffer compute logic, and selection of custom channel mapping

    Status: open
    Milestone: 1.0
    Created: Mon Nov 07, 2016 11:46 AM UTC by artnow
    Last Updated: Tue Nov 08, 2016 07:54 AM UTC
    Owner: Didier Galardon

    Hello Didier,

    Thanks four your software.

    Indeed, ASIO2 has a better SQ than official plugin, especially if no samples are lost, what trace logs in Foobar console can show.

    However Il would like to know the logic behind the compute of the sample buffer (not the endpoint one).
    For example, I have to manually set a 16x factor and disable "alignment optimisation" to have a buffer size that match all playback cases (from Youtube plugin, from the flac plugin @44.1 kHz) without lost samples.
    ASIO buffer is 1024.

    In case "alignment optimisation" is checked, with a 8x factor, I get a 8192 samples buffer that fits for Youtube but not for flac. There is lost samples.
    If not checked : ASIO2 plugin compute a 12k sample buffer (computer minimum), and it's ok.
    So finally I set 16x factor without alignment optimisation, and so a 16384 sample buffer is computed.

    Is it normal ?

    One additional question : in Foobar, in output selection, it seems that ASIO2 do not permit to select any custom ASIO channel mapping.

    Regards,
    AF.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/foobar2000-wasap2-output/tickets/8/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Tickets: #8

    • Didier Galardon

      Didier Galardon - 2016-11-25

      Hi Artnow,

      about minimum sample cache size calculation : From my standpoint, it works as expected:
      sample cache size is equals to the configured factor multiplicated by the endpoint buffer size, but if this value lower than the minimum sample cache size=3 times the nominal chunk size, effective cache size is set to the latter. Here we have 2 cases:
      - either the effective chunk size is greater than the endpoint buffer size, aligned on it, and don't vary in the middle of the track: in that case the effective chunk size is used for minimal cache size calculation. Also, if the configured cache size (factor x endpoint buffer size) is not aligned on the chunk size, it is slighlty increased to the upper chunk size multiple.
      - or, the effective chunk size is lower than the endpoint buffer size, or not aligned on it, or varies in the middle of the track: in that case I don't used the effective chunk size for minimal cache size calculation, but the secondary buffer size instead. At the moment, the secondary buffer size is set to a constant value = 16384 samples, which explains that calculated minimal cache size is 49152

      size of the secondary buffer is arbitrarily set to 16384, which is a bit huge, in order to make sure that the secondary buffer is large enough to contain a full chunk. this is also the reason why there is a delay when you are doing pause, considering that the rendering asio thread which reads the sample cache doesn't stop as long as there is something to read in the sample cache (and I dont' whant to add some extra check in this procedure).

      If delay when pausing is annoying, I could make the secondary buffer size configurable: when set to e.g. 2048, pause delay is not noticable anymore.

      Regards,

      Didier

       
1 2 > >> (Page 1 of 2)

Log in to post a comment.