Author Topic: Managed Bass on raspberry pi is distorted  (Read 122 times)

daggepagge

  • Posts: 7
Managed Bass on raspberry pi is distorted
« on: 24 Jun '22 - 18:14 »
Hello,

I built an app with dotnet + Managed Bass that used to run fine on raspberry pi - it still runs fine on macOs and Windows 10 - but now I installed a fresh version of Raspberry Pi OS on my RPI 3B and downloaded the latest binaries of BASS. And this time the audio is distorted - it sounds something like a bitcrusher-effect has been added to the audio signal in my app.

I got it to work flawlessly on the PI too, a bit less then a year ago when I built the first prototype of this project. I can't remember if I ran into this then too but managed to figure it out somehow. Could it be something with the drivers? I have tried 64bit and 32bit latest versions of the Raspberry Pi OS and the corresponding latest BASS binaries.

I'm a bit desperate here which is not anyone elses problem of course, but quick suggestions would be extremely highly appreciated!

Thanks a lot!
Dag

TLDR:
   Latest BASS binaries + fresh install of latest Raspberry Pi OS on RPI 3B = distorted audio
« Last Edit: 24 Jun '22 - 19:26 by daggepagge »

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #1 on: 24 Jun '22 - 19:23 »
Some more info:

Code: [Select]
cat /proc/version returns:
Linux version 5.15.32-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1538 SMP

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #2 on: 24 Jun '22 - 20:56 »
Ok,

Wrote an old backup image to the pi SD-card and copied the new project files - except the new bass binaries, I skipped those.

I had to install dotnet 6 because I had transitioned to it from dotnet 5

Sound worked perfectly. Then I rebooted and now its distorted again!

is it possible that dotnet 6 is creating this issue?

EDIT:
Ok, that's not correct. Sound works perfectly when I run dotnet MyApp.dll but somehow when systemd starts the same app as a service its distorted again. hmm
« Last Edit: 24 Jun '22 - 21:05 by daggepagge »

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #3 on: 24 Jun '22 - 21:11 »
My systemd service configuration looks like this:

Code: [Select]
[Unit]
Description=MyApp service
After=network.target

[Service]
ExecStart=/home/pi/.dotnet/dotnet MyApp.dll
WorkingDirectory=/home/pi/app/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target

Any ideas why starting my app that way would cause distortion when starting it directly with "dotnet MyApp.dll" doesn't ?

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #4 on: 24 Jun '22 - 21:45 »
I'm really sorry about the low quality of this thread. I'm a little bit desperate because I have so little time, again not anyone elses problem of course, but I promise to try my best to make my findings more useful to the community down the line but rn I just have to make this prototype work again.

I'm stuck at this systemd issue: Audio works perfectly when I run dotnet MyApp.dll but how come the audio is distorted when systemd is starting the same app?

I only have the default "pi" user on the system, which is the one set in the .service configuration.

Any ideas?
« Last Edit: 24 Jun '22 - 22:04 by daggepagge »

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #5 on: 25 Jun '22 - 08:14 »
On the off chance someone else ends up here in the future with similar questions: I posted a question here as well.

daggepagge

  • Posts: 7
Re: Managed Bass on raspberry pi is distorted
« Reply #6 on: 25 Jun '22 - 09:41 »
I'll pay 100eur to the hero who helps me figure this out.

EDIT:
Starting it with /etc/rc.local works.
« Last Edit: 25 Jun '22 - 10:14 by daggepagge »