Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th May 2016, 04:15   #281
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Koopa View Post
Will add this to Backup Tool.
Thank you, Koopa.
Quote:
Originally Posted by Koopa View Post
out_yasapi.ini is the only config file?
The name of the config file depends on the plugin:
  • out_yasapi.dll -> out_yasapi.ini
  • out_yasapi-sse2.dll -> out_yasapi-sse2.ini
  • out_yasapi-debug.dll -> out_yasapi-debug.ini

Last edited by pbelkner; 13th May 2016 at 05:38.
pbelkner is offline   Reply With Quote
Old 16th May 2016, 06:50   #282
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.5.0

Quote:
Originally Posted by chros View Post
Any news about including the Default Sound device in the device list?
What's new?
  • The Default Device is listed in the respective configuration dialog's drop down box as an option to choose.
  • In case the Default Device is choosen from the drop down box (and saved),
    • the configuration is saved for the physical device which was configured at the time (configuration time) as Default Device from Window's System Control when the configuration was loaded to the dialog,
    • each time a new track starts, the physical device configured at this time (play time) as Default Device from Window's System Control is used to play the track (please note that this device may differ from the one configured at configuration time).

Please note that this is a complete re-write. Everything was thrown into peaces, something into larger building blocks and something into dust. The larger building blocks, which greatly remained intakt, could be re-used. The dust had to be thrown away and substituted by a new development. Please be careful in using this new version, thoroughly test it and re-configure it, if needed.

Links:
pbelkner is offline   Reply With Quote
Old 16th May 2016, 07:52   #283
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Quote:
Originally Posted by pbelkner View Post

What's new?

The Default Device is listed in the respective configuration dialog's drop down box as an option to choose.
In case the Default Device is choosen from the drop down box (and saved),
  • the configuration is saved for the physical device which was configured at the time (configuration time) as Default Device from Window's System Control when the configuration was loaded to the dialog,
  • each time a new track starts, the physical device configured at this time (play time) as Default Device from Window's System Control is used to play the track (please note that this device may differ from the one configured at configuration time).
...
If I'm understanding this correctly and the plug-in's settings are saved for the device configured as the default by Windows (1st bullet above) and that same device is also used to play a track (2nd bullet above), then what is the purpose of the device drop down box in the plug-in's configuration dialog?

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 16th May 2016, 08:22   #284
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
If the device configured as the default by Windows is used to play a track, then what is the purpose of the device drop down box in the plug-in's configuration dialog?
You may change the Window's Default Device under System Control at any time without touching the plugin's configuration.

However, you have to configure each device you potentially plan to use as Window's Default Device beforehand for using with the plugin. As an example consider one device only supporting shared mode and another only supporting exclusive mode. The share mode has to be configured with the plugin. There is no way under System Control. You have to do that beforehand with the plugin. Having done this, you are free for changing the Default Device via Window's System Control at any time.
pbelkner is offline   Reply With Quote
Old 16th May 2016, 08:36   #285
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
You are not making this much clearer.

Are you saying that the default device must be selected in Windows before it can be selected and saved for use by the plug-in with the plug-in's configuration dialog? Then the default device can be changed in Windows, but the plug-in will still use the device previously saved as the default for it's use?

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 16th May 2016, 08:49   #286
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
Are you saying that the default device must be selected in Windows before it can be selected and saved for use by the plug-in with the plug-in's configuration dialog? Then the default device can be changed in Windows, but the plug-in will still use the device previously saved as the default for it's use?
There are per device specific WASAPI options which have to be configured somewhere before the plugin can be used properly with that particular device (i.e. the share mode). This is not possible with Window's System Control.

For that reason, open the plugin's configuration dialog and configure (and save) each device listed. Leave (and save) the dialog with Default Device selected (it doesn't matter which is selected in Window's System Control at that time, this is just the device you are able to configure; another option would have been to make the Default Device un-editable, because the Default Device is just a logical term which may refer to an arbitrary physical device).

Now you are free to choose at any time each device you like from Window's System Control as Default Device.
pbelkner is offline   Reply With Quote
Old 16th May 2016, 09:44   #287
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Ok, the plug-in must be configured (settings selected and saved) for the sound devices that can be selected as the default playback device in Windows, before it can be used to process output for those devices. Once this is done playback will work with the device selected in Windows, which may or may not be the one selected in the plug-in's configuration drop down box when it is loaded at the start of Winamp sessions. Is this correct?

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 16th May 2016, 09:47   #288
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
Ok, the plug-in must be configured (settings selected and saved) for the sound devices that can be selected as the default playback device in Windows, before it can be used to process output for those devices. Once this is done playback will work with the device selected in Windows, which may or may not be the one selected in the plug-in's configuration drop down box when it is loaded at the start of Winamp sessions. Is this correct?
That's exactly what I wanted to say.
pbelkner is offline   Reply With Quote
Old 16th May 2016, 10:29   #289
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Ok, glad I finally got that straight.

However, v1.5.1 (both the plain and sse2 versions) plays perfectly in shared mode, but I still get the exclusive mode issues discussed in post #256 above on my system.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 16th May 2016, 11:13   #290
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
but I still get the exclusive mode issues discussed in post #256 above on my system.
I remember the discussion and that we where unable to resolve it.

Try the debug version with level set to "default". Then start a track. Under the "open" section you'll find a line like
intitializing audio client EXCLUSIVE/PUSH with 30000/0 hns
which should reflect your settings.

When it reads EXCLUSIVE you can be sure that the audio client is initialized with the flag eShareMode set to AUDCLNT_SHAREMODE_EXCLUSIVE. If you don't believe it have a look at "yasapi_strategy.c".

When I test it on my system the DS sound (i.e. the sound of a YT video played with Mozilla) is of course muted immediately when I start playing exclusive mode WASAPI.

As always, you should also consider the WASAPI drivers installed on your system as a cause for unexpected behavior.
pbelkner is offline   Reply With Quote
Old 16th May 2016, 19:37   #291
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Quote:
Originally Posted by pbelkner View Post
...

When I test it on my system the DS sound (i.e. the sound of a YT video played with Mozilla) is of course muted immediately when I start playing exclusive mode WASAPI.

As always, you should also consider the WASAPI drivers installed on your system as a cause for unexpected behavior.
I thought the WASAPI support was in the sound device driver. Are there separate WASPI drivers I should look for?

The debug version's log confirms that v1.5.1 is running in exclusive mode.

If I'm already playing output from Winamp, I hear a video's audio and a rapid clicking noise when I start it playing in my browser.

When I start playback of a video (in YT or any other site) after Winamp is loaded but not playing anything, the sound from the video does stop and the clicking noise does not start when Winamp's playback is started. However, a few seconds later the video playback freezes. If I refresh the browser page, the video starts playing again with it's audio and the clicking sound again being output along with the Winamp playback. At this point, stopping or pausing and then restarting the Winamp playback (even shutting down and restarting Winamp) does not stop the video's audio and the clicking sound.

The options to let the sound device driver take exclusive control are in the Windows sound device utility. Maybe something is interfering with that. I see that the sound level is not being shown in the Windows volume mixer when this plug-in is selected as Winamp's output plug-in.

Version 1.5.1 also does not let me use the Matrix Mixer plug-in to up-mix 2 output channels to 6 channels. It causes distortion and the debug log says that the ring buffer is not large enough (even when set to it's maximum). Version 1.0.6 does not have this issue, so I guess the rewrite has made the plug-in less tolerant of latencies introduced by other plug-ins in the processing string.

So, this plug-in still doesn't fully work in my preferred configuration. I will keep monitoring this thread and maybe a future update will work for me in the way I need it to. I'm glad you decided to keep this project alive.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system

Last edited by Aminifu; 16th May 2016 at 20:38.
Aminifu is offline   Reply With Quote
Old 17th May 2016, 03:55   #292
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
I thought the WASAPI support was in the sound device driver. Are there separate WASPI drivers I should look for?
I meant the device driver's WASAPI support. I shortened this term to WASAPI driver.
pbelkner is offline   Reply With Quote
Old 17th May 2016, 04:59   #293
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.5.3

What's new?
  • Improved dealing with draining the ring buffer and end of track (eot).
Links:
pbelkner is offline   Reply With Quote
Old 17th May 2016, 09:05   #294
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.5.4

What's new?
  • Solved the dead-lock caused by saving the configuration.
Links:
pbelkner is offline   Reply With Quote
Old 17th May 2016, 15:09   #295
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Until the issues with exclusive mode and latencies due to other sound processing plug-ins in my configuration are fixed (if possible), I can use the shared mode of v1.0.6 and the Windows volume mixer to mute sound from what I don't want to hear during Winamp playback.


Quote:
Originally Posted by pbelkner View Post

v1.5.3
What's new?
  • Improved dealing with draining the ring buffer and end of track (eot).
This got me thinking about whether it is possible to add a gapless playback feature. Is draining the ring buffer necessary to detect an eot or can the buffer just be overwritten with the next file in a playlist, if any?

Quote:
Originally Posted by pbelkner View Post

v1.5.4
What's new?
  • Solved the dead-lock caused by saving the configuration.
What dead-lock? Was this something introduced in v1.5.3?

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 17th May 2016, 15:44   #296
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
This got me thinking about whether it is possible to add a gapless playback feature.
I'm thinking about it too. But first I have to know how an input plugin is notified about that another input plugin is chosen, because in that case gapleess has to be broken and control has to given away. "wa_ipc.h" has the line
#define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config
making me hope that it should be possible. Does somebody know how this message could be received by an input plugin?
Quote:
Originally Posted by Aminifu View Post
What dead-lock? Was this something introduced in v1.5.3
It was there since v1.5.0, but it may have been present before the re-write anyway. It could have happened under certain circumstances.
pbelkner is offline   Reply With Quote
Old 17th May 2016, 17:17   #297
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Quote:
Originally Posted by pbelkner View Post
I'm thinking about it too. But first I have to know how an input plugin is notified about that another input plugin is chosen, because in that case gapleess has to be broken and control has to given away. "wa_ipc.h" has the line
#define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config
making me hope that it should be possible. Does somebody know how this message could be received by an input plugin?

...
If you don't get an answer after a reasonable time, it can't hurt to PM thinktink.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 18th May 2016, 13:03   #298
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Hi Peter!

Wooow! What a surprise (default sound device)! Thanks so much!!!!
Good news: the default device is working if winamp is stopped between switching devices! Now I can use your plugin all the time!

I happen to download 1.5.5 , here are the issues with it after a short test:

1. sse2 version crashes Winamp (either if you want to play something or if you hit the config button) , normal version working fine

2. playing winamp (just used shared/push mode) crashes when you switch on the TV (means the default sound device will be changed in windows, previously the AV receiver was the default (although still the AV receiver sounds , confusing, right ? ))
Sanear doesn't have this issue: https://github.com/alexmarsev/sanear
Yesterday I've built a new version from it, you can try it out with any DirectShow player (e.g. MPC-HC, MPC-BE, etc) : https://github.com/alexmarsev/sanear/issues/12

3. I'd like to have a feature request, actually 2, I hope you like them:
a) as Aminifu asked: option for selecting speakers setup to use (default or upmixing to 4/6/x channels)
Right now if I select Quadrophone in the speaker setup (Windows) only the front 2 sounds -> that means windows won't upmix stereo signal to the selected speaker config. Option 1 would be asking wasapi to do so (using the system default speaker config), but Option 2 would be more flexible: do from the plugin itself.
I think it doesn't concern downmixing.
This option can also exist with Exclusive mode as well not just shared one.
Right now I'm talking only about 2 channel audio.
(My AVR only has a 7.1ch music mode: the center also sounds, and I hate it! )
b) This is a pretty neat feature that Sanear has: https://github.com/alexmarsev/sanear...193592d4a927ed
This can wait, it'd just make this awesome plugin better!

Thanks for your development!
chros is offline   Reply With Quote
Old 19th May 2016, 05:08   #299
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
1. sse2 version crashes Winamp (either if you want to play something or if you hit the config button) , normal version working fine
Maybe the cause is that your processor is not SSE2 enabled and that the code executed when it crashes contains SSE2 machine instructions unknown to your processor.

All three versions (normal, SSE2, and debug) are compiled from the exact same sources but with different compiler switches. The normal and debug versions are SSE2 free, the debug version with the debug MACROS and some debug relevant branches in C code enabled. The SSE2 version is exact the same as the normal version just compiled with the compiler switches -arch:SSE and -arch:SSE2 set which generate SSE/SSE2 machine instruction when possible.

The normal version should work on each machine (including SSE2 machines).
pbelkner is offline   Reply With Quote
Old 19th May 2016, 05:50   #300
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
2. playing winamp (just used shared/push mode) crashes when you switch on the TV
Maybe the cause is that the device becomes unavailable immediately by switching to TV.

That's not a scenario for which the current version is designed for. If a device becomes unavailable during playing (e.g. is unplugged) it crashes, that's for sure.

If you change the default device in System Control the plugin plays using the former device until a new track starts. The change in configuration is reflected in that moment when switching to the new track, i.e. the new track starts playing using the newly configured device.
pbelkner is offline   Reply With Quote
Old 19th May 2016, 10:10   #301
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by pbelkner View Post
Maybe the cause is that your processor is not SSE2 enabled and that the code executed when it crashes contains SSE2 machine instructions unknown to your processor.
...
The normal version should work on each machine (including SSE2 machines).
Thanks, I know that (I used sse2 version, as you can see in my older posts).
I just tried an older out_yasapi-sse2-0.8.2 version (that I happen to have on my computer), and it's working fine. But not 1.5.4 or 1.5.5. Have you tried them? (just hit the config button).
And yes, normal version working fine.

Quote:
Originally Posted by pbelkner View Post
Maybe the cause is that the device becomes unavailable immediately by switching to TV.

That's not a scenario for which the current version is designed for. If a device becomes unavailable during playing (e.g. is unplugged) it crashes, that's for sure.
I know, I just wanted to let you know. I can live with that for now.

What are your thoughts about channel duplicating stereo sources? That's the only thing that I'm missing.
chros is offline   Reply With Quote
Old 19th May 2016, 10:26   #302
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
But not 1.5.4 or 1.5.5.
Is some of the 1.5.x SSE2 versions working for you? (I'm using the SSE2 versions on a regular basis and they are working fine for me.)
Quote:
Originally Posted by chros View Post
What are your thoughts about channel duplicating stereo sources? That's the only thing that I'm missing.
Have not thought about it.
pbelkner is offline   Reply With Quote
Old 20th May 2016, 12:41   #303
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by pbelkner View Post
Is some of the 1.5.x SSE2 versions working for you? (I'm using the SSE2 versions on a regular basis and they are working fine for me.)
Good finding: none of them is working for me (I tried all the 6 of them 1.5.0-1.5.5). 1.0.7 ss2 is working fine.
What has been changed between them regarding to sse2?
chros is offline   Reply With Quote
Old 22nd May 2016, 12:06   #304
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.6.0

What's new?
  • Gapless playback.
  • A common option for switching on/off gapless playback (disabled by default).
  • A device option for choosing whether the time offset for gapless playback is maintained as a 64-bit integer value (representing the playback position) or as a 64-bit floating point value (representing the time as quotient taken from the playback position and a frequency). For a deeper understanding regarding position and frequency values you may refer to the documentation of the IAudioClock::GetPosition() and IAudioClock::GetFrequency() methods. We feel that as long as a constant frequency value can be assumed choosing the time offset as beeing maintained as a 64-bit integer value is preferable.
  • A debug version for SSE2.

Links:
pbelkner is offline   Reply With Quote
Old 22nd May 2016, 12:21   #305
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Aminifu View Post
If you don't get an answer after a reasonable time, it can't hurt to PM thinktink.
It's not necessary. I figured it out myself. You have to "subclass" the winamp main window and catch the respective message (it's a combination of uMsg and lParam):
PHP Code:
#if defined (OUT_YASAPI_SUBCLASS) // {
static WNDPROC WinampProc;

static 
LRESULT CALLBACK PluginWinampProc(HWND hWndUINT uMsgWPARAM wParam,
    
LPARAM lParam)
{
  switch (
uMsg) {
  case 
WM_WA_IPC:
    switch (
lParam) {
    case 
IPC_CB_OUTPUTCHANGED:
      
fprintf(stderr,"WM_WA_IPC / IPC_CB_OUTPUTCHANGED\n");
      break;
    default:
      break;
    }

    break;
  case 
IPC_CB_OUTPUTCHANGED:
      
fprintf(stderr,"IPC_CB_OUTPUTCHANGED\n");
    break;
  case 
WM_USER+IPC_CB_OUTPUTCHANGED:
    
fprintf(stderr,"WM_USER + IPC_CB_OUTPUTCHANGED\n");
    break;
  case 
WM_APP+IPC_CB_OUTPUTCHANGED:
    
fprintf(stderr,"WM_APP + IPC_CB_OUTPUTCHANGED\n");
    break;
  default:
    break;
  }

  return 
CallWindowProc(
    
WinampProc,   // _In_ WNDPROC lpPrevWndFunc,
    
hWnd,         // _In_ HWND    hWnd,
    
uMsg,         // _In_ UINT    Msg,
    
wParam,       // _In_ WPARAM  wParam,
    
lParam        // _In_ LPARAM  lParam
  
);
}

static 
int SubclassWinamp(HWND hWndint nDebug)
{
  if (
NULL==hWnd||NULL!=WinampProc) {
    
DMESSAGE(nDebug,"failing to subclass winamp window");
    return -
1;
  }

  
WinampProc=(WNDPROC)SetWindowLong(
    
hWnd,                   // _In_ HWND hWnd,
    
GWL_WNDPROC,            // _In_ int  nIndex,
    
(LONG)PluginWinampProc  // _In_ LONG dwNewLong
  
);

  return 
0;
}

static 
int UnsubclassWinamp(HWND hWndint nDebug)
{
  if (
NULL==hWnd||NULL==WinampProc) {
    
DMESSAGE(nDebug,"failing to unsubclass winamp window");
    return -
1;
  }

  
SetWindowLong(
    
hWnd,                   // _In_ HWND hWnd,
    
GWL_WNDPROC,            // _In_ int  nIndex,
    
(LONG)WinampProc        // _In_ LONG dwNewLong
  
);

  return 
0;
}
#endif // } 
I don't make use of it anyway, because you can always ask WA for the output device in use ("wa_ipc.h"):
PHP Code:
#define IPC_GETOUTPUTPLUGIN 625
/* (requires Winamp 5.0+)
** char* outdll = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTPLUGIN);
** This returns a string of the current output plugin's dll name.
** e.g. if the directsound plugin was selected then this would return 'out_ds.dll'.
*/ 
You have to maintain you're own module's file name and compare it with the current output plugin in order to shut down playing when it is different, i.e. no longer active.
pbelkner is offline   Reply With Quote
Old 22nd May 2016, 12:40   #306
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
Good finding: none of them is working for me (I tried all the 6 of them 1.5.0-1.5.5). 1.0.7 ss2 is working fine.
What has been changed between them regarding to sse2?
A lot. It's a complete re-write. But as already pointed out all versions are compiled from the same sources. It's not obvious why the "normal" version should work and the SSE2 version not. The only difference between the "normal" version and the SSE2 version is that the SSE2 version is compiled with the compiler (optimization) switches -arch:SSE -arch:SSE2 set (here is what MS has to say with regard to these compiler switches).

In order to make a little progress I included a SSE2 debug version with the new release. If possible you should set the debug level to the highest value (verbose 3). If it already crashes before you are able to set this value with the configuration dialog you may edit the config file "out_yasapi-debug-sse2.ini" by hand. Under section [plugin] include the line
debug=4
It corresponds to verbose 3.
pbelkner is offline   Reply With Quote
Old 22nd May 2016, 15:01   #307
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
What has been changed between them regarding to sse2?
One additional point. MS writes:
Quote:
Because the x86 compiler generates code that uses SSE2 instructions by default, you must specify /arch:IA32 to disable generation of SSE and SSE2 instructions for x86 processors.
I have tried -arch:IA32 with the non SSE2 versions. It gives a command line error (I'm using MSVC 10 because I'm on Vista).
pbelkner is offline   Reply With Quote
Old 23rd May 2016, 10:25   #308
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by pbelkner View Post
In order to make a little progress I included a SSE2 debug version with the new release. If possible you should set the debug level to the highest value (verbose 3). If it already crashes before you are able to set this value with the configuration dialog you may edit the config file "out_yasapi-debug-sse2.ini" by hand. Under section [plugin] include the line
debug=4
It corresponds to verbose 3.
In short: good news, sse2 version is also working fine!
I tried sse2 first it resulted the same behaivour then before. I did what you suggested and ss2-debug version ran fine!
It gave me the idea of getting rid of the old "out_yasapi-sse2.ini" inside "%AppData%\Roaming\Winamp\Plugins\" dir. After deleting that ini file sse2 build works perfectly!
The non-sse2 version wasn't affected: maybe some problematic options were missing from it since I always tried sse2 before.
Anyway, if somebody has such an issue they should try this solution at first.
Thanks for helping, Peter!
Now I'm suing 1.6.1.

Quote:
Originally Posted by pbelkner View Post
One additional point. MS writes:

I have tried -arch:IA32 with the non SSE2 versions. It gives a command line error (I'm using MSVC 10 because I'm on Vista).
It's even more confusing: does it mean that non-sse2 is also an sse2 build? (although the size of dlls are different)
chros is offline   Reply With Quote
Old 23rd May 2016, 12:10   #309
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by Aminifu View Post
Version 1.5.1 also does not let me use the Matrix Mixer plug-in to up-mix 2 output channels to 6 channels. It causes distortion and the debug log says that the ring buffer is not large enough (even when set to it's maximum). Version 1.0.6 does not have this issue, so I guess the rewrite has made the plug-in less tolerant of latencies introduced by other plug-ins in the processing string.

So, this plug-in still doesn't fully work in my preferred configuration. I will keep monitoring this thread and maybe a future update will work for me in the way I need it to. I'm glad you decided to keep this project alive.
Thanks for mentioning MatrixMixer , I completely forgot about it!
It, indeed, doesn't work with 1.6.1 either.
So I'm back to Directsound output: after 1.5 years finally I don't hear music for the center channel! Huge thanks for this!

Using a separate plugin for this effect is a big of waste, audio renderer can handle this. Peter?
chros is offline   Reply With Quote
Old 23rd May 2016, 23:03   #310
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 837
Quote:
Originally Posted by pbelkner View Post
What's new?
  • Gapless playback.
  • A common option for switching on/off gapless playback (disabled by default).
  • A device option for choosing whether the time offset for gapless playback is maintained as a 64-bit integer value (representing the playback position) or as a 64-bit floating point value (representing the time as quotient taken from the playback position and a frequency). For a deeper understanding regarding position and frequency values you may refer to the documentation of the IAudioClock::GetPosition() and IAudioClock::GetFrequency() methods. We feel that as long as a constant frequency value can be assumed choosing the time offset as beeing maintained as a 64-bit integer value is preferable.
  • A debug version for SSE2.

Links:
Thanks for this! Gapless is working great for me with SSE2 over here.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 26th May 2016, 08:13   #311
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.6.3

Quote:
Originally Posted by Aminifu View Post
Version 1.5.1 also does not let me use the Matrix Mixer plug-in to up-mix 2 output channels to 6 channels. It causes distortion and the debug log says that the ring buffer is not large enough (even when set to it's maximum). Version 1.0.6 does not have this issue, so I guess the rewrite has made the plug-in less tolerant of latencies introduced by other plug-ins in the processing string.
Quote:
Originally Posted by chros View Post
Thanks for mentioning MatrixMixer , I completely forgot about it!
It, indeed, doesn't work with 1.6.1 either.
What's new?
  • Fixed AUDCLNT_E_BUFFER_SIZE_ERROR appearing in eclusive/pull mode.
  • Fixed a potential forever-loop which may have appeared at the end of a track.
  • Fixed crashing as client of the WinampMatrixMixer output plugin.
Links:
pbelkner is offline   Reply With Quote
Old 26th May 2016, 17:18   #312
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by pbelkner View Post
What's new?
  • Fixed AUDCLNT_E_BUFFER_SIZE_ERROR appearing in eclusive/pull mode.
  • Fixed a potential forever-loop which may have appeared at the end of a track.
  • Fixed crashing as client of the WinampMatrixMixer output plugin.
Woow! What a support you provide for us! Thanks so much for the new build!
It works great with WinampMatrixMixer after a short test.

And I uploaded the problematic out_yasapi-sse2.ini (that I reported earlier, it caused the crash) here if you're interested: http://pastebin.com/paUZqsBG

Edit: I noticed that when Shared-Pull is selected then Device period dropdown and bar is disabled, but it's enabled using Exclusive-Pull. I even have to raise the Ringbuffer in Shared-Pull case (compared to Exclusive-pull).
I don't know whether it's a bug or it's supposed to work in this way.

Last edited by chros; 26th May 2016 at 18:36.
chros is offline   Reply With Quote
Old 27th May 2016, 05:18   #313
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
And I uploaded the problematic out_yasapi-sse2.ini (that I reported earlier, it caused the crash) here if you're interested: http://pastebin.com/paUZqsBG
Unfortunately I can't reproduce the crash. I did the following:
  • Renamed the out_yasapi-sse2.ini to out_yasapi-sse2.ini.X, i.e. logically deleted it.
  • Created a fresh out_yasapi-sse2.ini.
  • Copied your content into it.
  • Substituted the GUID of your device with one of mine.
  • Started Winamp.
  • Started a track.
  • Started the configutaion dialog in order to (briefly) verify that the (your) content is matched.
  • All went well, no crash happend.
Quote:
Originally Posted by chros View Post
I noticed that when Shared-Pull is selected then Device period dropdown and bar is disabled, but it's enabled using Exclusive-Pull. I even have to raise the Ringbuffer in Shared-Pull case (compared to Exclusive-pull).
I don't know whether it's a bug or it's supposed to work in this way.
This is intended. It's part of the "pedagogical" aspect of the configuration dialog. It should teach you a bit about how WASAPI works. In order to understand why the GUI is supposed to work exactly that way you should have a look at the documentation of the IAudioClient::Initialize() method or at "yasapi_strategy.c" (an implementation of the well known strategy-pattern by means of ordinary C):
  • const Strategy gcStrategyPush:
    • PHP Code:
      return pClient->lpVtbl->Initialize(pClient,
        
      eShareMode,           // AUDCLNT_SHAREMODE ShareMode,
        
      dwStreamFlags,        // DWORD StreamFlags,
        
      hnsDevicePeriod,      // REFERENCE_TIME hnsBufferDuration,
        
      0,                    // REFERENCE_TIME hnsPeriodicity,
        
      pwfx,                 // const WAVEFORMATEX *pFormat,
        
      NULL                  // LPCGUID AudioPlayerGuid
      ); 
    The hnsDevicePeriod is needed and used as hnsBufferDuration only, i.e. the size of the buffer shared with the device is defined in terms of a time interval. The hnsPeriodicity is left undefined. It is not needed because you have to implement notification yourself by means of a timer (cf. the Rendering a Stream example code by MS). This holds for both, exclusive and shared mode streams.
  • const Strategy gcStrategyPull:
    • case AUDCLNT_SHAREMODE_SHARED:
      https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx:
      Quote:
      For a shared-mode stream that uses event-driven buffering, the caller must set both hnsPeriodicity and hnsBufferDuration to 0. The Initialize method determines how large a buffer to allocate based on the scheduling period of the audio engine. Although the client's buffer processing thread is event driven, the basic buffer management process, as described previously, is unaltered. Each time the thread awakens, it should call IAudioClient::GetCurrentPadding to determine how much data to write to a rendering buffer or read from a capture buffer. In contrast to the two buffers that the Initialize method allocates for an exclusive-mode stream that uses event-driven buffering, a shared-mode stream requires a single buffer.
      PHP Code:
      return pClient->lpVtbl->Initialize(pClient,
        
      eShareMode,         // AUDCLNT_SHAREMODE ShareMode,
        
      dwStreamFlags,      // DWORD StreamFlags,
        
      0,                  // REFERENCE_TIME hnsBufferDuration,
        
      0,                  // REFERENCE_TIME hnsPeriodicity,
        
      pwfx,               // const WAVEFORMATEX *pFormat,
        
      NULL                // LPCGUID AudioPlayerGuid
      ); 
      In this case (shared/pull) it is impossible to define any buffer size, and hence the GUI is gray. No example code by MS known.
    • case AUDCLNT_SHAREMODE_EXCLUSIVE:
      https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx:
      Quote:
      For an exclusive-mode stream that uses event-driven buffering, the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, and the values of these two parameters must be equal. The Initialize method allocates two buffers for the stream. Each buffer is equal in duration to the value of the hnsBufferDuration parameter. Following the Initialize call for a rendering stream, the caller should fill the first of the two buffers before starting the stream. For a capture stream, the buffers are initially empty, and the caller should assume that each buffer remains empty until the event for that buffer is signaled. While the stream is running, the system alternately sends one buffer or the other to the client—this form of double buffering is referred to as "ping-ponging". Each time the client receives a buffer from the system (which the system indicates by signaling the event), the client must process the entire buffer. For example, if the client requests a packet size from the IAudioRenderClient::GetBuffer method that does not match the buffer size, the method fails. Calls to the IAudioClient::GetCurrentPadding method are unnecessary because the packet size must always equal the buffer size. In contrast to the buffering modes discussed previously, the latency for an event-driven, exclusive-mode stream depends directly on the buffer size.
      PHP Code:
      return pClient->lpVtbl->Initialize(pClient,
        
      eShareMode,         // AUDCLNT_SHAREMODE ShareMode,
        
      dwStreamFlags,      // DWORD StreamFlags,
        
      hnsDevicePeriod,    // REFERENCE_TIME hnsBufferDuration,
        
      hnsDevicePeriod,    // REFERENCE_TIME hnsPeriodicity,
        
      pwfx,               // const WAVEFORMATEX *pFormat,
        
      NULL                // LPCGUID AudioPlayerGuid
      ); 
      In this case (exclusive/pull) the hnsDevicePeriod is used twice, in order to define the hnsBufferDuration and the hnsPeriodicity, i.e. the size of the buffer shared with the device (hnsBufferDuration) and the time interval when WASAPI will remind us to fill the buffer with the next batch to render (hnsPeriodicity). Cf. the Exclusive-Mode Streams example code by MS, which doesn't mention that it talks on Pull-Mode only.
pbelkner is offline   Reply With Quote
Old 27th May 2016, 10:09   #314
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by pbelkner View Post
Unfortunately I can't reproduce the crash.
No worries, since I was the only one who experienced it.

Quote:
Originally Posted by pbelkner View Post
This is intended. It's part of the "pedagogical" aspect of the configuration dialog. It should teach you a bit about how WASAPI works. In order to understand why the GUI is supposed to work exactly that way you should have a look at the documentation of the IAudioClient::Initialize() method or at "yasapi_strategy.c" (an implementation of the well known strategy-pattern by means of ordinary C)
Thanks for the detailed explanation! (As a former teacher I like your educational attitude )
You can put a one liner into the docs about it, so no more false report will arrive regarding to this.

Btw: which mode do you prefer? push or pull?
I played around with the buffers on my system, and I can use share-push with Default/3.0/3.00/1.00 reliably.

And huge thanks for this amazing plugin! This became the best and most reliable wasapi plugin for Winamp!

I have been thinking about the stereo channel upmix:
1. matrix mixer only supports 5.1 channels, so who has 7.1/9.1 systems they can't use it with the rest. (I currently only have 5.1 setup, but I plan to buy 2 more to make it 7.1 as my receiver supports it)
2. maybe it's not that simple to just duplicate the 2 channels to the backs and to the rest:
- maybe some additional things has to be considered (like phase, e.g. if I'd use 2 subwoofers they should have been using different phase)
- my Yamaha RX-A830 has extra modes with 7.1 stereo: Monaural on or off (I couldn't find any info about it what it does with or without it)

If you like I can also try to look into this topic, it seems to be interesting.
chros is offline   Reply With Quote
Old 28th May 2016, 07:48   #315
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
Btw: which mode do you prefer? push or pull?
I don't have a choice if. My device is supporting push mode only.
Quote:
Originally Posted by chros View Post
I have been thinking about the stereo channel upmix:
If you don't talk about "upmixing" in the term's real meaning but just about duplicating channels into "wholes" it should be possible as a generalization on what's already done with mono.

The drawback is that I don't own a multi-channel system myself but just plain stereo. In that sense it is hard to test anything.

Could you please have a look at this site and tell whether the information given there regarding the channel order in interleaved format (standard channel layouts, bottom most) is correct?
pbelkner is offline   Reply With Quote
Old 28th May 2016, 18:23   #316
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,577
Quote:
Originally Posted by chros View Post
...

I have been thinking about the stereo channel upmix:
1. matrix mixer only supports 5.1 channels, so who has 7.1/9.1 systems they can't use it with the rest. (I currently only have 5.1 setup, but I plan to buy 2 more to make it 7.1 as my receiver supports it)
2. maybe it's not that simple to just duplicate the 2 channels to the backs and to the rest:
- maybe some additional things has to be considered (like phase, e.g. if I'd use 2 subwoofers they should have been using different phase)
- my Yamaha RX-A830 has extra modes with 7.1 stereo: Monaural on or off (I couldn't find any info about it what it does with or without it)

...
The Maiko plug-in was the only Winamp plug-in I ever found that could correctly support more than 6 channels.

Multi-channel sound systems are currently best used for reproducing movie and game soundtracks. The intent is to position the sounds to provide a realistic experience. If the sound system has enough channels then sounds can come from any direction. For example in a game, you can hear something approaching from directly behind you, or behind you but off to the left or right side, or coming from beside you on the left or right, or coming from directly in front of you or in front but off to the left or right side. This positioning of sounds is used similarly in movies.

For music, the sound stage is usually in front of you (or off to the front left or right at a live performance). There is no direct sound behind you (unless you turn around). There can be reflections (echoes) from various surfaces behind you.

The ".1" in multi-channel sound systems represents the LFE (low-frequency effects) channel. This channel is intended for sound frequencies that you feel (at sufficient volume), you don't really hear them. It is not a bass channel. The LFE channel is best used connected only to a subwoofer. Bass sound frequencies should be sent to ordinary woofers or appropriate mid-range speakers.

A six channel (5.1) system has a front center, front left, front right, and LFE channel. The other 2 channels can be used as left side or left rear and right side or right rear. Some 5.1 sound cards/chips are designed to use these 2 channels as side or rear channels only. But you are free to position and connect your speakers any way you want. However when gaming, sounds coming from the wrong direction can be the difference in winning or losing.

A seven channel (6.1) system adds a rear center channel. A eight channel (7.1) system does not have a rear center channel, but adds separate left and right, side and rear channels. A nine channel (8.1) system adds a rear center channel to the 7.1 arrangement.

When listening to music with a multi-channel sound system, some people just want to hear music from all of their speakers. Some don't care if the sounds from each speaker are different and some don't want the sounds to be different. The Yamaha RX-A830 monaural mode is used to make the sounds sent to each speaker (except for the LFE channel) be the same.

Some want to hear stereo sound from the front left and right speakers mirrored to the rear and/or side left and right speakers. Some want to hear the left and right sounds merged in the front center (and/or rear center) speaker and some don't want to hear anything from the front center (and/or rear center) speaker.

I prefer to hear different sounds from each of my speakers in my 5.1 system. This is why I use the matrix mixer plug-in. This plug-in has built-in stereo up-mixing modes or lets the up-mixing be configured manually. In manual mode, the stereo (or mono) input channels can be mirrored to any other output channel desired or carefully altered so that different portions of these input channels can be sent to any other output channel desired (simulating surround sound with slightly to substantially different sound coming from each speaker). An LFE channel can be derived from the stereo (or mono) input channels and sent to a subwoofer and/or mixed in with the other output channels. If the manual mode is not used correctly, the input sound can easily be turned into a bunch of noise. If the source (input) is already multi-channel, this plug-in can be used to direct these inputs to the intended outputs.

The matrix mixer plug-in uses a modified version of the free AC3Filter. Here is a link (http://www.ac3filter.net/wiki/AC3Filter_Help) to some technical info on the AC3Filer, some of which can be applied to setting up the matrix mixer plug-in.

Knowing the method used to encode a stereo music file (stereo, joint stereo, or dual channel) is also useful to making a successful manual surround sound up-mix. It is not a 'one size fits all' kind of thing.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system

Last edited by Aminifu; 28th May 2016 at 19:29.
Aminifu is offline   Reply With Quote
Old 29th May 2016, 01:10   #317
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
I have been thinking about the stereo channel upmix: maybe it's not that simple to just duplicate the 2 channels to the backs and to the rest
Quote:
Originally Posted by Aminifu View Post
The Maiko plug-in was the only Winamp plug-in I ever found that could correctly support more than 6 channels.
Maiko introduces the wrong notion that up-mixing is part of WASAPI. Indeed it is not (At least I have searched msdn.microsoft.com all over again and again to find at least a hint but without any success). Up-mixing should be implemented as DSP plug-in. Here are some papers sketching what has to be done:Maybe Maiko does it's DSP part right (just for shared mode) but not it's WASAPI part (at least for me it crashes in exclusive mode).
Quote:
Originally Posted by chros View Post
This (YASAPI) became the best and most reliable wasapi plugin for Winamp!
YASAPI is (and remains) a WASAPI output plugin (as it claims to be)!

I still don't understand why Maiko has not provided it's DSP part as a DSP plug-in. I even don't understand why Matrix Mixer provides it's capabilities as output plug-in and not as DSP plugin.
Quote:
Originally Posted by chros View Post
If you like I can also try to look into this topic, it seems to be interesting.
You should think about providing a respective DSP plug-in.
pbelkner is offline   Reply With Quote
Old 29th May 2016, 03:43   #318
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v1.6.4

What's new?
  • Added a common option in order to define whether 4, 6, or 8 channels should be interpreted as qadrophnic (3.1), 5.1, or 7.1 (disabled) or sorround (3.1 sorround), 5.1 sorround, or 7.1 sorround (enabled), respectively.

Note: In WASAPI the output format is defined by means of the MS WAVEFORMATEXTENSIBLE structure. In WA you are only informed about the number of channels making up a frame, but not about whether a frame is to be interpreted as sorround (for details cf."yasapi_wfxx.c").

Links:
pbelkner is offline   Reply With Quote
Old 29th May 2016, 11:51   #319
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 72
Quote:
Originally Posted by Aminifu View Post
When listening to music with a multi-channel sound system, some people just want to hear music from all of their speakers. Some don't care if the sounds from each speaker are different and some don't want the sounds to be different. The Yamaha RX-A830 monaural mode is used to make the sounds sent to each speaker (except for the LFE channel) be the same.
monaural mode: if I get you right does it mean that every channel will be the same? (for example, no stereo at the front channels?)

Quote:
Originally Posted by Aminifu View Post
I prefer to hear different sounds from each of my speakers in my 5.1 system. This is why I use the matrix mixer plug-in.
So, what's your preferred custom matrix to output 4 channel from stereo?

Quote:
Originally Posted by Aminifu View Post
Knowing the method used to encode a stereo music file (stereo, joint stereo, or dual channel) is also useful to making a successful manual surround sound up-mix. It is not a 'one size fits all' kind of thing.
Really? I didn't think about this (it was around 15 years(! ) when I dealt with mp3 encoding).

Quote:
Originally Posted by pbelkner View Post
Maiko introduces the wrong notion that up-mixing is part of WASAPI. Indeed it is not (At least I have searched msdn.microsoft.com all over again and again to find at least a hint but without any success). Up-mixing should be implemented as DSP plug-in.
...
Maybe Maiko does it's DSP part right (just for shared mode) but not it's WASAPI part (at least for me it crashes in exclusive mode).

YASAPI is (and remains) a WASAPI output plugin (as it claims to be)!

I still don't understand why Maiko has not provided it's DSP part as a DSP plug-in. I even don't understand why Matrix Mixer provides it's capabilities as output plug-in and not as DSP plugin.

You should think about providing a respective DSP plug-in.
I understand exactly what you mean by this.

Quote:
Originally Posted by pbelkner View Post
Here are some papers sketching what has to be done:
I'll take a look at them later, thanks.

Quote:
Originally Posted by pbelkner View Post
What's new?
  • Added a common option in order to define whether 4, 6, or 8 channels should be interpreted as qadrophnic (3.1), 5.1, or 7.1 (disabled) or sorround (3.1 sorround), 5.1 sorround, or 7.1 sorround (enabled), respectively.

Note: In WASAPI the output format is defined by means of the MS WAVEFORMATEXTENSIBLE structure. In WA you are only informed about the number of channels making up a frame, but not about whether a frame is to be interpreted as sorround (for details cf."yasapi_wfxx.c").
Wooow! Thanks again for the new feature!

I've been playing with it this morning, here are the results. In short it doesn't work for stereo sources.

1. system 5.1 side, yasapi surround on: only fronts sound (although receiver gets 5.1 with the rest being silent channels)
2. system 4.0 (quadro), yasapi surround on: same as 1., only fronts sound (although receiver gets 5.1 with the rest being silent channels)

And here comes the interesting part: I tried it out with MatrixMixer as well.

3. system 5.1 side, matrixmixer 2-2 (4), yasapi surround off: fronts and backs sound, center doesn't (as it should be)
4. system 5.1 side, matrixmixer 2-2 (4), yasapi surround ON: all speakers sound, even center!!!

So, what you tried to do is almost correct, but it doesn't effect stereo sources (exactly what we would need )

Tried it out with Sanear: it uses DspMatrix class to deal with channel mixing, but it doesn't upmix stereo at all in shared mode either. https://github.com/alexmarsev/sanear.../DspMatrix.cpp
chros is offline   Reply With Quote
Old 29th May 2016, 12:29   #320
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
So, what you tried to do is almost correct, but it doesn't effect stereo sources (exactly what we would need )
In order to initialize WASAPI you have to provide a WAVEFORMATEX/WAVEFORMATEXTENSIBLE structure (cf. the respective discussion). This includes not only providing nChannels, nSamplesPerSec, and wBitsPerSample, but also dwChannelMask. In YASAPI this is done by the function WFXXSetup(). This is not new.
PHP Code:
void WFXXSetup(WAVEFORMATEXTENSIBLE *pwfxxint samplerateint numchannels,
    
int bitspersampBOOL bSurroundBOOL bFloat)
{
  
WAVEFORMATEX *pwfx=&pwfxx->Format;

  
pwfx->wFormatTag=WAVE_FORMAT_EXTENSIBLE;
  
pwfx->nChannels=numchannels;
  
pwfx->nSamplesPerSec=samplerate;
  
pwfx->wBitsPerSample=bitspersamp;
  
pwfx->cbSize=(sizeof *pwfxx)-(sizeof *pwfx);
  
////
  
pwfx->nBlockAlign=pwfx->nChannels*(pwfx->wBitsPerSample>>3);
  
pwfx->nAvgBytesPerSec=pwfx->nSamplesPerSec*pwfx->nBlockAlign;
  
////
  
pwfxx->SubFormat=
      
bFloat?KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
      
:KSDATAFORMAT_SUBTYPE_PCM;
  
pwfxx->Samples.wValidBitsPerSample=pwfx->wBitsPerSample;

  switch (
pwfx->nChannels) {
  case 
1:
    
pwfxx->dwChannelMask
        
=KSAUDIO_SPEAKER_MONO;
    break;
  case 
2:
    
pwfxx->dwChannelMask
        
=KSAUDIO_SPEAKER_STEREO;
    break;
  case 
3:
    
pwfxx->dwChannelMask
        
=SPEAKER_FRONT_LEFT
        
|SPEAKER_FRONT_RIGHT
        
|SPEAKER_LOW_FREQUENCY;
    break;
  case 
4:
    
pwfxx->dwChannelMask
        
=bSurround?KSAUDIO_SPEAKER_SURROUND:KSAUDIO_SPEAKER_QUAD;
    break;
  case 
5:
    
pwfxx->dwChannelMask
        
=SPEAKER_BACK_RIGHT
        
|SPEAKER_FRONT_RIGHT
        
|SPEAKER_FRONT_CENTER
        
|SPEAKER_FRONT_LEFT
        
|SPEAKER_BACK_LEFT;
    break;
  case 
6:
    
pwfxx->dwChannelMask
        
=bSurround?KSAUDIO_SPEAKER_5POINT1_SURROUND:KSAUDIO_SPEAKER_5POINT1;
    break;
  case 
8:
    
pwfxx->dwChannelMask
        
=bSurround?KSAUDIO_SPEAKER_7POINT1_SURROUND:KSAUDIO_SPEAKER_7POINT1;
    break;
  default:
    
pwfxx->dwChannelMask=0;
    break;
  }

What's new is that you now can provide the parameter bSorround from the configuration. That only affects
  • KSAUDIO_SPEAKER_QUAD vs. KSAUDIO_SPEAKER_SURROUND in case of 4 channels,
  • KSAUDIO_SPEAKER_5POINT1 vs. KSAUDIO_SPEAKER_5POINT1_SURROUND in case of 6 channels, and
  • KSAUDIO_SPEAKER_7POINT1 vs. KSAUDIO_SPEAKER_7POINT1_SURROUND in case of 8 channels.
Before the update the parameter bSurround was simply set to FALSE.

Whether this has any real effect I can't tell because I don't own a multi-channel system.
pbelkner is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump