BASS for WinCE

Started by Ian @ un4seen,

whitevv

#220
Hello i have error with bass.dll.
I have devices
1)  wince 5.0 ram 128mb cpu MediaTek (MT3351) - with audioin
2)  wince 6.0 ram  128mb cpu SiRF Atlas 500MHz - without audioin

When i run on device 2 and Emulator RECTEST.EXE - is working well.

But i run RECTEST.EXE on Device 1 program work well to 1-2 seconds then:
1) record timer stopping around 61648
2) sound level setting to soft
3) usb connection (active sync) is disconnecting
4) no error message.
5) then play work well

When i try my program i have same problem.
My program get level from audioin through 1-2 seconds level is not change

How i can debug bass.dll

Ian @ un4seen

Can you please clarify what "audioin" is, eg. is that some special software/setting, or do you just mean that the device has an audio input/microphone? Is recording working properly in other software on the same device?

whitevv

#222
When i run rectest.exe on device 2 (http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=320560709388) and start play mp3 (other program). rectest record playing sound (may be from mixer)

When i run rectest.exe on device 1 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=260655618873) and start play mp3 other program. rectest record (1-2 seconds) simultaneously from microphone and  record playing sound. Them rectest is stopping.

i can't find other software to recording.

p.s. rectest on device 2 work well, but only 1-2 seconds.

Ian @ un4seen

Quote from: whitevvWhen i run rectest.exe on device 1 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=260655618873) and start play mp3 other program. rectest record (1-2 seconds) simultaneously from microphone and  record playing sound. Them rectest is stopping.

Does the problem only begin when you start to play stuff in the other program, ie. it continues recording fine if you don't do that? If so, perhaps the device's audio hardware is single-duplex, ie. can't record and play at the same time. Does the 1-2s recording include any sound from the MP3 file?

Regarding other recording software, Google throws up a few shareware apps that you could just quickly try to see whether they are affected by the problem too.

whitevv

The  problem is present and when I start only rectest.exe, without the other programs (for recording only from microphone).

When i try run player and record (simultaneously). sound (1-2 seconds) include amount from the MP3 and microphone.

Ian @ un4seen

OK. I'll send you a debug version to get some info on what's happening there.

Rawukal

Hi,
is it possible to play an mms stream with the bass CE Library?

Greetings

Ian @ un4seen

I'm afraid there isn't a BASSWMA build for WinCE, as the required system libraries/APIs aren't available, but there is a DirectShow WMA codec available and a BASSDS add-on to make use of that. The codec isn't included in Windows Mobile, but if you are using a WinCE platform that does include the codec (WMADMOD.DLL), I can send you the BASSDS add-on to try.

Rawukal

Hi,
thank you for your answere.
Specifically i use WinCe 6. I tested a mms stream with the included MediaPlayer (ceplayer.exe).
Does this app use the same .dll?
I would be glad that you can send me the plugin. Is there a .net Version?

Greetings

whitevv

#229
Hello Ian@un4seen,
I have changed the device and i not have any problems above, possible problem was in my hardware.  :)

I have other question:
There is possibility of the simultaneous start 2х instance BASS.DLL with different sample rate , or there is other way of the decision?

I need get simultaneously importance of the amplitudes for each frequency with different stepping frequencies(from 16 to 100Hz step 1 Hz and from 100 to 16000Hz Step 5 HZ)

i use
BASS_Init(-1, 44100, BASS_DEVICE_MONO, handle, nil);
Bass_ChannelGetData(chan, @data, BASS_DATA_FFT8192);  

Ian @ un4seen

I think it would be possible to dynamically load (eg. LoadLibrary) a renamed 2nd BASS.DLL, but I'm not sure that is what you really need, as BASS_ChannelGetData calls are not affected by the BASS_Init sample rate. Perhaps you want to create additional "chan" with different sample rates?

whitevv

thank you, I really may use different chan.

whitevv

Hello Ian@un4seen,
I make application with using 2 BASS_RecordStart.
In Microsoft Device Emulator V3  - working is  good.
But on hardware device, work only one BASS_RecordStart.
Second return BASS_ErrorGetCode=BASS_ERROR_DRIVER;

Procedure log(S:String);
Begin
 Form1.Memo1.Lines.Add(S);
end;   

procedure TForm1.FormCreate(Sender: TObject);

begin

 BASS_Init(-1, 44100, 0, handle, nil)
 if not r_init := BASS_RecordInit(0) then log('Can''t initialize device');

 chan := BASS_RecordStart(11025, 1, 0, @RecordingCallback, nil); // line 1
 Log('1BASS_ErrorGetCode='+IntToStr(BASS_ErrorGetCode()));                                       

 chan2 := BASS_RecordStart(44100, 1, 0, @RecordingCallback2, nil);  // line2
 Log('2BASS_ErrorGetCode='+IntToStr(BASS_ErrorGetCode()));

end;

i have error to chan2, if i replace line1 and line2, to I have error to chan


Ian @ un4seen

That looks like the device doesn't support multiple simultaneous recordings. I'll send you a debug version to confirm things.

whitevv

#234
I see registry on my hardware device, it use K3_ASP_WAVEDEV2.dll driver.
In emulator using s3c2410x_wavedev.dll driver.
If on hardware i run 2 simultaneously application my and sectrum, they worked good.

Maybe you may give application for testing two stream simultaneously.

hiddenman37

Hi;

I'm using visual studio 2008 and windows mobile emulator 6 and using VB. Same codes is working. It works but this code is not working. I'm getting "Notsupportedexception" error message for BASS_POS_BYTES.

But this code is working in vista or xp (x86 mode). How to fix it.

Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Integer) As Integer
Declare Function BASS_GetVolume Lib "bass.dll" () As Double
Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long
Declare Function BASS_ChannelBytes2Seconds Lib "bass.dll" (ByVal handle As Integer, ByVal pos As Long) As Double
Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long


Dim SongTime As Long               
SongTime = BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES))

radio42

Are you using the Bass.Net_compact version with it?
Or have you declared your own functions?

hiddenman37

Yes.

Imports System.IO
Imports Un4seen.Bass
Imports Un4seen.Bass.Misc
Imports Un4seen.Bass.AddOn.Wma
Imports Un4seen.Bass.AddOn.Tags
Imports Un4seen.Bass.AddOn.Enc



Module BassMod

    Structure BASS_DX8_REVERB           ' DSFXWavesReverb
        Dim fInGain As Single           ' [-96.0,0.0]            default: 0.0 dB
        Dim fReverbMix As Single        ' [-96.0,0.0]            default: 0.0 db
        Dim fReverbTime As Single       ' [0.001,3000.0]         default: 1000.0 ms
        Dim fHighFreqRTRatio As Single  ' [0.001,0.999]          default: 0.001
    End Structure

    Structure BASS_DX8_FLANGER ' DSFXFlanger
        Dim fWetDryMix As Single
        Dim fDepth As Single
        Dim fFeedback As Single
        Dim fFrequency As Single
        Dim lWaveform As Integer ' 0=triangle, 1=sine
        Dim fDelay As Single
        Dim lPhase As Integer ' BASS_FX_PHASE_xxx
    End Structure

    Structure BASS_DX8_ECHO ' DSFXEcho
        Dim fWetDryMix As Single
        Dim fFeedback As Single
        Dim fLeftDelay As Single
        Dim fRightDelay As Single
        Dim lPanDelay As Integer
    End Structure

    Structure BASS_DX8_PARAMEQ
        Dim fCenter As Single
        Dim fBandwidth As Single
        Dim fGain As Single
    End Structure



    'Sound
    Public FLeftPos As Integer
    Public AMaster As Single
    Public StreamPos As Double
    Public StreamLength As Double
    Public StreamInfo As BASS_CHANNELINFO

    Public IniECHO As Integer
    Public IniECHO_OnOff As Boolean = False
    Public IniFLANGER As Integer
    Public IniFLANGER_OnOff As Boolean = False
    Public IniREVERB As Integer
    Public IniREVERB_OnOff As Boolean = False
    Public IniEQ1 As Integer = 0
    Public IniEQ2 As Integer = 0
    Public IniEQ3 As Integer = 0
    Public IniEQ4 As Integer = 0
    Public IniEQ5 As Integer = 0
    Public IniEQ6 As Integer = 0
    Public IniEQ7 As Integer = 0
    Public IniEQ8 As Integer = 0
    Public IniEQ9 As Integer = 0
    Public IniEQ10 As Integer = 0

    Public xEQU As BASS_DX8_PARAMEQ
    Public xECHO As BASS_DX8_ECHO
    Public xFLANGER As BASS_DX8_FLANGER
    Public xREVERB As BASS_DX8_REVERB

    Public FX(13) As Int32


    Public flags As Integer


    '************************
    '* Initialization flags *
    '************************
    Public Const BASS_DEVICE_8BITS As Short = 1 'use 8 bit resolution, else 16 bit
    Public Const BASS_DEVICE_MONO As Short = 2 'use mono, else stereo
    Public Const BASS_DEVICE_3D As Short = 4 'enable 3D functionality
    ' If the BASS_DEVICE_3D flag is not specified when initilizing BASS,
    ' then the 3D flags (BASS_SAMPLE_3D and BASS_MUSIC_3D) are ignored when
    ' loading/creating a sample/stream/music.
    Public Const BASS_DEVICE_LATENCY As Short = 256 'calculate device latency (BASS_INFO struct)
    Public Const BASS_DEVICE_SPEAKERS As Short = 2048 'force enabling of speaker assignment


    Public Function MakeLong(ByRef LoWord As Integer, ByRef HiWord As Integer) As Integer
        'Replacement for the c++ Function MAKELONG
        MakeLong = (LoWord And &HFFFF) Or (HiWord * &H10000)
    End Function

    Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Integer) As Integer
    Declare Function BASS_GetVolume Lib "bass.dll" () As Double
    Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long
    Declare Function BASS_ChannelBytes2Seconds Lib "bass.dll" (ByVal handle As Integer, ByVal pos As Long) As Double
    'Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long

    Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Int64

    'Declare Function BASS_Init Lib "bass.dll" (ByVal device As Integer, ByVal freq As UInteger, ByVal flags As UInteger, ByVal win As IntPtr, ByVal clsid As UInteger) As Boolean
    'Declare Function BASS_Free Lib "bass.dll" () As Boolean
    'Declare Function BASS_ChannelStop Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As IntPtr, ByVal mode As Integer) As Integer
    'Declare Function BASS_StreamFree Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As IntPtr, ByVal mode As Integer) As Integer
    'Declare Function BASS_ChannelPlay Lib "bass.dll" (ByVal handle As IntPtr, ByVal restart As Boolean) As Boolean
    'Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Single) As Boolean
    'Declare Function BASS_StreamCreateFile Lib "bass.dll" Alias "BASS_StreamCreateFile" (ByVal mem As Boolean, ByVal file As String, ByVal offset As UInteger, ByVal offsethigh As UInteger, ByVal length As UInteger, ByVal lengthhigh As UInteger, ByVal flags As UInteger) As IntPtr
    'Declare Function BASS_SampleLoad Lib "bass.dll" Alias "BASS_SampleLoad" (ByVal mem As Boolean, ByVal file As String, ByVal offset As UInteger, ByVal offsethigh As UInteger, ByVal length As UInteger, ByVal max As UInteger, ByVal flags As UInteger) As IntPtr
    'Declare Function BASS_SampleFree Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_SampleGetChannel Lib "bass.dll" (ByVal handle As IntPtr, ByVal onlynew As Boolean) As IntPtr
    'Declare Function BASS_SampleStop Lib "bass.dll" (ByVal handle As IntPtr) As Boolean


End Module


And

STREAM = Bass.BASS_StreamCreateFile(TRACKDIR & TRACKNAME, 0, 0, BASSFlag.BASS_STREAM_AUTOFREE)

Dim SongTime As Long               
           SongTime = BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES))

radio42

?Yes what? The above question was an OR question!
From your code it looks like you are mixing things, i.e. using Bass.Net_compact but also declare your own imports?!

hiddenman37

#239
Yes. I'm using the Bass.Net_compact version ( Bass24.Net_compact.zip )
No. I haven't declared my own functions.

For example:
Bass.BASS_Init(1, FREQUENCY, flags, Me.Handle, Nothing)
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_BUFFER, 1000)
Bass.BASS_ChannelSetAttribute(BASSConfig.BASS_CONFIG_NET_AGENT,BASSAttribute.BASS_ATTRIB_PAN, BALANCE)
Bass.BASS_SetVolume(MASTER_VOLUME / 100)

Thanks for reply...

I am using the program at both the operating system. The problem therefore occurs. a bad solution. but the problem is solved.

If OsControl = False Then
SongTime = BASS_ChannelBytes2Seconds(STREAM, BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES)) ' for x86. own declarated function
Else
SongTime = Bass.BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES)) 'for mobile. bass net function
End If