Author Topic: How to remove a BASS_ASIO_ChannelEnableMirror?  (Read 495 times)

Dev01

  • Posts: 46
I'm trying to use BASS_ASIO_ChannelEnableMirror.
Code: [Select]
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex, True, L_RecordChannelIndex)         'mirror input channel L_RecordChannelIndex   to output L_ChannelIndex
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex + 1, True, L_RecordChannelIndex + 1) 'mirror input channel L_RecordChannelIndex+1 to output L_ChannelIndex+1
It works, somehow.

I've got 2 problems:
1) when I use BASS_ASIO_ChannelEnableMirror, if I play something on main channnel, it 's veeeeery sloooow to be played
2) how to remove a BASS_ASIO_ChannelEnableMirror?
    I thought something like
Code: [Select]
    lRet = BASS_ASIO_ChannelReset(False, L_ChannelIndex, BASS_ASIO_RESET_JOIN)
Can you help me?

Ian @ un4seen

  • Administrator
  • Posts: 26102
Re: How to remove a BASS_ASIO_ChannelEnableMirror?
« Reply #1 on: 5 Jun '23 - 17:11 »
1) when I use BASS_ASIO_ChannelEnableMirror, if I play something on main channnel, it 's veeeeery sloooow to be played

Please clarify what the main channel is (do you mean the mirrored input channel?), and when you say it's slow, do you mean there's a delay or it sounds slowed-down? If it's a delay, how long is that and what "buflen" value did you use in your BASS_ASIO_Start call?

2) how to remove a BASS_ASIO_ChannelEnableMirror?
    I thought something like
Code: [Select]
    lRet = BASS_ASIO_ChannelReset(False, L_ChannelIndex, BASS_ASIO_RESET_JOIN)

Do you want to disable it without stopping the device? If so, that isn't currently possible, but you could mute it instead via BASS_ASIO_ChannelSetVolume. To disable it after stopping the device, you can do so by replacing BASS_ASIO_RESET_JOIN with BASS_ASIO_RESET_ENABLE in the BASS_ASIO_ChannelReset call.

Dev01

  • Posts: 46
Re: How to remove a BASS_ASIO_ChannelEnableMirror?
« Reply #2 on: 6 Jun '23 - 09:48 »
Quote
do you mean the mirrored input channel?
Yes, I want to hear the input on the output.

1)
"veeeeery sloooow" = it sounds slowed-down
I think I've solved this changing from
Code: [Select]
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex, True, L_RecordChannelIndex)         'mirror input channel L_RecordChannelIndex   to output L_ChannelIndex
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex + 1, True, L_RecordChannelIndex + 1) 'mirror input channel L_RecordChannelIndex+1 to output L_ChannelIndex+1
to
Code: [Select]
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex, True, L_RecordChannelIndex)         'mirror input channel L_RecordChannelIndex   to output L_ChannelIndex
so doesn't mirror the +1 channel (right/stereo).

2)
I've tried with BASS_ASIO_RESET_ENABLE but I'm not sure: should I reset the Input channel or the Output channel or Both?
I expected a function like BASS_ASIO_ChannelDisableMirror, to do not touch the channels.


UPDATE:
Finally, I think I've solved.
I missed two BASS_ASIO_Stop
Suggestion for the future: make that BASS_ASIO_ChannelReset returns false if the channel is in use and the function fails.
Thank you.
« Last Edit: 6 Jun '23 - 11:57 by Dev01 »

Ian @ un4seen

  • Administrator
  • Posts: 26102
Re: How to remove a BASS_ASIO_ChannelEnableMirror?
« Reply #3 on: 6 Jun '23 - 14:41 »
"veeeeery sloooow" = it sounds slowed-down
I think I've solved this changing from
Code: [Select]
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex, True, L_RecordChannelIndex)         'mirror input channel L_RecordChannelIndex   to output L_ChannelIndex
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex + 1, True, L_RecordChannelIndex + 1) 'mirror input channel L_RecordChannelIndex+1 to output L_ChannelIndex+1
to
Code: [Select]
lRet = BASS_ASIO_ChannelEnableMirror(L_ChannelIndex, True, L_RecordChannelIndex)         'mirror input channel L_RecordChannelIndex   to output L_ChannelIndex
so doesn't mirror the +1 channel (right/stereo).

Oh, that's strange then. Was it only the right channel that sounded slow?

I've tried with BASS_ASIO_RESET_ENABLE but I'm not sure: should I reset the Input channel or the Output channel or Both?
I expected a function like BASS_ASIO_ChannelDisableMirror, to do not touch the channels.

You would use BASS_ASIO_RESET_ENABLE on the output channel (the channel that is mirroring another). Another way to disable a channel is to call BASS_ASIO_ChannelEnable with proc=NULL.

Another possible solution that I forgot to mention is using BASS_ASIO_ChannelPause to pause the mirror, if you want to stop the mirroring without stopping the device.

Finally, I think I've solved.
I missed two BASS_ASIO_Stop
Suggestion for the future: make that BASS_ASIO_ChannelReset returns false if the channel is in use and the function fails.

BASS_ASIO_ChannelReset should already return false (with error code BASS_ERROR_START) if BASS_ASIO_RESET_ENABLE (or BASS_ASIO_RESET_JOIN) is used while the device isn't stopped. Is it not? Please use BASS_ASIO_IsStarted to confirm whether the device is started or stopped then.