Author Topic: Clone "mixed" stream to another output device ?  (Read 3081 times)

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Clone "mixed" stream to another output device ?
« Reply #50 on: 13 Jun '24 - 17:08 »
I tried with both , no problem with measurement between MixerSources and MixerMain (excepted that with BASS_ChannelGetLevel the audio plays too fast).

Yes, you should only use BASS_Mixer_ChannelGetLevel on mixer sources, because the data taken by BASS_ChannelGetLevel wouldn't be seen by the mixer (causing skipping/speedy playback).

Measuring MixerMain output receving zeros but sound still ok (no dropouts).

Do you mean BASS_ChannelGetLevel on SplitOutDev? To perhaps narrow it down, does it still happen if you don't set BASS_ATTRIB_BUFFER to 0 on SplitOutDev?

Couin

  • Posts: 111
Re: Clone "mixed" stream to another output device ?
« Reply #51 on: 14 Jun '24 - 22:44 »
Hi Ian

Removing buffer attribute resolves the "missing measures" but makes getposition jerky (resulting to a remaining time slow refresh). Plus, it add delay bewteen hitting play and sound.

Couin

  • Posts: 111
Re: Clone "mixed" stream to another output device ?
« Reply #52 on: 25 Jun '24 - 01:34 »
Hi :)

I'm modifying ouput device selection method so now, changing device directly apply, without reloading audio files:
Call BASS_StreamFree(SplitOutDev(outp)) 'where outp is 0 or 1, related with Main or Aux outputs of the schematic here http://www.un4seen.com/forum/?topic=20403.msg143048#msg143048
Changing the device number et recreate the SplitOutDev (split) stream.

Works OK, but just a minor question (for a rare situation):
If Aux is firstly set on "None" device (so 0), if I played some jingle, when I change Aux for an output device, I get the end part of last playback.

I tried to add some BASS_Split_StreamReset calls , for SplitOutDev, MixerMain or MixerAux, but nothing change.
I added BASS_CONFIG_SPLIT_BUFFER, if I set to 0, I get no more part of last playback on device change, but playback is to fast and crappy. If I set to a value like 100, the playback speed is ok but I get a small part of previous playback.

Is there a way to clear buffer to prevent this ?

Thanks :D




Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Clone "mixed" stream to another output device ?
« Reply #53 on: 25 Jun '24 - 14:38 »
Removing buffer attribute resolves the "missing measures" but makes getposition jerky (resulting to a remaining time slow refresh). Plus, it add delay bewteen hitting play and sound.

OK. Here's a modified version of the CONTEST.C example for you to try for comparison, adding a BASS_ATTRIB_BUFFER=0 option and a BASS_DATA_AVAILABLE display:

   www.un4seen.com/stuff/contest-nobuf.exe

Please try that with and without the "-n" option (BASS_ATTRIB_BUFFER=0), and see whether the level display is working and what "data" values (BASS_DATA_AVAILABLE) are shown in each case. If it's working fine even with "-n" then you can also try monitoring the BASS_DATA_AVAILABLE values (with BASS_ChannelGetData) in your app to see if they're different.

I'm modifying ouput device selection method so now, changing device directly apply, without reloading audio files:
Call BASS_StreamFree(SplitOutDev(outp)) 'where outp is 0 or 1, related with Main or Aux outputs of the schematic here http://www.un4seen.com/forum/?topic=20403.msg143048#msg143048
Changing the device number et recreate the SplitOutDev (split) stream.

Works OK, but just a minor question (for a rare situation):
If Aux is firstly set on "None" device (so 0), if I played some jingle, when I change Aux for an output device, I get the end part of last playback.

A new splitter shouldn't play old data from its source, so it seems like the old sound may actually be in new data from the source. How much old sound are you getting? And is this happening on the same WinXP VM and/or on other systems? Does adding the BASS_MIXER_NONSTOP flag to MixerAux make any difference?

Couin

  • Posts: 111
Re: Clone "mixed" stream to another output device ?
« Reply #54 on: 26 Jun '24 - 00:05 »
Hi Ian :)

BASS_MIXER_NONSTOP flag seems resolve the problem :)
(It's not on the XP VM of the level measurement problem, the re-playing was on a non-VM W10, which I use for main developpment).

About contest exe, I will test this afternoon at work (where is the XP VM on which I get some missing level measures), it's my last day before summer hollydays.

Couin

  • Posts: 111
Re: Clone "mixed" stream to another output device ?
« Reply #55 on: 26 Jun '24 - 14:45 »
Hi Ian,

I tested the exe with and without -n flag, with a 10 seconds sine of 1 kHz @ max amplitude.

With -n , the VU-meters doesn't fall down. Data value runs around 20000, but sometimes with a near from 0 (too fast to read exactly), no sound problem.

Without -n , VU-meters still OK, Data around 160000 , and I did not saw 0 values.

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Clone "mixed" stream to another output device ?
« Reply #56 on: 26 Jun '24 - 17:26 »
Is that on the same system that you're having the BASS_ChannelGetLevel=0 problem with your app? If so, strange that it isn't happening with the modified example. You could try monitoring the BASS_DATA_AVAILABLE value in your app for comparison.

Code: [Select]
avail = BASS_ChannelGetData(handle, 0, BASS_DATA_AVAILABLE)

Also, if you're changing any config settings via BASS_SetConfig, try removing that to use the defaults (which is what the example does).

Couin

  • Posts: 111
Re: Clone "mixed" stream to another output device ?
« Reply #57 on: 26 Jun '24 - 23:16 »
Yes, I tested your exe on the samed XP VM which makes some missing level measures.
But as I previoulsy wrote, I get missing messures on splitted output of second mixer (Main or Aux), but not if I measure between primary and secondary mixer ( so SplitSources ).

I took the pc where the VM is hosted, for hollydays :P
So I will be able to do tests on it (but not today and friday).