Author Topic: BASS for WinCE  (Read 237891 times)

alter

  • Posts: 10
Re: BASS for WinCE
« Reply #200 on: 27 Apr '10 - 15:46 »
I've got one problem with it. I am using FPC 2.4 if that matters.

I have Bass_StreamCreateURL declared as:
function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; stdcall; external bassdll;

When I use:

tmpChannel := BASS_StreamCreateURL(Pchar(URL2), 0, OpenFlag, nil, nil);

tmpChannel is always 0 and error code is BASS_ERROR_ILLPARAM(20). OpenFlag is 0. I've tried a few combinations also with pwidechar or/and BASS_UNICODE but still no success.

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #201 on: 28 Apr '10 - 18:09 »
BASS_ERROR_ILLPARAM indicates that the URL ("URL2") is malformed. If it's not a Unicode issue (it happens with and without the BASS_UNICODE flag), check that the URL includes a protocol, eg. "http://" or "ftp://".

Anglachel

  • Posts: 1
Re: BASS for WinCE
« Reply #202 on: 29 Apr '10 - 22:20 »



Can anyone please give me a program for generating 3D positional Audio in BASS.NET? I need to implement that on Win CE platform...
Thanks alot!

thyphuong

  • Posts: 2
Re: BASS for WinCE
« Reply #203 on: 12 May '10 - 05:43 »
I'm working on a windows mobile 6.0 Pro and facing a problem with "Can't PInvoke bass.dll". So I follow that solution

Quote
It is pretty much like regular development.
You don't reference the bass.dll in your project, you just need to make sure, that the bass.dll exists in your executable directory on the mobile device.
When using an emulator (and not a real device), you might need to copy the bass.dll to your emulator's folder manually, e.g. using the "Windows Mobile Device Center" application.

Then I copy bass.dll into the same folder of base.net.compact but not working. Still the same exception. Something I'm wrong?  :(

Update: I updated the newest version of bass.dll and now exception has gone but there's other issue that my stream always get value 0.
Quote
               stream = Bass.BASS_StreamCreateURL(strUrl, 0, 0, null, IntPtr.Zero);
                Bass.BASS_ChannelPlay(stream, false);

Update2: I found the solution here
Quote
OKi, I just had a chat with Ian. The UNICODE flag isn't included in the official version yet.
So here is a new version of BASS.NET, in which I don't use the UNICODE flag anymore.
Please (re)download and try again:
www.un4seen.com/filez/4/Bass24.Net_pre.zip

But it seems not to be used for windows mobile 6.0. Is there any update for bass.dll for compact framework that fixed the problem of StreamCreateUrl return 0
« Last Edit: 12 May '10 - 08:39 by thyphuong »

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #204 on: 12 May '10 - 16:29 »
To determine whether it is a general BASS issue or .Net-specific, please try to reproduce the problem with the pre-compiled NETRADIO.EXE example. If the presets work in that but your URL doesn't, please also provide the troublesome URL to have a look at.

thyphuong

  • Posts: 2
Re: BASS for WinCE
« Reply #205 on: 13 May '10 - 03:13 »
Thanks Ian, my bad. my ISP blocked all mp3 files without telling me. the bass.dll and bass_compact.dll work amazing.

alter

  • Posts: 10
Re: BASS for WinCE
« Reply #206 on: 26 May '10 - 00:08 »
BASS_ERROR_ILLPARAM indicates that the URL ("URL2") is malformed. If it's not a Unicode issue (it happens with and without the BASS_UNICODE flag), check that the URL includes a protocol, eg. "http://" or "ftp://".
Thx, I've checked my code yet another time and I found that I've overlooked one line and parameter was indeed messed up but now it's working well.
I have tried both BASS itself and .Net bindings. And now I have a question is there any preview of WMA or/and AAC plugins?

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #207 on: 26 May '10 - 16:50 »
No, I'm afraid there aren't currently BASSWMA and BASS_AAC versions available for WinCE. In the case of BASSWMA, the required system libraries/APIs aren't available, and in the case of BASS_AAC, it would need to be modified to use fixed-point math due to the lack of an FPU. There is a DirectShow WMA codec available and a BASSDS add-on to make use of that, but the codec is not included in Windows Mobile. If you are using a WinCE platform that does include the codec (WMADMOD.DLL), I can send you the BASSDS add-on to try.

mabo42

  • Posts: 4
Problems with position related functions
« Reply #208 on: 19 Jun '10 - 12:14 »
Hello Ian,

I've been testing the bass.dll for WinCE since a couple of days. I am using both a LG750GM (WinMo 6.5) and the Visual Studio Emulator (Window Mobile 6.5 Professional WQVGA Emulator). Most is running fine so far, but there are problems with all position/length related functions

BASS_ChannelGetLength
BASS_ChannelGetPosition
BASS_ChannelSetPosition
BASS_ChannelBytes2Seconds
BASS_ChannelSeconds2Bytes

These are all throwing a NotSupportedException, both on the device and on the emulator. The bass.dll is of version 2.4.5.18 (created on March, 3rd, 2010 March, 31, 2010). Isn't that not the current version? Are the problems already reported by others?
Any help or hints would be very appreciated.
« Last Edit: 19 Jun '10 - 12:17 by mabo42 »

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #209 on: 21 Jun '10 - 18:02 »
Please confirm how you are using BASS on WinCE. It sounds like you may be using .Net? If so, are you using the "compact" BASS.Net version posted in this thread (see 1st post), or are you rolling your own?

mabo42

  • Posts: 4
Re: BASS for WinCE
« Reply #210 on: 21 Jun '10 - 20:38 »
Yes you are right, ist .NET / C#. Simple code with a handful P/Invokes:

Code: [Select]
public partial class Form1 : Form
{
  private int stream = 0;

  public Form1()
  {
    InitializeComponent();
    BASS_Init(-1, 44100, 0, IntPtr.Zero, IntPtr.Zero);    // works fine
  }

  private void btnClose_Click(object sender, EventArgs e)
  {
    BASS_Free();   // works fine
    Close();
  }

  private void btnPlay_Click(object sender, EventArgs e)
  {
    stream = BASS_StreamCreateFile(0, @"\Storage Card\test.mp3", 0, 0, BASS_DEFAULT | BASS_UNICODE); // works fine
    //long byteLen = BASS_ChannelGetLength(stream, BASS_POS_BYTES);  // this line throws NotSupportedException
    BASS_ChannelPlay(stream, 1);                                     // works fine
  }

  private const int BASS_DEFAULT = 0;
  private const int BASS_UNICODE = -2147483648;
  private const int BASS_POS_BYTES = 0;

  [DllImport("bass", CharSet = CharSet.Auto)]
  private static extern int BASS_Init(int device, int freq, int flags, IntPtr hwnd, IntPtr clsid);

  [DllImport("bass", CharSet = CharSet.Auto)]
  private static extern int BASS_Free();

  [DllImport("bass", CharSet = CharSet.Auto)]
  private static extern int BASS_StreamCreateFile(int memory, string file, long offset, long length, int flags);

  [DllImport("bass", CharSet = CharSet.Auto)]
  private static extern long BASS_ChannelGetLength(int handle, int mode);

  [DllImport("bass", CharSet = CharSet.Auto)]
  private static extern int BASS_ChannelPlay(int handle, int restart);
}

Is there any wrong with the P/Invoke signatures? Or could it be, there is a problem with Windows Mobile 6.5?

radio42

  • Posts: 4576
Re: BASS for WinCE
« Reply #211 on: 21 Jun '10 - 22:22 »
Yes, there are a couple of issues  - not really with your signature - but more with marshaling limitations of the .Net compact framework.
These things have been worked out in the Bass.Net_compact version - so you might simply try the Bass.Net_compact version instead of your own...

mabo42

  • Posts: 4
Re: BASS for WinCE
« Reply #212 on: 22 Jun '10 - 08:47 »
Hello radio42,

thanks for your advice. I can get hand on my dev env this evening, I will try then and inform you.
But marshaling problems with a method "long method(int, int)", that I would have thought as a last.

Thanks again
Matthias

radio42

  • Posts: 4576
Re: BASS for WinCE
« Reply #213 on: 22 Jun '10 - 09:11 »
Yes, the .Net compact framework (beside other limits) doesn't support unmanaged function calls which return a 'long' or 'float' value.

mabo42

  • Posts: 4
Re: BASS for WinCE
« Reply #214 on: 22 Jun '10 - 16:29 »
Hi radio42,

I followed your advice and have used the Bass.Net_compact version. Everything now works as described :)
You've convinced me to go with your wrapper and not to p/invoke my own. It's more than a wrapper,
actually it's a Managed-Bass-on-WinCE-survival-kit ...

Thanks for your efforts and the great lib.

Greetings
Matthias

whitevv

  • Guest
Re: BASS for WinCE
« Reply #215 on: 20 Jul '10 - 10:32 »
Hello
I'm try recording from mic, but nothing not working on WinCE, but working on the WinXP:'(
Why Driver name is null?
Code:
procedure TForm1.Button2Click(Sender: TObject);
var
 R:Dword;
 info: BASS_DEVICEINFO;
 info1: BASS_INFO;
 info2: BASS_RECORDINFO;
begin
 r:= BASS_GetDevice();
 Log('BASS_GetDevice='+IntToStr(r));
 if not BASS_GetDeviceInfo(r,info)
    Then  Log('BASS_GetDeviceInfo='+IntToStr(r)+'-err')
    else
        Begin
          log('BASS_GetDeviceInfo');
          log('Driver='+info.driver);
          log('Name='+info.name);
          log('Flag='+IntToStr(info.flags));
        end;
 r:= BASS_ErrorGetCode();
 Log('BASS_ErrorGetCode='+IntToStr(r));

IF BASS_GetInfo(info1)
   Then Log('BASS_GetInfo=OK')
   else Log('BASS_GetInfo=Err');
Log('Flag='+IntToStr(info1.flags));
Log('hwsize='+IntToStr(info1.hwsize));
Log('hwfree='+IntToStr(info1.hwfree));
Log('freesam='+IntToStr(info1.freesam));
Log('free3d='+IntToStr(info1.free3d));
Log('minrate='+IntToStr(info1.minrate));
Log('maxrate='+IntToStr(info1.maxrate));
Log('minbuf='+IntToStr(info1.minbuf));
Log('dsver='+IntToStr(info1.dsver));
Log('latency='+IntToStr(info1.latency));
Log('initflags='+IntToStr(info1.initflags));
Log('speakers='+IntToStr(info1.speakers));
Log('freq='+IntToStr(info1.freq));

BASS_RecordGetInfo(info2);

Log('BASS_RecordGetInfo');
Log('Flag='+IntToStr(info2.flags));
Log('formats='+IntToStr(info2.formats));
Log('freq='+IntToStr(info2.freq));
Log('inputs='+IntToStr(info2.inputs));
Log('singlein='+BoolToStr(info2.singlein));
 end;                                 
Output:
BASS_GetDevice=1
BASS_GetDeviceInfo
Driver=
Name=A
Flag=7
BASS_ErrorGetCode=0
BASS_GetInfo=OK
Flag=0
hwsize=0
hwfree=0
freesam=0
free3d=0
minrate=0
maxrate=0
minbuf=66
dsver=0
latency=166
initflags=256
speakers=2
freq=44100
BASS_RecordGetInfo
Flag=0
formats=0
freq=0
inputs=1
singlein=-1



Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #216 on: 20 Jul '10 - 17:14 »
The BASS_DEVICEINFO "driver" value is always NULL in the WinCE version. Another thing is that the "name" string is Unicode in the WinCE version, so you would need to change the "PAnsiChar" to "PWideChar" there. Perhaps BASS.PAS could be modified like this...

Code: [Select]
  // Device info structure
  BASS_DEVICEINFO = record
{$ifdef wince}
    name: PWideChar;    // description
    driver: PWideChar;  // driver
{$else}
    name: PAnsiChar;    // description
    driver: PAnsiChar;  // driver
{$endif}
    flags: DWORD;
  end;

Regarding the recording problem... you appear to be using BASS_GetDeviceInfo above; should that be BASS_RecordGetDeviceInfo? To see if the problem may be something particular to your app, is the pre-compiled RECTEST.EXE example (in the WinCE package) working?

whitevv

  • Guest
Re: BASS for WinCE
« Reply #217 on: 20 Jul '10 - 18:56 »
Thank's for explanations.
I try modify bass.pas tomorrow. RECTEST.EXE - is working

Rawukal

  • Posts: 3
Re: BASS for WinCE
« Reply #218 on: 29 Jul '10 - 06:18 »
Hi,
I am developing on Win CE 6. I tested the webradio sample successfully.
After a view changes in the BSP of my Win CE the sample doesn't work anymore.
So is there a list which catalog items has to be checked, so that the BASS Lib is fully functional?

Kind Regards

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #219 on: 29 Jul '10 - 13:47 »
Is it only the internet streaming that isn't working, eg. you can still initialize BASS? If so, perhaps you are missing SYSGEN_WININET?

whitevv

  • Posts: 7
Re: BASS for WinCE
« Reply #220 on: 4 Oct '10 - 19:24 »
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

« Last Edit: 5 Oct '10 - 05:18 by whitevv »

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #221 on: 5 Oct '10 - 16:25 »
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

  • Posts: 7
Re: BASS for WinCE
« Reply #222 on: 5 Oct '10 - 19:23 »
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.
« Last Edit: 5 Oct '10 - 19:40 by whitevv »

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS for WinCE
« Reply #223 on: 6 Oct '10 - 15:20 »
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.

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

  • Posts: 7
Re: BASS for WinCE
« Reply #224 on: 6 Oct '10 - 20:06 »
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.