Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 1st December 2015, 10:05   #161
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Just tried out 0.10 in Shared+Push mode yesterday with the default settings: it's working fine! (I didn't have time for more testing.) Thanks, Peter.
I still need the Default Audio device in the device list.
(I use ClockAmp to wake up my laptop in the morning, and a wget command line for switching on my avreceiver. The problem is: whenever I start winamp when my TV is on (sometimes in the night, for the next morning), there's only the TV as audio device appears in the list, but in the morning there's not TV but avreceiver, so winamp can't use the only selected TV audio device -> no sound -> maybe I'll be late from work System default would solve this problem.)
Thanks
chros is offline   Reply With Quote
Old 1st December 2015, 13:34   #162
djnforce9
Junior Member
 
Join Date: Feb 2014
Posts: 40
Did another trace with the NSF file using the debug version you attached. Winamp locks up before it sends the "close" command (although thankfully the debug window does not freeze along with Winamp).

Here is another case where I play an NSF for a while and then hit stop.

PHP Code:
  uFrames7680uFramesPadding3840uFramesWrite3840uFramesRing13417q
0.50bFlush0
  REQUEST_CANWRITE
  free
5975 frames (23900 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
5400 frames (21600 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4824 frames (19296 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4248 frames (16992 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3672 frames (14688 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3096 frames (12384 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2520 frames (10080 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1944 frames (7776 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1368 frames (5472 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
792 frames (3168 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing14760q
0.50bFlush0
canwrite
  REQUEST_CANWRITE
  free
4632 frames (18528 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4056 frames (16224 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3480 frames (13920 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2904 frames (11616 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2328 frames (9312 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1752 frames (7008 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing13800q
0.50bFlush0
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
5016 frames (20064 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4440 frames (17760 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3864 frames (15456 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3288 frames (13152 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2712 frames (10848 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2136 frames (8544 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1560 frames (6240 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
984 frames (3936 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing14568q
0.50bFlush0
canwrite
  REQUEST_CANWRITE
  free
4824 frames (19296 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4248 frames (16992 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3672 frames (14688 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3096 frames (12384 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2520 frames (10080 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1944 frames (7776 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1368 frames (5472 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding2880uFramesWrite4800uFramesRing14184q
0.50bFlush0
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
5592 frames (22368 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
5016 frames (20064 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4440 frames (17760 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3864 frames (15456 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3288 frames (13152 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2712 frames (10848 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2136 frames (8544 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1560 frames (6240 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
985 frames (3940 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing14567q
0.50bFlush0
canwrite
  REQUEST_CANWRITE
  free
4825 frames (19300 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4249 frames (16996 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3673 frames (14692 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3097 frames (12388 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2521 frames (10084 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1945 frames (7780 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing13607q
0.50bFlush0
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
5209 frames (20836 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4633 frames (18532 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
4057 frames (16228 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
3481 frames (13924 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2905 frames (11620 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
2329 frames (9316 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1753 frames (7012 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
1177 frames (4708 bytes)
write
  REQUEST_WRITE
canwrite
  REQUEST_CANWRITE
  free
601 frames (2404 bytes)
  
REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing14951q
0.50bFlush0
  REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing11111q
0.50bFlush0
  REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3840uFramesRing7271q:
 
0.50bFlush0
  REQUEST_READ
  uFrames
7680uFramesPadding3840uFramesWrite3431uFramesRing3431q:
 
0.50bFlush0
  REQUEST_READ 
If you want to try for yourself, the plugin is here:
http://slickproductions.org/notsofatso.php

And you can grab an NSF file here:
http://www.zophar.net/music/nsf.html

Thank you so much for the effort in resolving this; much appreciated .

EDIT: All songs play with a ring buffer of 1.64 or more; any less and certain songs will stall.
djnforce9 is offline   Reply With Quote
Old 1st December 2015, 15:59   #163
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by djnforce9 View Post
If you want to try for yourself, the plugin is here:
http://slickproductions.org/notsofatso.php

And you can grab an NSF file here:
http://www.zophar.net/music/nsf.html
Fortunately I can reproduce the bug.
Quote:
Originally Posted by djnforce9 View Post
Thank you so much for the effort in resolving this; much appreciated .
It is interesting for me too.
pbelkner is offline   Reply With Quote
Old 2nd December 2015, 13:13   #164
djnforce9
Junior Member
 
Join Date: Feb 2014
Posts: 40
Sounds good; glad you're enjoying developing the plugin; not too many Winamp plugin developers left but I believe that will change once Winamp re-surfaces again.

Anyway, I noticed that that files with a sample rate of 32Khz or lower will not play even in automatic mode; here are a couple example files:
https://www.dropbox.com/s/77j1ktepd0...0Home.mp3?dl=0

https://www.dropbox.com/s/cb1hbuu38k...meday.mp3?dl=0

EDIT: They play in "shared" mode but stutter like crazy.
djnforce9 is offline   Reply With Quote
Old 2nd December 2015, 18:18   #165
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
1. Can't playback in Exclusive-Pull:
PHP Code:
setvolume
  volume
0.06
open
  wasapi clock
  REQUEST_OPEN
  samplerate
44100
  numchannels
2
  bitspersamp
16
  audio client created
  intitializing audio client with 0
/0 hns
AUDCLNT_E_BUFFER_SIZE_ERROR
"yasapi_session.c" (265).
Error initializing audio client"yasapi_session.c" (279). 
2. Can't playback in Shared-Pull (it was working in 0.8.x):
PHP Code:
open
  wasapi clock
  REQUEST_OPEN
  samplerate
44100
  numchannels
2
  bitspersamp
16
  audio client created
  intitializing audio client with 0
/0 hns
  audio client initialized
  share mode
SHARED
  event handle set
  audio clock created
  SHARED BUFFER SIZE
896 frames
  START AUDIO CLIENT
1152 frames
  audio render client created
  RING BUFFER SIZE
1728 frames (1.93)
  
ring buffer created
canwrite
  REQUEST_CANWRITE
  free
1728 frames (6912 bytes)
getoutputtime
  REQUEST_GETTIME
write
  REQUEST_WRITE
  uFramesAvailable
623uFramesMin1152 (1728)
canwrite
  REQUEST_CANWRITE
  free
1105 frames (4420 bytes)
getoutputtime
  REQUEST_GETTIME
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
1105 frames (4420 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
1105 frames (4420 bytes)
getoutputtime
  REQUEST_GETTIME
........... 
Quote:
Originally Posted by djnforce9 View Post
Anyway, I noticed that that files with a sample rate of 32Khz or lower will not play even in automatic mode; here are a couple example files:
https://www.dropbox.com/s/77j1ktepd0...0Home.mp3?dl=0

https://www.dropbox.com/s/cb1hbuu38k...meday.mp3?dl=0

EDIT: They play in "shared" mode but stutter like crazy.
3.I can't play them with Exclusive-Push mode, but only with Shared-Push mode (and the playback is good without any stuttering, using the default settings).
Someday exclusive-push:
PHP Code:
setvolume
  volume
0.06
open
  wasapi clock
  REQUEST_OPEN
  samplerate
22050
  numchannels
2
  bitspersamp
16
  audio client created
  got device period
    
default: 101587 hns
    minimum
30000 hns
    choosen
101587 hns
  device period scaled by 7.00 
(device period711515)
  
intitializing audio client with 711515/0 hns
AUDCLNT_E_ENDPOINT_CREATE_FAILED
"yasapi_session.c" (269).
Error initializing audio client"yasapi_session.c" (279). 
Air Force Come and Dey Flatten Your Home exclusive-push:
PHP Code:
setvolume
  volume
0.06
open
  wasapi clock
  REQUEST_OPEN
  samplerate
11025
  numchannels
-> 2
  bitspersamp
16
  audio client created
  got device period
    
default: 101587 hns
    minimum
30000 hns
    choosen
101587 hns
  device period scaled by 7.00 
(device period711515)
  
intitializing audio client with 711515/0 hns
AUDCLNT_E_ENDPOINT_CREATE_FAILED
"yasapi_session.c" (269).
Error initializing audio client"yasapi_session.c" (279). 
4. bug: But volume control isn't working when "Mono as Stereo" is enabled with the "Air Force Come and Dey Flatten Your Home" sample.

5. bug: plugin doesn't remember it's setting after winamp has been restarted. (It didn't happen before). Does it want to use an ini file in the main Winamp directory?
chros is offline   Reply With Quote
Old 4th December 2015, 00:37   #166
djnforce9
Junior Member
 
Join Date: Feb 2014
Posts: 40
Just wanted to pop in and say, I really appreciate you developing this plugin as much you have already; I am really enjoying using it for my music. Not many active Winamp plugin developers so I am really glad to have met you.

Anyway, good day
djnforce9 is offline   Reply With Quote
Old 4th December 2015, 12:45   #167
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v.0.11.0

What's new?
  • Reorganized the configuration dialog:
    • Focused again on the most important two (per device) parameters "Mode" (share/exclusive) and "Strategy" (push/pull).
    • Duplicated those two parameters from the "Device Options" page to the dialog's top-region.
    • Moved the former top-region parameters to a new "General" tab-control page.
    • Added a "Store" button with similar functionality as the "OK" button except that it doesn't close the dialog.


  • Fixed several bugs.
Links:
pbelkner is offline   Reply With Quote
Old 4th December 2015, 13:02   #168
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
A big "thank you" to all of you who have submitted bug reports and especially traces.
Quote:
Originally Posted by djnforce9 View Post
I noticed that that files with a sample rate of 32Khz or lower will not play even in automatic mode; here are a couple example files:
https://www.dropbox.com/s/77j1ktepd0...0Home.mp3?dl=0

https://www.dropbox.com/s/cb1hbuu38k...meday.mp3?dl=0

EDIT: They play in "shared" mode but stutter like crazy.
If they play in shared mode they will play for sure in "automatic mode" (the following is a trace from "Air Force Come and Dey Flatten Your Home" with the new version).
PHP Code:
open
  wasapi clock
  REQUEST_OPEN
  samplerate
44100
  numchannels
-> 2
  bitspersamp
24
  audio client created
  got device period
    
default: 100000 hns
    minimum
30000 hns
    choosen
100000 hns
  device period scaled by 7.00 
(device period700400)
  
intitializing audio client EXCLUSIVE/PUSH with 700400/0 hns
  failed with AUDCLNT_E_ENDPOINT_CREATE_FAILED
  destroying audio client
  retrying in shared mode
  audio client created
  intitializing audio client SHARED
/PUSH with 700400/0 hns
  audio client initialized
  audio clock created
  SHARED BUFFER SIZE
3089 frames
  START AUDIO CLIENT
3456 frames
  audio render client created
  RING BUFFER SIZE
6336 frames (2.05)
  
ring buffer created
  uFramesRing
576uFramesMin3456 (6336)
  
uFramesRing1152uFramesMin3456 (6336)
  
uFramesRing1728uFramesMin3456 (6336)
  
uFramesRing2304uFramesMin3456 (6336)
  
uFramesRing2880uFramesMin3456 (6336)
  
uFramesRing3456uFramesMin3456 (6336)
  
uFrames3089uFramesPadding0uFramesWrite3089uFramesRing3456q0.50bFlush0
  audio client started
  uFrames
3089uFramesPadding1319uFramesWrite1770uFramesRing6127q0.50bFlush0
  uFrames
3089uFramesPadding1766uFramesWrite1323uFramesRing6085q0.50bFlush0
  uFrames
3089uFramesPadding1325uFramesWrite1764uFramesRing5914q0.50bFlush0
  uFrames
3089uFramesPadding1766uFramesWrite1323uFramesRing5878q0.50bFlush0
  uFrames
3089uFramesPadding1325uFramesWrite1764uFramesRing6283q0.50bFlush
If they stutter you should increase buffer size. Even if they do not stutter you should have an eye on the buffer visualization. The buffers should be stable, i.e. tey should not jump around on short time scales. There may be just some small fluctuations on larger time scales. If the buffers are jumping around on short time scales increase buffer sizes, start with device period and only if it not works ring buffer size. An optimal value for buffer sizes is the minimum size with stable buffers.
Quote:
Originally Posted by chros View Post
1. Can't playback in Exclusive-Pull
Should be fixed (unfortunately I can't test it).
Quote:
Originally Posted by chros View Post
2. Can't playback in Shared-Pull
Should be fixed, cf. the following trace from the new version (also "Air Force Come and Dey Flatten Your Home"):
PHP Code:
open
  wasapi clock
  REQUEST_OPEN
  samplerate
44100
  numchannels
-> 2
  bitspersamp
24
  audio client created
  intitializing audio client SHARE
/PULL with 0/0 hns
  audio client initialized
  event handle set
  audio clock created
  SHARED BUFFER SIZE
1329 frames
  START AUDIO CLIENT
1728 frames
  audio render client created
  RING BUFFER SIZE
2880 frames (2.17)
  
ring buffer created
  uFramesRing
576uFramesMin1728 (2880)
  
uFramesRing1152uFramesMin1728 (2880)
  
uFramesRing1728uFramesMin1728 (2880)
  
uFrames1329uFramesPadding0uFramesWrite1329uFramesRing1728q0.50bFlush0
  audio client started
  uFrames
1329uFramesPadding882uFramesWrite399uFramesRing399q0.50bFlush0
  uFrames
1329uFramesPadding840uFramesWrite489uFramesRing2880q0.50bFlush
Quote:
Originally Posted by chros View Post
3.I can't play them with Exclusive-Push mode, but only with Shared-Push mode (and the playback is good without any stuttering, using the default settings).
Someday exclusive-push:
PHP Code:
  samplerate22050 
Quote:
Originally Posted by chros View Post
Air Force Come and Dey Flatten Your Home exclusive-push:
PHP Code:
  samplerate11025 
Because of samplerate 22050 or even 11025 you cannot expect them to play in exclusive mode. Typical sample rates for exclusive mode are multiples of 44100 and 48000. Regarding stuttering cf. above.
Quote:
Originally Posted by chros View Post
5. bug: plugin doesn't remember it's setting after winamp has been restarted.
Should be fixed. But it was something completely different from what you've expected:
  • It was just one field (and not all): the slider for the device period ("share size").
  • The field was correctly stored and loaded. You could see that the correct value was loaded in a trace of debug level "verbose 3".
  • The bug was that it was overwritten after having been loaded correctly.
Quote:
Originally Posted by djnforce9 View Post
Did another trace with the NSF file
That's something completely different from an ordinary bug. This needs some deeper (and time consuming) evaluation.
Quote:
Originally Posted by djnforce9 View Post
Just wanted to pop in and say, I really appreciate you developing this plugin as much you have already; I am really enjoying using it for my music. Not many active Winamp plugin developers so I am really glad to have met you.

Anyway, good day
Thank you
pbelkner is offline   Reply With Quote
Old 4th December 2015, 18:33   #169
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Thanks for the new version!

All the previously mentioned bugs are fixed (with the new default settings).
Although, I just tried this sample again, and it's not good:
1. still clipping, here a 2ch-48KHz-sample-aac : https://dailyuploads.net/j70whbsrmb99
2. "Duplicated those two parameters from the "Device Options" page to the dialog's top-region" : I'm not sure if it's a good idea, it's confusing a bit.
3. Can you implement the System default audio device? If not, then it's not a problem, but that means I can't use the plugin daily.

Thanks
chros is offline   Reply With Quote
Old 5th December 2015, 04:38   #170
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
1. still clipping, here a 2ch-48KHz-sample-aac : https://dailyuploads.net/j70whbsrmb99
Could you please upload the corresponding 7z/zip rather then a self executing archive?
pbelkner is offline   Reply With Quote
Old 5th December 2015, 16:47   #171
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Quote:
Originally Posted by pbelkner View Post
Could you please upload the corresponding 7z/zip rather then a self executing archive?
It's not exe but an aac file: you have to uncheck the "Use our download manager ..." checkbox below the download button first. (Silly filesharing sites.)
chros is offline   Reply With Quote
Old 6th December 2015, 04:09   #172
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by chros View Post
1. still clipping, here a 2ch-48KHz-sample-aac : https://dailyuploads.net/j70whbsrmb99
Unfortunately I cannot reproduce this. I'm using (of course ) in_ffsox.dll. Which input plugin do you use?
pbelkner is offline   Reply With Quote
Old 6th December 2015, 10:25   #173
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v0.12.0

What's new?Links:
Quote:
Originally Posted by djnforce9 View Post
Did another trace with the NSF file using the debug version you attached. Winamp locks up before it sends the "close" command (although thankfully the debug window does not freeze along with Winamp).
There where two bugs, the obvious dead lock and a second resulting from the circumstance that the track I tested with was indeed a container for various (sub-)tracks. When switching from one to another sub-track the "NotSo Fatso" input plugin is not sending a "close/open" but rather just a "flush". In case that kind of switching between sub-tracks was working with the old architecture it was by pure accident.
pbelkner is offline   Reply With Quote
Old 6th December 2015, 14:50   #174
Cool Barn
Junior Member
 
Join Date: Jul 2010
Posts: 14
V 0.11.0 was absolutely rock-solid for me. I could drag that seeker around like I was playing Fruit Ninja with Winamp and I would never get that AUDCLNT_E_BUFFER_TOO_LARGE error.

However with 0.12.0 once I started moving that slider quickly then it would randomly pop up, even if I increased all the buffer sizes to the maximum.

I put 0.11.0 back and normality returned. So I will stick with it for the moment.

Thank you for the updates though, it is great that you keep working on such a good plugin.

Cheers
Cool Barn is offline   Reply With Quote
Old 6th December 2015, 16:03   #175
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Cool Barn View Post
However with 0.12.0 once I started moving that slider quickly then it would randomly pop up, even if I increased all the buffer sizes to the maximum
What do you think does AUDCLNT_E_BUFFER_TOO_LARGE mean? For me (as non native speaker) it reads as "buffer too large". Or am I wrong? Why are you wondering getting AUDCLNT_E_BUFFER_TOO_LARGE when you "increased all the buffer sizes to the maximum"?

With v0.12.0 it is possible to configure larger buffer sizes then with v0.11.0. But nobody told you to make use of it. Do you not remember my advice to set the buffer sizes to the minimum from where you can achieve stable buffers?
Quote:
Originally Posted by pbelkner View Post
The buffers should be stable, i.e. they should not jump around on short time scales. There may be just some small fluctuations on larger time scales. If the buffers are jumping around on short time scales increase buffer sizes, start with device period and only if it not works ring buffer size. An optimal value for buffer sizes is the minimum size with stable buffers.
pbelkner is offline   Reply With Quote
Old 6th December 2015, 17:44   #176
Cool Barn
Junior Member
 
Join Date: Jul 2010
Posts: 14
The reason I increased all buffer sizes to the maximum for one particular revision (0.10.0) is because that was the only fix for that particular error. If I reduced the buffers to the minimum then the song wouldn't play at all. If I left them at default I would occasionally get the error, even in the middle of a song when I wasn't dragging the seeker. Increasing the buffer sizes to the maximum fixed the errors; I know it doesn't make any sense considering the error message actually said the buffer was too large, but increasing it was the only thing that solved it.

It may have worked for 0.10.0, but it hasn't for 0.12.0. But that doesn't matter now, because after a little more experimenting it appears that the best option is to leave everything at default, but change the device strategy to 'Pull' rather than 'Push'. That seems to fix all errors for me
Cool Barn is offline   Reply With Quote
Old 6th December 2015, 17:56   #177
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Cool Barn View Post
If I reduced the buffers to the minimum then the song wouldn't play at all.
With buffers to small you may get pops and glitches and drop outs or it even doesn't start to play at all. In figuring out the optimum start with greater buffers and reduce them having an eye at the visualization.
Quote:
Originally Posted by Cool Barn View Post
change the device strategy to 'Pull' rather than 'Push'.
If it works for your device you should indeed prefer "pull".
pbelkner is offline   Reply With Quote
Old 7th December 2015, 13:19   #178
djnforce9
Junior Member
 
Join Date: Feb 2014
Posts: 40
Tried the new version 0.12 and all of the problems are now gone except for one. When playing the "Air Force Come and Dey Flatten Your Home" song in Automatic mode, it still throws up the "AUDCLNT_E_UNSUPPORTED_FORMAT" error. In "Share" mode, it just hangs and the trace log repeats these three lines endlessly until I stop the song:
PHP Code:
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes
djnforce9 is offline   Reply With Quote
Old 7th December 2015, 13:25   #179
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by djnforce9 View Post
Tried the new version 0.12 and all of the problems are now gone except for one. When playing the "Air Force Come and Dey Flatten Your Home" song in Automatic mode, it still throws up the "AUDCLNT_E_UNSUPPORTED_FORMAT" error. In "Share" mode, it just hangs and the trace log repeats these three lines endlessly until I stop the song
Could you please provide the full trace from "open" until it starts to loop?

EDIT: Regarding endless loop without starting to play: Try to increase buffer size.

EDIT 2: A trace is not needed. I just saw that the plugin only re-trys when getting AUDCLNT_E_ENDPOINT_CREATE_FAILED in automatic and not when getting AUDCLNT_E_UNSUPPORTED_FORMAT. But please let me know whether increasing buffer size solves the other problem.
pbelkner is offline   Reply With Quote
Old 7th December 2015, 14:11   #180
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Quote:
Originally Posted by pbelkner View Post
Unfortunately I cannot reproduce this. I'm using (of course ) in_ffsox.dll. Which input plugin do you use?
Woow! I'll try it out. (Although I'm using winamp for music alone.)
I'm using the old 5.581 version for more than 5 years now (that was the last one which works with the mp3cue plugin), and the default Nullsoft MPEG audio decoder. just switch to it, and hopefully you can reproduce the problem. It works fine with the Directsound output.
chros is offline   Reply With Quote
Old 8th December 2015, 13:51   #181
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v0.14.0

What's new?
  • Introduced an (by default enabled) option "Write Block" that in case the plugin's "write" method delivers more data than actually could be written to the ring buffer it should block and wait until enough data are consumed from it rather then returning immediately.


  • For automatic mode, removed restrictions for switching from exclusive to shared mode.
Links:
Quote:
Originally Posted by chros View Post
1. still clipping, here a 2ch-48KHz-sample-aac : https://dailyuploads.net/j70whbsrmb99
Should be fixed now due to the new "Write Block" option.
Quote:
Originally Posted by djnforce9 View Post
When playing the "Air Force Come and Dey Flatten Your Home" song in Automatic mode, it still throws up the "AUDCLNT_E_UNSUPPORTED_FORMAT" error.
Should be fixed now.
Quote:
Originally Posted by djnforce9 View Post
In "Share" mode, it just hangs and the trace log repeats these three lines endlessly until I stop the song
May be fixed now also due to the new "Write Block" option. Otherwise try to increase buffer sizes because most likely the ring buffer is to small to receive the next package from the input plugin which is necessary to hold enough samples for starting. BTW, probably this may show a limit of "automatic" mode: exclusive and shared mode are completely different to each other, e.g. they may require completely different buffer sizes.
pbelkner is offline   Reply With Quote
Old 8th December 2015, 20:09   #182
djnforce9
Junior Member
 
Join Date: Feb 2014
Posts: 40
Here is the trace when playing the "Air Force Come and Dey Flatten Your Home" song in automatic mode using the new version. It reverts to shared but then the infinite loop takes place and playback never starts. Write block is enabled in this case.

EDIT: Increasing the ring buffer to 2.24 or fixes it. All other files that have a lower sample rate than 44Khz are corrected as well; thanks.

PHP Code:
setvolume
  volume
1.00
open
  wasapi clock
  REQUEST_OPEN
  samplerate
11025
  numchannels
-> 2
  bitspersamp
24
  audio client created
  got device period
    
default: 100000 hns
    minimum
30000 hns
    choosen
100000 hns
  device period scaled by 7.00 
(device period700400)
  
intitializing audio client EXCLUSIVE/PUSH with 700400/0 hns
  initializing audio client failed
  destroying audio client
  retrying in shared mode
  audio client created
  intitializing audio client SHARED
/PUSH with 700400/0 hns
  audio client initialized
  audio clock created
  SHARED BUFFER SIZE
772 frames
  START AUDIO CLIENT
1152 frames
  audio render client created
  RING BUFFER SIZE
1728 frames (2.24)
  
ring buffer created
canwrite
  REQUEST_CANWRITE
  free
864 frames (5184 bytes)
getoutputtime
  REQUEST_GETTIME
write
  REQUEST_WRITE
  free
864 frames (5184 bytes)
  
uFramesRing47uFramesMin1152 (1728)
canwrite
  REQUEST_CANWRITE
  free
840 frames (5043 bytes)
write
  REQUEST_WRITE
  free
840 frames (5043 bytes)
  
uFramesRing623uFramesMin1152 (1728)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
getoutputtime
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
  
REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
canwrite
  REQUEST_CANWRITE
  free
552 frames (3315 bytes)
getoutputtime
  REQUEST_GETTIME
getoutputtime
  REQUEST_GETTIME
close
  REQUEST_CLOSE
    min free reqests
11 (12)
    
min free results10 (12)
  
destroying ring buffer
  destroying audio render client
  destroying audio clock
  destroying audio client 
djnforce9 is offline   Reply With Quote
Old 9th December 2015, 19:36   #183
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Quote:
Originally Posted by pbelkner View Post
Introduced an (by default enabled) option "Write Block" that in case the plugin's "write" method delivers more data than actually could be written to the ring buffer it should block and wait until enough data are consumed from it rather then returning immediately.
Thanks Peter! I have to report back that: all the previous bugs are vanished (default settings) on my system!
I only need (badly) the System default sound device
chros is offline   Reply With Quote
Old 10th December 2015, 04:21   #184
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v0.14.1

What's new?
  • Increased default ring buffer size to 2.5.
Links:
Quote:
Originally Posted by djnforce9 View Post
Increasing the ring buffer to 2.24 or fixes it.
Thank you for the information and cf. above announcement.
Quote:
Originally Posted by chros View Post
I only need (badly) the System default sound device
This needs another re-structuring and will take a few days.
pbelkner is offline   Reply With Quote
Old 10th December 2015, 10:33   #185
chros
Member
 
chros's Avatar
 
Join Date: Nov 2003
Posts: 70
Quote:
Originally Posted by pbelkner View Post
This needs another re-structuring and will take a few days.
Thanks so much!
chros is offline   Reply With Quote
Old 14th December 2015, 04:45   #186
Tohno_Neil
Senior Member
 
Tohno_Neil's Avatar
 
Join Date: Aug 2013
Posts: 111
Why the exclusive mod do not support 24bit palyback?



Edited:

http://forums.winamp.com/attachment....1&d=1450072500
Attached Thumbnails
Click image for larger version

Name:	捕获.GIF
Views:	170
Size:	7.9 KB
ID:	52131  

Where going to my love?
Tohno_Neil is offline   Reply With Quote
Old 14th December 2015, 04:52   #187
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Tohno_Neil View Post
Why the exclusive mod do not support 24bit palyback?
I play 24 bit day in day out.

EDIT: Thanks for the trace. Hence, possibly because your DAC doesn't support 24 bit (is 16 bit only).
pbelkner is offline   Reply With Quote
Old 14th December 2015, 05:06   #188
Tohno_Neil
Senior Member
 
Tohno_Neil's Avatar
 
Join Date: Aug 2013
Posts: 111
Quote:
Originally Posted by pbelkner View Post
I play 24 bit day in day out.

EDIT: Thanks for the trace. Hence, possibly because your DAC doesn't support 24 bit (is 16 bit only).
I don't have a DAC decoder(I use laptop) , but in share mod,it's OK.

It just a BUG.

http://forums.winamp.com/attachment....1&d=1450073198



Use JRiver WASAPI exclusive mod , it's OK.







Use out_maiko
maiko.elementfx.com
Attached Thumbnails
Click image for larger version

Name:	sh.GIF
Views:	173
Size:	9.3 KB
ID:	52132   Click image for larger version

Name:	rj.GIF
Views:	443
Size:	79.3 KB
ID:	52133   Click image for larger version

Name:	ja2.GIF
Views:	473
Size:	40.0 KB
ID:	52134   Click image for larger version

Name:	sas.JPG
Views:	462
Size:	68.0 KB
ID:	52136  

Where going to my love?
Tohno_Neil is offline   Reply With Quote
Old 14th December 2015, 06:13   #189
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Tohno_Neil View Post
I don't have a DAC decoder(I use laptop) , but in share mod,it's OK.
Of course you have a DAC. DAC is the abbreviation for (d)igtital to (a)nalog (c)onverter. Without a DAC you would never be able to here anything from your computer because, as you hopefully know, the computer is digital and hearing is analog. How do you think that gap is filled in your case? I tell you: by a DAC build-in into your notebook.

Quote:
Originally Posted by Tohno_Neil View Post
It just a BUG.
Of course it is not a bug. Its just a call to the IAudioClient::Initialize method that fails with AUDCLNT_E_ENDPOINT_CREATE_FAILED. MS writes with regard to this error:
The method failed to create the audio endpoint for the render or the capture device. This can occur if the audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use.
https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
You should consider:
  • Your trace reveals that you've put the sliders for buffer configuration to the right. That's nonsense.
  • The hard copies from JRiver, Maiko etc. reveal that they're configured for pull mode. Comparing results from pull mode (JRiver, Maiko) with push mode (YASAPI) is just like comparing apples with beans, it's just nonsense.
  • Shouting at someone BUUUUUUUUUUUUUUUUUUUUUUUG!!!!!!!!!!!!!! and expecting help is nonsense anyway.
pbelkner is offline   Reply With Quote
Old 14th December 2015, 06:54   #190
Tohno_Neil
Senior Member
 
Tohno_Neil's Avatar
 
Join Date: Aug 2013
Posts: 111
Thanks, and good luck.

Where going to my love?
Tohno_Neil is offline   Reply With Quote
Old 20th December 2015, 21:10   #191
warwolf7
Junior Member
 
Join Date: Jan 2010
Posts: 4
Hi, First of all, thanks for your devotion!
the plugin works well on my computer.
I'm currently using Exclusive/push 16bits. But when I try 24bits, it works, but there is a terrible kind of like a white noise really louder than the music. I can hear the music underneath, but very low.
I tryied the test from windows to play 192khz/24bits stéréo test, and it works (see attached screenshot)
Log Verbose1 attached, I first played a song in 16bits, stopped it, changed to 24bits in winamp, then played that same song.

Let me know if you need any additional informations

I'm on windows 7 64bits,
winamp version 5.572(x86)
Attached Thumbnails
Click image for larger version

Name:	24bits-test.jpg
Views:	79
Size:	80.4 KB
ID:	52151  
Attached Files
File Type: txt 16bits_then_24bits.txt (4.9 KB, 65 views)
warwolf7 is offline   Reply With Quote
Old 21st December 2015, 02:52   #192
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by warwolf7 View Post
Let me know if you need any additional informations
Please send in a trace as described above.

PS: Maybe you have to increase buffer sizes (as described above).

EDIT: I just saw the attached trace, sorry.

EDIT 2: There's nothing wrong with the traces. Are you sure that you're device really supports 24 bit (i.e. by hardware and not just by some software transforming 24 bit to 16 bit)? If 8 bit are simply cut from 24 bit to achieve 16 bit it may sound as you describe. How does 24 bit sound in shared mode?

Last edited by pbelkner; 21st December 2015 at 04:15.
pbelkner is offline   Reply With Quote
Old 21st December 2015, 08:04   #193
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
v0.15.0

What's new?Links:
Quote:
Originally Posted by warwolf7 View Post
when I try 24bits, it works, but there is a terrible kind of like a white noise really louder than the music. I can hear the music underneath, but very low.
This description perfectly fits into how 24 bit truncated to 16 bit sounds. On the other hand YASAPI perfectly works on your system as it is supposed to do. There is no error reported back from your environment, i.e. the WASAPI interface/drivers to your device installed on your system. Also I'm pretty sure that YASAPI 24 bit works and indeed sends 24 bit to the WASAPI interface/drivers because that's exactly what I'm using day in day out.

Early versions of YASAPI called IAudioClient::IsFormatSupported prior to IAudioClient::Initialize. As it turned out, on some systems IAudioClient::IsFormatSupported failed where indeed IAudioClient::Initialize would have been possible. That's the reason why I dropped IAudioClient::IsFormatSupported because it prevented YASAPI to run on those systems wihout having any benefit on other systems.

It would be interesting to know what IAudioClient::IsFormatSupported is reporting back on your system and hence I brought it back with the new version as an option.
pbelkner is offline   Reply With Quote
Old 21st December 2015, 18:20   #194
warwolf7
Junior Member
 
Join Date: Jan 2010
Posts: 4
Quote:
Originally Posted by pbelkner View Post
This description perfectly fits into how 24 bit truncated to 16 bit sounds. On the other hand YASAPI perfectly works on your system as it is supposed to do. There is no error reported back from your environment, i.e. the WASAPI interface/drivers to your device installed on your system. Also I'm pretty sure that YASAPI 24 bit works and indeed sends 24 bit to the WASAPI interface/drivers because that's exactly what I'm using day in day out.

Early versions of YASAPI called IAudioClient::IsFormatSupported prior to IAudioClient::Initialize. As it turned out, on some systems IAudioClient::IsFormatSupported failed where indeed IAudioClient::Initialize would have been possible. That's the reason why I dropped IAudioClient::IsFormatSupported because it prevented YASAPI to run on those systems wihout having any benefit on other systems.

It would be interesting to know what IAudioClient::IsFormatSupported is reporting back on your system and hence I brought it back with the new version as an option.
So I got the trace with the new version 15 (in exclusive push mode)

PHP Code:
setvolume
  volume
0.00
open
  wasapi clock
  REQUEST_OPEN
  samplerate
44100
  numchannels
2
  bitspersamp
24
  audio client created
AUDCLNT_E_UNSUPPORTED_FORMAT
"yasapi_session.c" (155).
Error format not supported"yasapi_session.c" (161). 
It seems like it's not supported... But the thing is, I'm sending 24bits using windows test in the soundcard property(see attached image of my previous post) and it works.

So in shared push mode it works, but only if I set the soundcard to output 192kHz/24bits and I also need to play a audio file in the 192kHz/24bits format.

PHP Code:
setvolume
  volume
0.80
open
  wasapi clock
  REQUEST_OPEN
  samplerate
192000
  numchannels
2
  bitspersamp
24
  audio client created
  format supported
  got device period
    
default: 100000 hns
    minimum
30000 hns
    choosen
100000 hns
  device period scaled by 7.00 
(device period700400)
  
intitializing audio client SHARED/PUSH with 700400/0 hns
  audio client initialized
  audio clock created
  SHARED BUFFER SIZE
13448 frames
  START AUDIO CLIENT
13824 frames
  audio render client created
  RING BUFFER SIZE
27072 frames (2.01)
  
ring buffer created
setvolume
  volume
0.80
  uFramesRing
576uFramesMin13824 (27072)
  
uFramesRing1152uFramesMin13824 (27072)
  
uFramesRing1728uFramesMin13824 (27072)
  
uFramesRing2304uFramesMin13824 (27072)
  
uFramesRing2880uFramesMin13824 (27072)
  
uFramesRing3456uFramesMin13824 (27072)
  
uFramesRing4032uFramesMin13824 (27072)
  
uFramesRing4096uFramesMin13824 (27072)
  
uFramesRing4672uFramesMin13824 (27072)
  
uFramesRing5248uFramesMin13824 (27072)
  
uFramesRing5824uFramesMin13824 (27072)
  
uFramesRing6400uFramesMin13824 (27072)
  
uFramesRing6976uFramesMin13824 (27072)
  
uFramesRing7552uFramesMin13824 (27072)
  
uFramesRing8128uFramesMin13824 (27072)
  
uFramesRing8192uFramesMin13824 (27072)
  
uFramesRing8768uFramesMin13824 (27072)
  
uFramesRing9344uFramesMin13824 (27072)
  
uFramesRing9920uFramesMin13824 (27072)
  
uFramesRing10496uFramesMin13824 (27072)
  
uFramesRing11072uFramesMin13824 (27072)
  
uFramesRing11648uFramesMin13824 (27072)
  
uFramesRing12224uFramesMin13824 (27072)
  
uFramesRing12288uFramesMin13824 (27072)
  
uFramesRing12864uFramesMin13824 (27072)
  
uFramesRing13440uFramesMin13824 (27072)
  
uFramesRing14016uFramesMin13824 (27072)
  
uFrames13448uFramesPadding0uFramesWrite13448uFramesRing14016q:
 
0.50bFlush0
  audio client started
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26872,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing27000,
q0.50bFlush0
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26936,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing27000,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing26936,
q0.50bFlush0
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26872,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing26936,
q0.50bFlush0
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26872,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing27000,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing26872,
q0.50bFlush0
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26808,
q0.50bFlush0
  uFrames
13448uFramesPadding5768uFramesWrite7680uFramesRing26936,
q0.50bFlush0
  uFrames
13448uFramesPadding7688uFramesWrite5760uFramesRing26872,
q0.50bFlush0
close
  REQUEST_CLOSE
    min free reqests
(12)
    
min free results(12)
  
stopping audio client
  destroying ring buffer
  destroying audio render client
  destroying audio clock
  destroying audio client 
Could the WASAPI driver be the problem? (I'm might be confused here, as I don't know if that WASAPI driver is contained in your plugin or if it's supposed to already be on my computer)

Thank you very much for your time.

Last edited by warwolf7; 21st December 2015 at 18:31. Reason: Trying to have readable post, add information
warwolf7 is offline   Reply With Quote
Old 22nd December 2015, 13:34   #195
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
What is YASAPI?

The YASAPI output plugin is a mediator between Winamp and the Windows Audio Session API (WASAPI). It's purpuse is to map the protocol of an Winamp output plugin as specified by Nullsoft to the WASAPI protocol as specified by Microsoft. In order to understand more closely what is meant by this sentence we will
  • first have a closer look on what the WASAPI protocol is (or the subset of WASAPI used by YASAPI, at least my understanding of it), and
  • than on what the protocol of an Winamp output plugin is (at least my understanding of it) and how YASAPI implements it.
The goal of the following is to give you some more insight into what you can expect from YASAPI (and, of course, what not).

What is the WASAPI protocol?

The WASAPI protocol is a set of virtual (audio related) methods for sending requests to the Windows OS (starting with Vista). I call them virtual because
  • at one hand it is well documented by Microsoft what they are supposed to do, and
  • on the other hand it depends on what is installed on your system whether the specification is matched or whether the implementation is incomplete or whether there is no implementation at all (the last point mainly refers to several parameter combinations of IAudioClient::Initialize, cf. below).
You should note that what those virtual methods really do (as opposed to the specification by Microsoft) depends to some extend on third parties, e.g. the manufacturer of your physical audio device because usually it is the one providing the drivers to that device (i.e. some DLL dynamically loaded by the Windows OS implementing those virtual methods).

YASAPI makes use of the following of those WASAPI virtual methods:Again, the actual behaviour of the virtual methods listed above has to be accepted as is. There is no way to alter it independent on whether it matches the specification or not. The actual behaviour may differ from device to device. Dependent on the degree of matching the specification we say a that a device (or it's driver) supports WASAPI, incomplete supports WASAPI, or not supports WASAPI. Such a statement can be made independent of YASAPI.

What is the protocol of an Winamp output plugin and how YASAPI implements it?

The protocol of an Winamp output plugin is defined in the C header file "out.h" as delivered with the Winamp SDK (Winamp software development kit).
PHP Code:
#ifndef NULLSOFT_OUTH
#define NULLSOFT_OUTH
#include <windows.h>
#include <stddef.h>
// ids:
// waveout: 32
// gapless: 64
// xfade: 63
// disk: 33
// dsound: 38
// NULL: 65
// mm2: 69

#if (_MSC_VER <= 1200)
typedef int intptr_t;
#endif

#define OUT_VER 0x10

typedef struct 
{
    
int version;                // module version (OUT_VER)
    
char *description;          // description of module, with version string
    
intptr_t id;                        // module id. each input module gets its own. non-nullsoft modules should
                                // be >= 65536. 

    
HWND hMainWindow;           // winamp's main window (filled in by winamp)
    
HINSTANCE hDllInstance;     // DLL instance handle (filled in by winamp)

    
void (*Config)(HWND hwndParent); // configuration dialog 
    
void (*About)(HWND hwndParent);  // about dialog

    
void (*Init)();             // called when loaded
    
void (*Quit)();             // called when unloaded

    
int (*Open)(int samplerateint numchannelsint bitspersampint bufferlenmsint prebufferms); 
                    
// returns >=0 on success, <0 on failure

                    // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. 
                    //    ... so don't expect the max latency returned to be what you asked for.
                    // returns max latency in ms (0 for diskwriters, etc)
                    // bufferlenms and prebufferms must be in ms. 0 to use defaults. 
                    // prebufferms must be <= bufferlenms
                    // pass bufferlenms==-666 to tell the output plugin that it's clock is going to be used to sync video
                    //   out_ds turns off silence-eating when -666 is passed

    
void (*Close)();    // close the ol' output device.

    
int (*Write)(char *bufint len);   
                    
// 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. 
                    // 1 returns not able to write (yet). Non-blocking, always.

    
int (*CanWrite)();  // returns number of bytes possible to write at a given time. 
                        // Never will decrease unless you call Write (or Close, heh)

    
int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
                        // written (i.e. closing while IsPlaying() returns 1 would truncate the song

    
int (*Pause)(int pause); // returns previous pause state

    
void (*SetVolume)(int volume); // volume is 0-255
    
void (*SetPan)(int pan); // pan is -128 to 128

    
void (*Flush)(int t);   // flushes buffers and restarts output at time t (in ms) 
                            // (used for seeking)

    
int (*GetOutputTime)(); // returns played time in MS
    
int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)

Out_Module;


#endif 
For further clarification there is the C source code for a "dummy" output plugin called "out_null" also delivered with the Winamp SDK.

The situation regarding the protocol of an Winamp output plugin is in one respect similar to the one with the WASAPI protocol: there is a set of well specified methods. But there is one huge difference: there is no implementation of those methods. Indeed it is the purpose of an output plugin to provide an implementation.

The following privide an overview of the methods of an Winamp output plugin, what they are expected to do, and a sketch on how YASAPI maps them to the WASAPI protocol.
  • Init: Called once when Winamp is started. YASAPI loads all objects along the path CoCreateInstance -> IMMDeviceEnumerator -> IMMDeviceCollection -> IMMDevice.
  • Quit: Called once when Winamp is shut down. YASAPI deletes all objects loaded by Init in opposite order.
  • Open: Called by Winamp (or the current input or dsp plugin) each time a new track starts. YASAPI loads all objects along the path IMMDevice::Activate -> IAudioClient -> IAudioRenderClient. Among others it initializes the audio client by means of IAudioClient::Initialize and sets up a ring buffer. The ring buffer is used to decouple Winamp's Write requests (cf. below) from WASAPI's asynchronous requests to write to the device via IAudioRenderClient (triggered by IAudioClient via an Event Object in case of pull mode or by a Waitable Timer Object in case of push mode). Winamp's Write requests write to the ring buffer and WASAPI's asynchronous requests for writing to the device are reading from the ring buffer.
  • Close: Called by Winamp (or the current input or dsp plugin) each time a track ends. YASAPI deletes all objects loaded or created by Open (including the ring buffer) in opposite order.
  • Write: In an unpredictable way Winamp (or the current input or dsp plugin) requests to write a certain amount of audio data (in general of unpredictable size) to the audio device. Because the audio device is only ready to receive data at unpredictable times which are not in sync with the Winamp Write requests (not in time and not in size) YASAPI lets Winamp write to it's ring buffer instead.
  • CanWrite: The output plugin should report back to Winamp (or the current input or dsp plugin) how much audio data it is ready to receive via an Write request. YASAPI reports back how much space is left in it's ring buffer. As we learned the hard way some input plugins (notably "in_mp3") don't care about this information and may send Write requests with packets larger than the available space anyway.
  • IsPlaying: Called by Winamp (or the current input or dsp plugin) when it has no more data to send via a Write request to the output plugin and the output plugin is expected to report back whether it is still playing some cached data (is still draining, e.g. YASAPI may have some data still cached in it's ring buffer). Typically an input plugin continues by sending a Close request to the output plugin after having learned that the output plugin is no longer draining. As we learned the hard way, some input plugins don't follow this standard protocol but send IsPlaying (drain) requests not just at the end of a track but in between (in particular "in_NotSoFatso").
  • Pause: Depending on some parameter, Winamp (or the current input or dsp plugin) requests to begin or end pause playing. YASAPI forwards this request to IAudioClient::Stop or IAudioClient::Start, respectively.
  • SetVolume: Winamp (or the current input or dsp plugin) requests that the output plugin should apply some factor to the data send by Write requests. Because YASAPI is not a DSP (digital signal processing) plugin this is only possibly when explicitly enabled by the user. In this case YASAPI simply applies the factor while writing to it's ring buffer without dithering and without clip prevention.
  • Flush: Winamp (or the current input or dsp plugin) requests resetting of all cashed data. This request is typically issued when a user seeks to another position with Winamp's seeker slider. YASAPI resets it's ring buffer.
  • GetOutputTime: YASAPI maps this to IAudioClock::GetPosition and IAudioClock::GetFrequency.
  • GetWrittenTime: Not understood what's going on here. YASAPI's implementation is identical to "out_null".
When we are talking about "bugs" they may be found only in the above sketched implementation. There are two classes of bugs
  • simple programming errors, and
  • errors due to assumptions on the protocol of an Winamp output plugin which does not hold in general.
Both classes of bugs should manifest themselfs in a trace. In general, each bug should manifest itself in some way in a trace. Regarding the second class of bugs two (former, now fixed) of them are mentioned in the above sketch of what YASAPI is: one with regard to CanWrite and the "in_mp3" input plugin and the other one with regard to IsPlaying and the "in_NotSoFatso" input plugin.
pbelkner is offline   Reply With Quote
Old 22nd December 2015, 14:08   #196
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by warwolf7 View Post
Could the WASAPI driver be the problem?
The short answer ist yes, for me it looks exactly that way. But it's hard to tell from a distance. For the long answer cf. the above post What is YASAPI?.
Quote:
Originally Posted by warwolf7 View Post
It seems like it's not supported... But the thing is, I'm sending 24bits using windows test in the soundcard property(see attached image of my previous post) and it works.
To me it looks like your WASAPI driver truncates 24 bit to 16 bit while writing to the device, possibly while using the methods of IAudioRenderClient. That it seems to work from the system control is because that's a complete different story, the system control is for configuring DirectSound, and I'm convinced that "out_ds" is working on your system.
Quote:
Originally Posted by warwolf7 View Post
So in shared push mode it works, but only if I set the soundcard to output 192kHz/24bits and I also need to play a audio file in the 192kHz/24bits format.
This is also strange. That, in shared mode, the sample frequency had to exact match what is configured in system control dates back until Benski entered the scene and proposed to make use of the AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM flag in IAudioClient::Initialize. This is provided as an option on the "Device Options" page of the configuration dialog. Please double check whether "Auto Convert PCM" is enabled. If that is the case and does not work I consider it another hint that your drivers only provide a limited WASAPI support.

Last edited by pbelkner; 22nd December 2015 at 15:14.
pbelkner is offline   Reply With Quote
Old 22nd December 2015, 18:16   #197
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by warwolf7 View Post
So in shared push mode it works, but only if I set the soundcard to output 192kHz/24bits and I also need to play a audio file in the 192kHz/24bits format.
When testing this with different frequencies you should disable IAudioClient::IsFormatSupported because different to IAudioClient::Initialize it doesn't take into account AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM.
pbelkner is offline   Reply With Quote
Old 25th December 2015, 23:46   #198
warwolf7
Junior Member
 
Join Date: Jan 2010
Posts: 4
Thanks pbelkner.
Thanks for all that info!! And your time !

It does indeed works in shared mode with the "test format" checkbox UNCHECKED and auto Convert PCM checkbox CHECKED. At the output of my soundcard I get the format I choosed for the output on the soundcard property (192Khz 24bits). The files are then converted somewhere in the chain to match the output. It does work for every files in everyformat I had on my pc (44.1-16bits/ 48-24bits / 96khz-24bits / 192khz-24bits).

in 24bits
I tried the automatic mode with all combination possible of checkbox. and I tryied switching the clock to system as well. Nothing works. Just nothing

So, I will leave it to 16bits exclusive mode for now, because this works well for now. I don't feel like upconverting to 24bits is any better for my DAC (which is a seperate unit out of my PC). It could be because this output is from my integrated Soundcard out of my motherboard. I would not be surprised that the driver for it was cheaply created with the minimum effort.
I don't exactly know what I could do to help you solve this, or if it's really worth the effort.

Thanks a lot
warwolf7 is offline   Reply With Quote
Old 29th December 2015, 06:30   #199
Tohno_Neil
Senior Member
 
Tohno_Neil's Avatar
 
Join Date: Aug 2013
Posts: 111
when play .ape file sometime

It's choppy.

Max ring buffer size is not not enough?






Underruns?
Attached Thumbnails
Click image for larger version

Name:	20151229152433.png
Views:	320
Size:	44.4 KB
ID:	52178  

Where going to my love?
Tohno_Neil is offline   Reply With Quote
Old 29th December 2015, 14:32   #200
pbelkner
Senior Member
 
Join Date: Jun 2010
Posts: 405
Quote:
Originally Posted by Tohno_Neil View Post
Max ring buffer size is not not enough?
How it looks when you decrease device period?
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