20 May '13 - 01:03 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Multiple BASS_StreamPutData not working  (Read 489 times)
dts350z
Posts: 17


« on: 12 Apr '12 - 01:32 »
Reply with quoteQuote

Audio stops after the bytes in the first BASS_StreamPutData are used. I have: BASS_ChannelPlay(chan,false), so subsequent BASS_StreamPutData should continue to play, right?

BASS_ChannelGetData(chan, outbuf, BASS_DATA_AVAILABLE); shows there is data available but the audio stops.

Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #1 on: 12 Apr '12 - 14:13 »
Reply with quoteQuote

What does BASS_ChannelIsActive say about the "chan" channel's status at that point? Please also check what values BASS_StreamPutData is returning, eg. is it increasing with each call as more data is queued up?
Logged
dts350z
Posts: 17


« Reply #2 on: 12 Apr '12 - 20:09 »
Reply with quoteQuote

Looks like the return value from put is not incrementing properly. 

Opened input file C:\Users\dts350z\Music\BeeBop\10 - Ask DNA.flac.
Started stream
pos: 000000000  time: 0:00      Read 15876000l Bytes     Put returned 15787804l Playing queued: 88196
pos: 000220996  time: 0:01      Read 15876000l Bytes     Put returned 4294967295l       Playing queued: 80068
pos: 000402548  time: 0:02      Read 15876000l Bytes     Put returned 4294967295l       Playing queued: 71540
pos: 000439576  time: 0:02      Read 3873744l Bytes      Put returned 4294967295l       Playing queued: 72076
pos: 000451156  time: 0:02      done reading PCM data           Playing queued: 82932
pos: 000496856  time: 0:02      done reading PCM data           Playing queued: 79268
pos: 000531692  time: 0:03      done reading PCM data           Playing queued: 86920
pos: 000541700  time: 0:03      done reading PCM data           Playing queued: 76896
pos: 000551688  time: 0:03      done reading PCM data           Playing queued: 84396
pos: 000595192  time: 0:03      done reading PCM data           Playing queued: 76136
pos: 000605356  time: 0:03      done reading PCM data           Playing queued: 83820

snip

pos: 015781696  time: 1:29      done reading PCM data           Playing queued: 73240
pos: 015791884  time: 1:29      done reading PCM data           Playing queued: 80532
pos: 015802464  time: 1:29      done reading PCM data           Playing queued: 73412
pos: 015812540  time: 1:29      done reading PCM data           Playing queued: 63372
pos: 015822844  time: 1:29      done reading PCM data           Playing queued: 53080
pos: 015832852  time: 1:29      done reading PCM data           Playing queued: 43064
pos: 015842884  time: 1:29      done reading PCM data           Playing queued: 33008
pos: 015852900  time: 1:29      done reading PCM data           Playing queued: 23024
pos: 015863144  time: 1:29      done reading PCM data           Playing queued: 12784
pos: 015873328  time: 1:29      done reading PCM data           Playing queued: 2588
pos: 015876000  time: 1:30      done reading PCM data           Stopped queued: 0 Stopping Channel
pos: 000000000  time: 0:00      done reading PCM data           Stopped queued: 0 Stopping Channel
pos: 000000000  time: 0:00      done reading PCM data           Stopped queued: 0 Stopping Channel
pos: 000000000  time: 0:00      done reading PCM data           Stopped queued: 0 Stopping Channel
pos: 000000000  time: 0:00      done reading PCM data           Stopped queued: 0 Stopping Channel

Logged
dts350z
Posts: 17


« Reply #3 on: 12 Apr '12 - 20:24 »
Reply with quoteQuote

Looks like I had the printf format wrong on the bytes in and return for the put:

Started stream
pos: 000000000  time: 0:00      Read 15876000 Bytes      Put returned 15787804  Playing queued: 88196
pos: 000116788  time: 0:00      Read 15876000 Bytes     StreamPutData failed Error: 45  Playing queued: 77476
pos: 000239744  time: 0:01      Read 15876000 Bytes     StreamPutData failed Error: 45  Playing queued: 78016
pos: 000272128  time: 0:01      Read 3873744 Bytes      StreamPutData failed Error: 45  Playing queued: 80876
pos: 000282064  time: 0:01      done reading PCM data           Playing queued: 70968
pos: 000291928  time: 0:01      done reading PCM data           Playing queued: 78748
pos: 000302232  time: 0:01      done reading PCM data           Playing queued: 86080

So the put is failing. What does BASS_ERROR_ENDED mean?
Logged
dts350z
Posts: 17


« Reply #4 on: 12 Apr '12 - 20:27 »
Reply with quoteQuote

And why is the first put returning more bytes than I told it to put?
Logged
dts350z
Posts: 17


« Reply #5 on: 12 Apr '12 - 21:30 »
Reply with quoteQuote

OK I got it working. Thanks.

Still don't understand why the returned byte from put is more than I told it to put.
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #6 on: 13 Apr '12 - 15:33 »
Reply with quoteQuote

So the put is failing. What does BASS_ERROR_ENDED mean?

BASS_ERROR_ENDED would result when the BASS_STREAMPROC_END flag (which marks the end of the data) has been used in a previous BASS_StreamPutData call.

Still don't understand why the returned byte from put is more than I told it to put.

The only explanation that comes to mind is that there is data queued from a previous BASS_StreamPutData call. Is that not the case? Note BASS_StreamPutData returns the total amount of data that is currently queued, not only the amount from the current call.
Logged
dts350z
Posts: 17


« Reply #7 on: 13 Apr '12 - 17:38 »
Reply with quoteQuote

It happens on the first put call too. Would the extra bytes represent the latency between starting play and the first put call?

Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #8 on: 13 Apr '12 - 17:54 »
Reply with quoteQuote

No, the BASS_StreamPutData return value won't be related to latency. Looking at your log above, is "Read" what you passed in the BASS_StreamPutData "length" parameter? If so, the return value doesn't actually appear to be higher, ie. 15787804 is lower than 15876000.
Logged
dts350z
Posts: 17


« Reply #9 on: 13 Apr '12 - 21:18 »
Reply with quoteQuote

I stand corrected.

Thanks.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines