Show Posts
|
|
Pages: [1]
|
|
1
|
Developments / BASS / Re: BASS for ARM Linux
|
on: 4 Jan '13 - 17:52
|
if(BASS_ChannelPlay(TRUE, stream)) { geterror("Play"); }
Those BASS_ChannelPlay parameters should be the other way round, ie. the stream handle should be the 1st parameter. Also, a "TRUE" return value would indicate success rather than failure, so that needs to be changed too, ie. add a "!" in there. Let me know if it's still not working after doing that. oops.. so stupid mistake  if(!BASS_ChannelPlay(stream, TRUE)) { geterror("Play"); }
It's working , thanks 
|
Reply
Quote
|
|
|
2
|
Developments / BASS / Re: BASS for ARM Linux
|
on: 4 Jan '13 - 13:58
|
Hi, I'm using Raspberry Pi and ArchlinuxARM(3.6.11-2-ARCH+). I'm trying to build simple examp of libbass but i'm unable to get it playing. Here is my code: #include <stdio.h> #include <stdlib.h> #include <bass.h> #include <unistd.h>
void geterror(char *msg) { printf("%s:%d\n", msg, BASS_ErrorGetCode()); }
int main(int argc, char *argv[]) { int pos = 0; int len = 0; HSTREAM stream; char *filepath = argv[1];
printf("\n-----------------------------------------------------------\n");
DWORD ver = BASS_GetVersion(); printf ("\nBASS Version: %d.%d.%d.%d\n\n",(ver>>24)&0xff, (ver>>16)&0xff, (ver>>8) & 0xff, (ver & 0xff));
if(!BASS_Init(-1, 44100, BASS_DEVICE_DMIX, 0, NULL)) { geterror("Init Error"); }
// ------------------ Get Devices -------------------- int a; BASS_DEVICEINFO info; printf("*****Devices Info:*****\n"); for(a=0; BASS_GetDeviceInfo(a, &info);a++) { printf("Device %d:%s - %s - %d\n", a, info.name, info.driver, info.flags); } printf("\n"); // ---------------------------------------------------
// ----------------- Current Device ------------------ if(BASS_GetDevice() == -1) geterror("Device Error"); else printf("Selected Device:%d\n", BASS_GetDevice()); // ---------------------------------------------------
// ---------------- Get Global Volume ---------------- if(BASS_GetVolume() == -1.0) geterror("Cann't Get Volume Error"); else printf("%f\n", BASS_GetVolume()); // ---------------------------------------------------
// ---------------- Create Stream -------------------- stream = BASS_StreamCreateFile(FALSE, filepath, 0, 0, 0); if(stream == 0) geterror("StreamCreate Error"); else printf("StreamHandle:%d\n",stream); // --------------------------------------------------- len = BASS_ChannelBytes2Seconds(stream,BASS_ChannelGetLength(stream, BASS_POS_BYTE)); pos = 0;
// ---------------- Get Channel Info ------------------- BASS_CHANNELINFO chan_info; BASS_ChannelGetInfo(stream, &chan_info); printf("\n*****Channel Info:*****\n"); printf("Freq:%d\n",chan_info.freq); printf("Channels:%d\n",chan_info.chans); printf("Bps%d\n",chan_info.origres); printf("Filename:%s\n\n",chan_info.filename); printf("\n"); // ----------------------------------------------------- if(BASS_ChannelPlay(TRUE, stream)) { geterror("Play"); } while(1) { if(BASS_ChannelIsActive(stream) != 0) { pos = BASS_ChannelBytes2Seconds(stream, BASS_ChannelGetPosition(stream, BASS_POS_BYTE));
if(len == pos) break;
printf("%02d:%02d - %02d:%02d\n",(int)(len/60), (int)(len%60), (int)(pos/60), (int)(pos%60)); } usleep(100000); } BASS_ChannelStop(stream); BASS_StreamFree(stream);
BASS_Free();
return 0; }
Output of this code: -----------------------------------------------------------
BASS Version: 2.4.9.3
*****Devices Info:***** Device 0:No sound - (null) - 1 Device 1:Default - default - 7 Device 2:bcm2835 ALSA: bcm2835 ALSA - hw:0,0 - 1
Selected Device:1 Cann't Get Volume Error:37 StreamHandle:-1342177279
*****Channel Info:***** Freq:44100 Channels:2 Bps0 Filename:./Red Hot Chillipeper - Snow.mp3
GetVolume() return -1.0 with ErrorCode 37 (37 = BASS_ERROR_NOTAVAIL There is no volume control when using the "no sound" device.) but I'm using device 1.  as well no sound, and stream doesn't playing. Am I missing something ? Thank you. Stas.
|
Reply
Quote
|
|
|
3
|
Developments / BASS / Re: BASS for Android
|
on: 8 Jun '12 - 19:08
|
To play with the NETRADIO example, you can use the "New > Android Project > Create project from existing source" option to create a project for it in Eclipse. Also import the root SRC folder (containing the BASS class) via the "Build Path > Link Source" option and copy the root LIBS folder (containing the BASS library) into the NETRADIO example's folder.
After adding your BASS_CONFIG_NET_AGENT setting to the NETRADIO example, I was able to play your URL with it. If it still isn't working there, are other URLs working, eg. the example presets? If none are working, do you know if the other software that you tried is connecting via a proxy? If it is, you can try telling the NETRADIO example to use that too (in the box at the bottom of the display).
You are magician  . Yesterday I tried excatly same thing on Linux.. it gived me again and again same error(Eclipse Error) . Now I tried on Windows , everything works , my URL , and all the rest presets. Thanks for repeating the explanation , this time it works. I will try to figure out why my code didn't worked. Thank you again Ian.
|
Reply
Quote
|
|
|
4
|
Developments / BASS / Re: BASS for Android
|
on: 8 Jun '12 - 16:47
|
BASS_ERROR_FILEOPEN indicates that BASS_StreamCreateURL was unable to open the URL, eg. it couldn't connect to the server or the file doesn't exist on the server. Please try to play the same URL with the NETRADIO example (add your BASS_CONFIG_NET_AGENT setting if required), and check if it displays a "HTTP" status code. Also check whether the example presets are working. If no URLs are working, are you able to play them with any other software on the same device?
Yes , Ian , the URL is alive , and working with other applications on Android ,as well on PC. About Netradio examp . I'm just started with Android/Java/Eclipse , I didn't figure out how to open it in Eclipse  , so I just started a new Android project (the libs and BASS.java are in correct place . BASS.BASS_GetVersion() working and BASS.BASS_Init(...) as well). Does BASS.BASS_StreamCreateURL accept URL in UTF-8 encodings ? , or it has to be converted to ISO-8859-1 ? Or to make whole project in ISO-8859-1.. Thank you. Stas.
|
Reply
Quote
|
|
|
5
|
Developments / BASS / Re: BASS for Android
|
on: 8 Jun '12 - 13:10
|
Hi. I'm trying to write simple HelloWorld with Bass on Android (playing internet radio) but I always receiving 0 from BASS_StreamCreateURL , and Error code 2 (ERROR_FILEOPEN) ,is there some trick ? static final String url = "http://webcast.emg.fm:55655/europaplus128.mp3"; ... BASS.BASS_Init(-1, 44100, 0); BASS.BASS_SetConfigPtr(BASS.BASS_CONFIG_NET_AGENT, "Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19"); //needed for this specific stream
chan = BASS.BASS_StreamCreateURL(url, 0, BASS.BASS_STREAM_BLOCK|BASS.BASS_STREAM_AUTOFREE, null, null); ... BASS.BASS_ChannelPlay(chan, false);
same code in C/Linux working fine. Thanks. Stas. Android 2.3.3 debuging on phone.
|
Reply
Quote
|
|
|
6
|
Developments / BASS / Re: BASS for Linux
|
on: 12 Mar '11 - 02:39
|
Hi. I have a problem with BassMix on linux . I'm trying to upmix from stereo to 5.1 with BASS_Mixer_ChannelSetMatrix(...); but it always says Error 5 (BASS_ERROR_HANDLE - The channel is not plugged into a mixer.) ... BASS_Init(-1, 44100, BASS_DEVICE_DMIX, 0, NULL); ... source_chan = BASS_StreamCreateFile (FALSE, filepath, 0, 0, BASS_STREAM_DECODE); ... mixer_chan = BASS_Mixer_StreamCreate (44100, 6, 0); // ... BASS_Mixer_StreamAddChannel(mixer_chan, source_chan , BASS_MIXER_MATRIX | BASS_STREAM_AUTOFREE); ... BASS_Mixer_ChannelSetMatrix (mixer_chan, matrix); -> Error 5 BASS_Mixer_ChannelSetMatrix (source_chan, matrix); -> Error 37 (Example from speakers/speakers.c example of bassmix24) ...
mixer_chan is working, playing. but matrix mixing isn't working . Did I missed something ? Please point me. Thank you.
|
Reply
Quote
|
|
|
7
|
Developments / BASS / Re: BASS for Linux
|
on: 14 Sep '10 - 22:37
|
Hi, Looks like I posted this in the wrong topic before. I am currently using the PyBass library available at: http://pypi.python.org/pypi/pybass/0.5. It has worked fantastic on Windows, and I'm in love with the BASS library. However, I can't seem to get it working in Ubuntu 10.04. I get the following error: ALSA lib pcm_dmix.c:1010:(snd_pcm_dmix_open) unable to open slave
I am not sure what the problem is, but I was wondering if there was a solution. Thank you so much for any replies in advance. Hi. PulseAudio cause this error , you should call BASS_Init with device=1
|
Reply
Quote
|
|
|
8
|
Developments / BASS / Re: BASS for Linux
|
on: 8 Sep '10 - 02:57
|
I have problem with PulseAudio + Bass (I believe so) , cause running app through pulse loading CPU to 100%.
What does BASS_GetCPU say? Also, if you look at the individual process CPU usage, is it your process that is taking the CPU, or is it the pulseaudio server, or even something else? I may have to send you a debug version to get some info on what's happening. I have rechecked this problem , it's occurs only when Pulse already have playing stream , Bass cann't join(?) it , and Bass playing stream jumping to second output device getting around Pulse , cause Pulse doesn't detect it in 'Applications'. I will try to check this in Ubuntu , mb it's my Pulse configuration is buggy . Debug version will help too. Thx, Stas.
|
Reply
Quote
|
|
|
9
|
Developments / BASS / Re: BASS for Linux
|
on: 22 Aug '10 - 01:03
|
Hi everybody. I have problem with PulseAudio + Bass (I believe so) , cause running app through pulse loading CPU to 100%. ... BASS_Init (1, 48000, 0, NULL, NULL); ... Same code ALSA+Bass running perfect. ... BASS_Init (-1, 48000, BASS_DEVICE_DMIX, NULL, NULL); ... Can someone pointing me where to look or how to resolve this issue , if possible. Thanx. PulseAudio - 0.9.21 Alsa - 1.0.23 Bass - latest , from first page. Archlinux
|
Reply
Quote
|
|
|