Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Bluetooth Sample Rate
#1
Hi all,

my problem is the following:
I'm connecting my pi over I2S to a dsp. The driver and the DSP I am using are only allowing 48kHz / 24 bit.

So for this reason I am using this patch for sample rate converting:

https://www.bitlab.nl/page_id=157

Converting for the radio player works fine.

Now I've tried to play audio via Bluetooth connection and the problem is that tempo and pitch are changing and there are dropouts audible.
This is typically for a wrong sample rate.

So my question is the following:

How can I achieve the sample rate converting also for the Bluetooth connection?

Greetings and thanks from Austria,
                                                      Patrick
Reply
#2
Are you playing to a Bluetooth speaker?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(10-24-2020, 05:24 PM)Tim Curtis Wrote: Are you playing to a Bluetooth speaker?

Hi Tim,

no the signal runs like this:

smart phone over bluetooth to rpi 3b+ then over i2s to dsp and from dsp to an active speaker

Greetings
Reply
#4
You could try editing the following config file to set a different rate and bit depth and then turn on Bluetooth speaker sharing in Audio Config. This will cause bluez-alsa to use btaplay_dmix device defined in the .conf file instead of defaulting to the plughw device.

/etc/alsa/conf.d/20-bluealsa-dmix.conf

I don't know what ALSA uses by default for resampling but it's prolly not going to be great quality like SoX.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(10-24-2020, 07:22 PM)Tim Curtis Wrote: You could try editing the following config file to set a different rate and bit depth and then turn on Bluetooth speaker sharing in Audio Config. This will cause bluez-alsa to use btaplay_dmix device defined in the .conf file instead of defaulting to the plughw device.

/etc/alsa/conf.d/20-bluealsa-dmix.conf

I don't know what ALSA uses by default for resampling but it's prolly not going to be great quality like SoX.

Thanks for the hint, I tried it many times also in slightly different ways but it doesn't work.
Can I change the standard plughw device?

This is my code in the dmix.conf:


Code:
pcm.btaplay_dmix {
   type plug
   slave.pcm "plug_btaplay_dmix"
}

pcm.plug_btaplay_dmix {
   type dmix
   ipc_key 321456
   slave {
       pcm {
           type hw
           card 0
           device 0
       }
       format "S24_LE"
       rate 48000
   }
}


Greetings
Reply


Forum Jump: