20 Apr '14 - 05:08 *
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] 2 3 ... 16
  Reply  |  Print  
Author Topic: BASS for Linux  (Read 133488 times)
Ian @ un4seen
Administrator
Posts: 16318


« on: 26 Jun '08 - 16:18 »
Reply with quoteQuote

Linux (x86 and x64) versions of BASS and the BASSCD/FLAC/MIDI/WV/enc/mix add-ons are available here:

Now available on the BASS page.


ALSA is used for output, but the "no sound" device can still be used without it.

BASS will attempt to set the output threads to real-time priority, but Linux appears not to permit normal users to have control over the priority of their threads. So unless you're running as "root" (or you have "rtprio" enabled in limits.conf), it is possible for the BASS output threads to be starved of CPU, resulting in output underruns, ie. breaks in the sound. To get around that, there is a BASS_SetConfig option (BASS_CONFIG_DEV_BUFFER) to set the device buffer size. It defaults to 40ms, but the actual value used may be different if the device/driver requires it; BASS_GetInfo can be used to check the average latency. Note that the device buffer size affects the latency of things like playback starting and attribute changes, so you will probably want to avoid setting it unnecessarily high.

By default, BASS_Init will initialize a device in exclusive mode, but a shared mode is also available via the BASS_DEVICE_DMIX flag. If the device is busy, then BASS_Init will automatically try the shared mode. I say "exclusive mode", but it isn't necessarily exclusive if the device/driver supports hardware mixing, ie. each hardware mixing channel can be used in exclusive mode. When in exclusive mode, the "freq" parameter will determine the output rate (if possible) and all of the device's speakers will be available. When in shared mode, the ALSA config will determine the output rate and number of speakers (the default appears to be 48000hz stereo). Exclusive mode will also allow the use of smaller output buffers (BASS_CONFIG_DEV_BUFFER) and so lower latency; the minimum buffer size is again determined by the ALSA config in shared mode.

BASS also provides a "Default" device, which uses whatever output is set as the default in the ALSA config. That could map directly to one of the hardware devices, or it could use plugins. Note the latter could add latency, and it may be necessary to increase the device buffer size (BASS_CONFIG_DEV_BUFFER) to avoid breaks in the sound.

An "mp3-free" version is included, which makes use of the libmpg123 library for MP3 decoding. The libmpg123 library comes with mpg123 (a command-line player), but can also be installed separately (although that seems to be less common). Without it, the "mp3-free" BASS will still function, but MP3 stream creation will fail with a BASS_ERROR_CODEC error.
« Last Edit: 23 May '11 - 17:41 by Ian @ un4seen » Logged
ken
Posts: 659


« Reply #1 on: 26 Jun '08 - 16:23 »
Reply with quoteQuote

Sweet, hopfully I can use it with Mono framework, so I can still develop in C#. Then I give it a try.

Bernd, does BASS.NET work with Mono on Linux (and maby on Mac) ?

http://www.mono-project.com/
Logged
Chris
Posts: 1659


« Reply #2 on: 26 Jun '08 - 16:46 »
Reply with quoteQuote

Hi Ian and I can translate the Delphi Demos to  Lazarus (Freepascal) (and can test them under Suse 10,1 / 11.0
Cheers Chris
« Last Edit: 26 Jun '08 - 20:03 by Chris » Logged
radio42
Posts: 4162


« Reply #3 on: 26 Jun '08 - 19:22 »
Reply with quoteQuote

If Mono is fully .Net compatible I don't see any reason why it shouldn't work...but I haven't tried that, since I have no Linux PC and no Mono installed...and guess I will not buy one just to try it ;-)
Logged
ken
Posts: 659


« Reply #4 on: 27 Jun '08 - 09:16 »
Reply with quoteQuote

ok, nice. I know that specific windows functions like "DllImport" don't work in Mono.

I will get it a try when Ian post the linux version of Bass. 
Logged
radio42
Posts: 4162


« Reply #5 on: 27 Jun '08 - 09:51 »
Reply with quoteQuote

If "DllImport" isn't automatically converted/supported under Mono - then BASS.NET will definitly NOT work!
Since "DllImport" is used almost everywhere to import the native BASS functions :-)
Logged
ken
Posts: 659


« Reply #6 on: 27 Jun '08 - 13:43 »
Reply with quoteQuote

Bad by me, I belive I mention specific Win32 calls.

looks like "DllImport" works in mono: http://www.mono-project.com/Interop_with_Native_Libraries
 
Logged
rogier21
Posts: 33


« Reply #7 on: 30 Jun '08 - 13:55 »
Reply with quoteQuote

In Delphi Codegear you can easily make linux apps, I have a VM here and Delphi, so I can test if you want.
Logged
franck
Guest
« Reply #8 on: 23 Jul '08 - 14:39 »
Reply with quoteQuote

I really look for a linux version while all my application runs under mono expect bass features...


According monon documentation, it's possible to link to linux library files by adding information in the mono parameter file, like this:

 <configuration>
    <dllmap dll="bass.dll" target="bass.so" />
 </configuration>

and then no change has to be made in the .NET wrapper [ImportDll("bass.dll")].




I actually just need to generate a waveform (no playback, no recording...), is there already an early first alpha version of bass under linux which can do that?
Logged
Ian @ un4seen
Administrator
Posts: 16318


« Reply #9 on: 23 Jul '08 - 16:02 »
Reply with quoteQuote

There is actually a fully functional beta version available Smiley

I'm afraid I can't assist with "mono", but if you would like to try to get BASS working with it, please confirm your email address and I'll send the beta.
Logged
fcasado
Posts: 8


« Reply #10 on: 23 Jul '08 - 17:41 »
Reply with quoteQuote

ok, I sent you an email directly, but I've registered a new time to answer here...
So, can you send me this linux version?
I'll send you my feedback if that can help.
Logged
fcasado
Posts: 8


« Reply #11 on: 24 Jul '08 - 09:01 »
Reply with quoteQuote

Hi,
Thank you for your mail.
I've simply run my application under mono using the linux version of mono.
The configuration of mono is quite simple using dllmap mecanism.

The library is found by the API, the first call are OK (initialization etc...), audio device are correctly found (alsa) and initialized

but everything is not working probably (stream creation) because I use an obsolete version of the .NET API (2.3.1.Cool.
I'll try to update to last release of .NET API and will test this again.

Logged
fcasado
Posts: 8


« Reply #12 on: 24 Jul '08 - 10:17 »
Reply with quoteQuote

Ok, after updating to 2.4.1 .NET API, things sounds better.
Except that I cannot open my OGG file?
BASS_ERROR_FILEOPEN error while creating a file stream on an OGG vorbis file while it can be opened under windows.
Logged
radio42
Posts: 4162


« Reply #13 on: 24 Jul '08 - 10:57 »
Reply with quoteQuote

If you can open 'other' files (e.g. wav or mp3) I guess this is something special inside BASS - as the interface for BASS.NET is the same.
Logged
fcasado
Posts: 8


« Reply #14 on: 24 Jul '08 - 11:06 »
Reply with quoteQuote

I've already get this same error (opening file) when there was version mismatch between .NET API lib and native lib.

Here I use the 2.4.1.2 .NET API lib, maybe it should be a previous one?
Logged
fcasado
Posts: 8


« Reply #15 on: 24 Jul '08 - 12:55 »
Reply with quoteQuote

ok, same issue with mp3 and wav

The BASS_GetVersion returns 2.4.1.5 while the .NET API version is 2.4.1.2 supports only BASS v2.4.1.1.
Probably the issue come from this mismatch.


Logged
fcasado
Posts: 8


« Reply #16 on: 24 Jul '08 - 13:00 »
Reply with quoteQuote

Sorry for the multiple post, but I've tried the given binaries to test the .so file.

the writewav works well with the same OGG file.
the content can't initialize device (alsa 1.0.15) but it's not my target for this app.

so definilty, I think that the issue come from the .NET API...
Logged
radio42
Posts: 4162


« Reply #17 on: 24 Jul '08 - 13:38 »
Reply with quoteQuote

I guess I might not really help - as I don't have any linux PC - nor mono available.

Regarding the versions - I don't think that this is an issue.

So basically what you can try is to write your own little mono .Net wrapper and see if that really works out.
Logged
Ian @ un4seen
Administrator
Posts: 16318


« Reply #18 on: 24 Jul '08 - 13:40 »
Reply with quoteQuote

I think BASS.Net uses Unicode (UTF-16) strings whenever possible? If so, that's probably the problem as the Linux BASS version does not currently support the BASS_UNICODE flag. Does Mono use Unicode strings?
Logged
fcasado
Posts: 8


« Reply #19 on: 24 Jul '08 - 14:19 »
Reply with quoteQuote

OK, investigating more...
it works opening the file using a buffer and creating the stream from memory.

I see the next bug in the WaveForm generation. So I also change this, by creating a waveform from a stream instead of a file (which bugged with the previous bug)
...
but here that freezes wher I start the rendering


Logged
Pages: [1] 2 3 ... 16
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines