Author Topic: BASS for ARM Linux  (Read 142251 times)

SteveS

  • Guest
Re: BASS for ARM Linux
« Reply #75 on: 25 Apr '13 - 18:32 »
Good to hear that the update is working well for you. The _FILE_OFFSET_BITS=64 modification will indeed be in the next official release builds, which will hopefully be available quite soon (just want to get to the bottom of scrww's and trentg's issues first). In the meantime, you can continue to use the build above (it's a release build).

It's all good, apart from one thing. My app which uses BASS runs as a daemon process. If I start it from a shell prompt, it's fine, and detaches itself, and runs fine. If I start it from an rc script (in rc2.d, for example, it doesn't. Calls to BASS_GetDeviceInfo fail, which is a pain, as I am using that to determine the valid device number starting from 2. The error code I get is 23.
This doesn't happen from a shell. Any ideas as to why this would be? I assume that the relevant modules are loaded by the time my app runs, as I am able to use alsa command lines to set volume etc.

A puzzled SteveS

SteveS

  • Guest
Re: BASS for ARM Linux
« Reply #76 on: 26 Apr '13 - 09:43 »
Quote
It's all good, apart from one thing. My app which uses BASS runs as a daemon process. If I start it from a shell prompt, it's fine, and detaches itself, and runs fine. If I start it from an rc script (in rc2.d, for example, it doesn't. Calls to BASS_GetDeviceInfo fail, which is a pain, as I am using that to determine the valid device number starting from 2. The error code I get is 23.

I changed the /etc/asound.conf file by adding

pcm.!default {
  type hw
  card 0
}
ctl.!default
{
  type hw
  card 0
}

and restarting alsa. Now it works fine. I will need to go and find out more as to WHY this works, I got the information from a post on the RPi forum. It looks like without those, I can't enumerate my devices. I can't assume 2 will work (because it doesn't without those lines), as I also want the option to use a USB audio device. I may well have a play on a Linux i386 PC and see what the magic incantations are there...

SteveS

colin

  • Guest
Re: BASS for ARM Linux
« Reply #77 on: 30 Apr '13 - 00:22 »

Hello,
I have 5.1 card :
The card uSB udj6 is the default
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=UDJ6
    UDJ6, USB Audio
    Default Audio Device
front:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    Front speakers
surround40:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=UDJ6,DEV=0
    UDJ6, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: UDJ6 [UDJ6], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7

speaker-test -Dplug:surround51 -c6 -t wav
The speaker-test block. Why ?

After I test bass speakers assignment with Init function like this :

Code: [Select]
        // check the correct BASS was loaded
        if (HIWORD(BASS_GetVersion())!=BASSVERSION) {
                Error("An incorrect version of BASS was loaded");
                return 0;
        }
        // initialize default device
        if (!BASS_Init(-1,44100,BASS_DEVICE_SPEAKERS,NULL,NULL)) {
                Error("Can't initialize device");
                return 0;
        }
        std::cout<<"Device : "<<BASS_GetDevice()<<std::endl;

        //count device
        int a, count=0;
        BASS_DEVICEINFO info;
        for (a=0; BASS_GetDeviceInfo(a, &info); a++)
                if (info.flags&BASS_DEVICE_ENABLED) // device is enabled
                        count++; // count it
        std::cout<<"Device count : "<<count<<std::endl;

        // check how many speakers the device supports
        BASS_INFO i;
        BASS_GetInfo(&i);
        std::cout<<"Number of speakers : "<<i.speakers<<std::endl;

I tested BASS_DEVICE_DMIX (with alsa) and BASS_DEVICE_SPEAKERS
http://www.un4seen.com/doc/#bass/BASS_Init.html

I detected only 2 speakers and after it can't play wave because I have not detected enought speakers !

Where is the problem ?

Thanks a lot

colin

  • Guest
Re: BASS for ARM Linux
« Reply #78 on: 30 Apr '13 - 00:33 »
This is my etc/asound.conf :

pcm.card0 {
    type hw
    card 0
}
ctl.card0 {
    type hw
    card 0
}
pcm.!default {
    type plug
    slave.pcm "surround51"
    slave.channels 6
    route_policy duplicate
}

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #79 on: 30 Apr '13 - 16:12 »
Please check what the following code produces...

Code: [Select]
BASS_DEVICEINFO di;
for (int a=1; BASS_GetDeviceInfo(a, &di); a++) {
printf("%d: name=[%s] dev=[%s] flags=%x\n", a, di.name, di.driver, di.flags);
if (BASS_Init(a, 44100, 0, 0, 0)) {
BASS_INFO i;
BASS_GetInfo(&i);
printf("\tspeakers=%d\n", i.speakers);
BASS_Free();
}
}

Is 5.1 output working in other software, and if so, which device (eg. from the list produced by the code above) is it using?

colin

  • Guest
Re: BASS for ARM Linux
« Reply #80 on: 30 Apr '13 - 16:41 »
With your code I have this :

1: name=[Default] dev=[default] flags=3
        speakers=2
2: name=[UDJ6: USB Audio] dev=[hw:0,0] flags=1
3: name=[bcm2835 ALSA: bcm2835 ALSA] dev=[hw:1,0] flags=1
        speakers=2

What do you suggest ?

Thanks a lot

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #81 on: 30 Apr '13 - 17:20 »
That looks like the UDJ6 device initialization failed. To get an idea of why, please check the error code...

Code: [Select]
BASS_DEVICEINFO di;
for (int a=1; BASS_GetDeviceInfo(a, &di); a++) {
printf("%d: name=[%s] dev=[%s] flags=%x\n", a, di.name, di.driver, di.flags);
if (BASS_Init(a, 44100, 0, 0, 0)) {
BASS_INFO i;
BASS_GetInfo(&i);
printf("\tspeakers=%d\n", i.speakers);
BASS_Free();
} else
printf("\tinit fail=%d\n", BASS_ErrorGetCode());
}

Perhaps PulseAudio is using the device? If so, the default ALSA device should probably be set to that ("pulse") in the asound.conf file.

Please also confirm whether you have been able to use 5.1 output with any other software on the device, to confirm whether the problem you're having is something that is BASS-specific.

colin

  • Guest
Re: BASS for ARM Linux
« Reply #82 on: 30 Apr '13 - 23:28 »
I have this :


1: name=[Default] dev=[default] flags=3
        speakers=2
2: name=[UDJ6: USB Audio] dev=[hw:0,0] flags=1
        init fail=6
3: name=[bcm2835 ALSA: bcm2835 ALSA] dev=[hw:1,0] flags=1
        speakers=2

It's 6   BASS_ERROR_FORMAT
http://www.un4seen.com/doc/#bass/BASS_ErrorGetCode.html

my asound.conf is :
pcm.card0 {
    type hw
    card 0
}
ctl.card0 {
    type hw
    card 0
}
pcm.!default {
    type plug
    slave.pcm "surround51"
    slave.channels 6
    route_policy duplicate
}

Which software can I use to test 5.1 ?
I tested with this :
speaker-test -Dplug:surround51 -c6
it block !
speaker-test -Dplug:surround51 -c6 -s1
s is the num of speaker !
it block with s1 and s2, with s3 to s6 it not block but nothing happens !

Thanks a lot

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #83 on: 1 May '13 - 16:00 »
I have this :


1: name=[Default] dev=[default] flags=3
        speakers=2
2: name=[UDJ6: USB Audio] dev=[hw:0,0] flags=1
        init fail=6
3: name=[bcm2835 ALSA: bcm2835 ALSA] dev=[hw:1,0] flags=1
        speakers=2

It's 6   BASS_ERROR_FORMAT

I will send you a debug version to get some info on what's happening with the internal ALSA calls and resulting in the BASS_ERROR_FORMAT error.

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #84 on: 9 May '13 - 16:47 »
An updated BASS version that adds support for 24-bit soundcards (like colin's above) is now up in the 1st post. It also includes the 64-bit file fix (mentioned further above).

zittergie

  • Posts: 31
Re: BASS for ARM Linux
« Reply #85 on: 10 May '13 - 07:35 »
Hi Ian,

Do you plan to bring the libbass_aac lib to ARM ?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #86 on: 10 May '13 - 16:09 »
An ARM Linux version of the BASS_AAC add-on is now up in the 1st post.

zittergie

  • Posts: 31
Re: BASS for ARM Linux
« Reply #87 on: 11 May '13 - 07:25 »
Thanks

JRfromFL

  • Posts: 16
Re: BASS for ARM Linux
« Reply #88 on: 15 May '13 - 09:24 »
Hi !
I have a problem running a simple BASS playout program on the current version of the Arch Linux (archlinux-hf-2013-02-11). The same program runs fine on the Raspian Linux. I use the internal "audio" output snd_bcm2835.
The program consists of BASS_Init, a BASS_StreamCreateFile and a BASS_ChannelPlay, that's all. It is written in FPC 2.6.0 and uses the current hardfp version of the libbass.so. None of the function calls is reporting an error but there is no audio. I added a BASS_ChannelGetPosition after the BASS_ChannelPlay (BASS_BYTE_POS) in a loop, which constantly reports 8800. I tried different fileformats including WAV, MP3 and OGG.
I installed the mplayer on the arch linux to verify, that driver and alsa are doing okay and mplayer was playing the files I also used within the StreamCreateFile call.
Has anybody an idea, what I'm doing wrong or what else I can test ?

Thanks !

JRfromFL

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #89 on: 15 May '13 - 14:36 »
I will send you a debug version to find out what's going wrong there.

djchristos

  • Posts: 4
Re: BASS for ARM Linux
« Reply #90 on: 17 May '13 - 16:07 »
I'm having a similar issue as JRfromFL... I'm running Arch Linux for Pi and the lastest libbass.so hardfp (from post 1) I can hear the sound device 'click' when BASS_ChannelPlay is called but BASS_ChannelGetPosition reports the file isn't playing/ the value isn't counting.

I'm quite new to programming for Pi, any help would be appreciated

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #91 on: 17 May '13 - 16:48 »
The ARM Linux BASS version does seem to have an ALSA output issue on Arch Linux, which we are currently investigating. I'll send you a debug version, to confirm whether you are indeed having the same issue.

trentggg

  • Guest
BASSMIDI for ARM?
« Reply #92 on: 21 May '13 - 14:44 »
Is there any chance of getting BASSMIDI for ARM?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #93 on: 21 May '13 - 16:35 »
Yes, an ARM Linux version of the BASSMIDI add-on has now been added to the package in the 1st post.

trentggg

  • Guest
Re: BASS for ARM Linux
« Reply #94 on: 21 May '13 - 21:53 »
Thanks again.  :)

serkanp

  • Posts: 64
Re: BASS for ARM Linux
« Reply #95 on: 22 May '13 - 09:17 »
hi Guys,
- i am developing a basic music player with mono on olinuxino maxi board with debian arm (also i have archlinuxarm) , i have soundcard drivers installed, libmpg123 library etc works correct.. also i put the arm version of libbass.so to /usr/lib and chmod it with a+wx
- i can get music playback with mplayer ..

i can successfully init bass.net .. but when i want to play a music file i get BASS_ERROR_FILEFORM

here is the test for soundcard, source i used and result i get:

- test:
[root@alarm music]# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=EVK
    MXS EVK,
    Default Audio Device
sysdefault:CARD=EVK
    MXS EVK,
    Default Audio Device
[root@alarm music]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: EVK [MXS EVK], device 0: MXS ADC/DAC mxs adc/dac-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[root@alarm music]# speaker-test

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 8 to 16384
Period size range from 8 to 2048
Using max buffer size 16384
Periods = 4


Code: [Select]
using System;
using System.IO;
using  Un4seen.Bass;
using Un4seen.Bass.AddOn.Tags;

namespace sevan
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine("loading bass");
BassNet.Registration("xxx", "xxx");

Console.WriteLine("registered bass" + Bass.BASS_GetVersion());
try {
if ( Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT,IntPtr.Zero) )
{
Console.WriteLine("init success");
BASS_INFO info = new BASS_INFO();
Console.WriteLine ("info success");
Bass.BASS_GetInfo( info );
Console.WriteLine("info printed");
Console.WriteLine( info.ToString() );

}else{
Console.WriteLine("Create error" + Bass.BASS_ErrorGetCode());
}
} catch (Exception ex) {
Console.WriteLine (ex.Message);
}

Console.WriteLine ("devices installed:");
BASS_DEVICEINFO[] dinfo=Bass.BASS_GetDeviceInfos();
for (int i = 0; i < dinfo.Length; i++) {
Console.WriteLine (i + "-" +  Bass.BASS_GetDeviceInfo(i));
}
string _fileName = args[0];
Console.WriteLine ("filename:\"" + _fileName + "\"");

int _stream = Bass.BASS_StreamCreateFile(_fileName, 0, 0, BASSFlag.BASS_STREAM_DECODE);
if (_stream != 0) {
Console.WriteLine("File Loaded");
if (Bass.BASS_ChannelPlay (_stream, false)) {
TAG_INFO tagInfo = new TAG_INFO(_fileName);
if (BassTags.BASS_TAG_GetFromFile(_stream, tagInfo))
{
Console.WriteLine(tagInfo + "-duration:" + tagInfo.duration );
}
Console.WriteLine ("Playing file success");
} else {
Console.WriteLine("playback eror");
}

} else {
Console.WriteLine("file load problem :" + Bass.BASS_ErrorGetCode());
}

// wait for a key
Console.WriteLine("Press any key to exit");
Console.ReadKey(false);

// free the stream
Bass.BASS_StreamFree(_stream);
// free BASS
Bass.BASS_Free();
}
}
}

here is the result of code:
[root@alarm music]# mono test.exe /root/music/love.mp3
loading bass
registered bass33819143
init success
info success
info printed
Speakers=2, MinRate=0, MaxRate=0, DX=0, EAX=False
devices installed:
0-No sound
1-Default
2-MXS EVK:
filename:"/root/music/love.mp3"
file load problem :BASS_ERROR_FILEFORM

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #96 on: 22 May '13 - 16:54 »
BASS_ERROR_FILEFORM indicates that BASS_StreamCreateFile didn't recognise the file's format. To confirm whether the problem is specific to the ARM Linux version, please check if BASS is able to play that file (love.mp3) on any other platforms, and also check whether other software is able to play it.

serkan

  • Guest
Re: BASS for ARM Linux
« Reply #97 on: 22 May '13 - 17:52 »
- i can play same file on arm with mplayer.
same code runs on windows with same file successfully
tried different song files on arm same result.
tried different songs with mplayer and ffmpeg success playback on arm
tried those songs with same code success :)
all codecs are ok.

serkan

  • Guest
Re: BASS for ARM Linux
« Reply #98 on: 22 May '13 - 17:57 »
i also tried archlinuxarm
both debian arm and archlinuxarm gave the same error.

i think this is because of libbass.so
it gives sound card information , this means basslib works fine
mplayer plays same file this means mp3 playback and soundcard is ok
bass cant play it.. this means... problem.. :))

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for ARM Linux
« Reply #99 on: 22 May '13 - 18:03 »
Please upload the MP3 file to have a look at here...

   ftp.un4seen.com/incoming/

Also, if you are currently using the "mp3-free" BASS version, please check if the standard BASS version has the problem too.