Bluetooth headset status?


with ALSA's general bluetooth.conf autodetection of devices never worked for me.
go ahead and try.
i do advise to set a correct MAC.
 
I just think it would be very inconvenient as my speakers have a different MAC than my car stereo or BT headset.. I guess it's not necessary as I don't have to right now either... Anyway, will try :D
Also I hope Rockbox will work with your method as that's ideal for in the car!
 
I just think it would be very inconvenient as my speakers have a different MAC than my car stereo or BT headset.. I guess it's not necessary as I don't have to right now either... Anyway, will try :D
Also I hope Rockbox will work with your method as that's ideal for in the car!

The asound switch script I use allows you to have as many different asound configs as you'd like (one for hw and one for each BT MAC address you plan to use). You run the script and specify which device you'd like to switch your default to.

The script that KickAss provided could easily be modified to do something similar.

Code:
#!/bin/bash
# This is a quick and dirty but still quite awesome script to switch ALSA
# output on the fly. It copies valid config files to enable output
# devices on demand.
# As of version 0.1.mod two configs are provided:
#
# 1. BT output -> .asoundrc_bt1
# 2. BT output -> .asoundrc_bt2
# 3. HW output -> .asoundrc_hw
#
# Before any sound is being played ALSA parses the config files, so
# there's NO need to restart your system after you used this script.
#
# Please set ALSAFILES_PATH correctly!

ALSAFILES_PATH=~/alsafiles/

if [[ $# = 0 ]]; then
        echo "No options parsed. Try "$0" --help"
fi

while [[ $# > 0 ]]
do
key="$1"

case $key in
    -o|--output)
    OUTPUT="$2"
    shift
    if [[ ${OUTPUT} = "bt1" ]];then
        echo "Switching audio output to:"
        echo ${OUTPUT}
        echo "using config files from:"
        echo ${ALSAFILES_PATH}
        rm -v ~/.asoundrc
                cp -v ${ALSAFILES_PATH}.asoundrc_bt1 ~/.asoundrc
    elif [[ ${OUTPUT} = "bt2" ]];then
        echo "Switching audio output to:"
        echo ${OUTPUT}
        echo "using config files from:"
        echo ${ALSAFILES_PATH}
        rm -v ~/.asoundrc
                cp -v ${ALSAFILES_PATH}.asoundrc_bt2 ~/.asoundrc
    elif [[ ${OUTPUT} = "hw" ]];then
                echo "Switching audio output to:"
                echo ${OUTPUT}
                echo "using config files from:"
                echo ${ALSAFILES_PATH}
        rm -v ~/.asoundrc
        cp -v ${ALSAFILES_PATH}.asoundrc_hw ~/.asoundrc
    else
        echo "Unsupported output mode parsed. Exiting."
    fi
    ;;
    -h|--help)
    echo
    echo "KickAss Pandora Audio Switch v0.1.mod -- Modified For Two BT Devices"
    echo "------------------------"
    echo "Usage:"
    echo "-h|--help     Display this message."
    echo "-o|--output    Set audio output mode."
    echo "            So far bt1, bt2, and hw are supported."
    echo
    echo "Example: ./audioswitch.sh -o bt1"
    echo
    ;;
    *)
    echo "Unknown option parsed. Exiting."
    ;;
esac
shift
done

I didn't test it, but that modification should work. Instead of saving one BT MAC address to ".asoundrc_bt", you would save one address to ".asoundrc_bt1" and another to ".asoundrc_bt2".

The -o arguments accepted by this script would now be "bt1", "bt2", and "hw".
 
Last edited:
The -o arguments accepted by this script would now be "bt1", "bt2", and "hw".
exactly.
that's actually the real purpose of the script. to have different .asoundrc files predefined (.asoundrc_bt_headset, .asoundrc_bt_carstereo) and use the script to switch em easily.
it will be covered in the tutorial to come. im still at work...
 
i'd like to investigate how gmu invokes mplayer to play the files. because plain mplayer works the way it should.
It doesn't. Gmu is not a frontend for mplayer. It implements everything needed for audio file playback itself and uses SDL for audio output. Since SDL is able to use ALSA, it also recognizes and uses an .asoundrc file in its home directory if there is one and it can see and access it. If it only sees its own private home a global .asoundrc simply does not matter.
You could extract the PND file and try to call Gmu without the PND stuff. This will probably work as expected.
 
You could extract the PND file and try to call Gmu without the PND stuff. This will probably work as expected.
I did that before and it didn't work. It basically says it fails to set bluetooth parameters correctly.
I will read a bit about SDL...
 
SDL makes use of its own env variables.
if i set AUDIODEV=btsoftvol i can force it to use that device. it still fails, tho.

somewhere someone wrote that this may happen if SDL wasnt built with ALSA support.

Setting SDL_AUDIODRIVER=alsa doesnt seem to cause trouble, tho.
 
From what I was reading, bluez-alsa doesn't seem to support resampling plugins like dmix.

Do you have PulseAudio on Slackware? You could try resampling/mixing in Pulse and then sending to the headset to see if that works better.
 
no i dont use pa on slackware. i try to avoid it on purpose.
the point i totally don't get:
drastic uses sdl and works with bluetooth audio without any problems.
gmu uses sdl and keeps failing.

it's driving me mad.
 
no i dont use pa on slackware. i try to avoid it on purpose.
the point i totally don't get:
drastic uses sdl and works with bluetooth audio without any problems.
gmu uses sdl and keeps failing.

it's driving me mad.
Does drastic use the same version of SDL as Gmu does? SDL2 might do audio things differently.
 
@Exophase would be the best person for that.

From what I can tell, most of @ptitSeb's apps work great with BT audio, but I've noticed that those using OpenAL are not compatible.

Are there mainly three varieties of SDL that we'd see on Pandora? SDL 1, SDL 2, and notaz's hardware accelerated SDL?
 
no i dont use pa on slackware. i try to avoid it on purpose.
the point i totally don't get:
drastic uses sdl and works with bluetooth audio without any problems.
gmu uses sdl and keeps failing.

it's driving me mad.

DraStic doesn't use SDL, at least not the Pandora version. It uses ALSA directly.
 
DraStic doesn't use SDL, at least not the Pandora version. It uses ALSA directly.
Sorry 'bout that. Here you said it did use SDL. Didn't know the pandora version was so different.
Anyways, i'm just glad it works well with ALSA (and thus with bluetooth).
 
Back
Top