RasPiCar Projekt Forum

Normale Version: A2DP Verbindung / Keine Tonausgabe
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Seiten: 1 2 3
Moin zusammen.

Ich versuche jetzt schon seit 3 Tagen mein Handy mit dem CarPC zu koppeln um Musik über das Handy zu Streamen.

Tutorial 1

Hilfestellung 1

Ich habe alles mögliche versucht und bekomme mein handy auch mit dem CarPC verbunden, allerdings beim abspielen schickt er mir keinen Sound aus der 3,5mm klinkenbuchse, ich habe auch schon versucht den carPC via HDMI an meinen Fernseher anzuschliessen, jedoch auch ohne erfolg.

Laut Tutorial soll in die Datei /etc/udev/rules.d/99-input.rules folgene Zeile eingefügt werdenKERNEL=="input[0-9]*", RUN+="/usr/lib/udev/bluetooth"
Diese Datei hat bei mir:
1. nicht existiert (deshalb angelegt und folgene 2 Zeilen eingefügt.) 

Code:
SUBSYSTEM=="input", GROUP="input", MODE="0660"

KERNEL=="input[0-9]*", RUN+="/usr/lib/udev/bluetooth"

- eventuell hat ja einer eine funktionierende A2DP-Verbindung und kann mal schauen ob das richtig ist denn:
2. habe ich das gefühl das er das bluetooth script nicht ausführt, da nichts in den logs zu finden ist.

Ich habe auch schon versucht eine A2DP verbindung mit dem gleichen tutorial auf einem blankem wheezy aufzubauen jedoch hatte ich da das gleiche problem.

Hoffe hier hat jemand Zeit und kann mir helfen, ich bin echt am verzweifeln.


lg
smiley
guck mal bitte, was "udevadm monitor" ausspuckt:

->"udevadm monitor"
->BT-Gerät Koppeln
->Gucken, was ausgegeben wurde, hier posten

Ich weiß nicht, ob udevadm in raspbian dabei ist, wenn nicht eben nachinstallieren...
Code:
KERNEL[24037.860557] add      /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/bluetooth/hci0/hci0:71 (bluetooth)
UDEV  [24037.869944] add      /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/bluetooth/hci0/hci0:71 (bluetooth)
KERNEL[24042.256887] add      /devices/virtual/input/input4 (input)
KERNEL[24042.259347] add      /devices/virtual/input/input4/event3 (input)
UDEV  [24042.313773] add      /devices/virtual/input/input4 (input)
UDEV  [24042.324253] add      /devices/virtual/input/input4/event3 (input)

das sagt er mir.

habe jetzt nocheinmal dieses bluetooth script genommen von A2DP tutorial

und bekomme jetzt diese 2 Ausgaben 

Code:
pi@raspberrypi ~ $ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[119.631736] add      /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/bluetooth/hci0/hci0:71 (bluetooth)
UDEV  [119.641821] add      /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/bluetooth/hci0/hci0:71 (bluetooth)
KERNEL[123.504390] add      /module/uinput (module)
KERNEL[123.506522] add      /devices/virtual/misc/uinput (misc)
UDEV  [123.506709] add      /module/uinput (module)
UDEV  [123.507627] add      /devices/virtual/misc/uinput (misc)
KERNEL[123.508556] add      /devices/virtual/input/input3 (input)
KERNEL[123.509596] add      /devices/virtual/input/input3/event3 (input)
UDEV  [124.126361] add      /devices/virtual/input/input3 (input)
UDEV  [124.138367] add      /devices/virtual/input/input3/event3 (input)


pi@raspberrypi ~ cat /var/log/bluetooth_dev
Executing bluetooth script...|remove|
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
Executing bluetooth script...|add|
Executing bluetooth script...|add|
TV is turned on...
TV is turned on...
TV is turned on...
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Executing bluetooth script...|add|
TV is turned on...
Executing bluetooth script...|add|
TV is turned on...
Executing bluetooth script...|add|
TV is turned on...
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Setting bluez_source to: bluez_source.
pactl load-module module-loopback source=bluez_source. sink=alsa_output.0.analog-stereo
Executing bluetooth script...|add|
TV is turned on...
Setting bluez_source to: bluez_source.60_AF_6D_EA_6E_65
pactl load-module module-loopback source=bluez_source.60_AF_6D_EA_6E_65 sink=alsa_output.0.analog-stereo
24
Executing bluetooth script...|add|
TV is turned on...
Setting bluez_source to: bluez_source.60_AF_6D_EA_6E_65
pactl load-module module-loopback source=bluez_source.60_AF_6D_EA_6E_65 sink=alsa_output.0.analog-stereo
25

Ton bekomme ich allerdings immer noch keinen.
Na nach der letzten Ausgabe funktioniert ja zumindest mal die udev-Regel, das war ja letztens nicht so. Hast Du was geändert?

Probier mal
Code:
speaker-test -t pink -f 2600
bei angeschlossenen Lautsprechern.
Hörst Du ein Rauschen?

Kopier mal bitte die Ausgaben von:

Code:
amixer controls

und von
Code:
pacmd list-sinks | grep -e 'name:' -e 'index'

Je nachdem, was bei letztem rauskommt, müsstest Du evtl im Script  /usr/lib/udev/bluetooth  recht weit oben diese beiden Zeilen ändern, also das # in die andere Zeile setzen:

Code:
#AUDIOSINK="alsa_output.platform-bcm2835_AUD0.0.analog-stereo"
AUDIOSINK="alsa_output.0.analog-stereo"
Sollte das nicht geholfen haben, führe bitte nochmal die beiden Zeilen hier aus

Code:
amixer set Master 100%
pacmd set-sink-volume 0 65537

und danach nochmal den pink-test (s.o.) vorsicht: Lautsprecher nicht zu laut... Wink
Hast Du das Script (/usr/lib/udev/bluetooth) aus der Anleitung 1 zu 1 übernommen? Die Ausgaben bezüglich TV dürften so eigentlich nicht erscheinen...Sind auch eigentlich unwichtig für unser Projekt.

Ich hoffe, davon hat irgendwas geholfen. Big Grin
Ersteinmal vielen dank das du versuchst mir zu helfen, obwohl du bald deine Klausur schreibst.

also beim pink-test passiert garnichts.
Wenn ich einen USB-stick ranstecke und über Kodi(CarPC) Musik abspiele höre ich etwas, also lautsprecher sind nicht kaputt Big Grin

Code:
pi@raspberrypi ~ $ amixer controls
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
numid=4,iface=PCM,name='IEC958 Playback Default'

Beim 3. Versuch hat er mir jetzt das angezeigt, vorher zweimal bestimmt 1 minute gewartet kam nichts.

Code:
pi@raspberrypi ~ $ pacmd list-sinks | grep -e 'name:' -e 'index'
 * index: 0
       name: <alsa_output.0.analog-stereo>
   index: 1
       name: <alsa_output.usb-Cmedia_ROCCAT_Juke_6709-00-Juke.analog-stereo>

habe mir jetzt auch mal eine usb-soundkarte von "Hauptsache ihr habt Spass" gegönnt (extra heute gekauft in der hoffnung das es damit klappt) deshalb der 2. eintrag.

Das mit dem AUDIOSINK habe ich auch schon geschaut, jedoch ist so wie in deinem Code, die platform-bcm2835 auskommentiert, also doch eig. richtig bei meiner Ausgabe (oben) ?!

amixer set Master 100%
pacmd set-sink-volume 0 65537

die beiden habe ich auch schon im internet irgendwo gefunden, jedoch bekomme ich dort komische ausgaben...


Code:
pi@raspberrypi ~ $ amixer set Master 100%
amixer: Unable to find simple control 'Master',0
und

Code:
pi@raspberrypi ~ $ pacmd set-sink-volume 0 65537
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> pi@raspberrypi ~ $ help
GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

job_spec [&]                                         history [-c] [-d offset] [n] or history -anrw [fi>
(( expression ))                                     if COMMANDS; then COMMANDS; [ elif COMMANDS; then>
. filename [arguments]                               jobs [-lnprs] [jobspec ...] or jobs -x command [a>
:                                                    kill [-s sigspec | -n signum | -sigspec] pid | jo>
[ arg... ]                                           let arg [arg ...]
[[ expression ]]                                     local [option] name[=value] ...
alias [-p] [name[=value] ... ]                       logout [n]
bg [job_spec ...]                                    mapfile [-n count] [-O origin] [-s count] [-t] [->
bind [-lpvsPVS] [-m keymap] [-f filename] [-q name>  popd [-n] [+N | -N]
break [n]                                            printf [-v var] format [arguments]
builtin [shell-builtin [arg ...]]                    pushd [-n] [+N | -N | dir]
caller [expr]                                        pwd [-LP]
case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]>  read [-ers] [-a array] [-d delim] [-i text] [-n n>
cd [-L|[-P [-e]]] [dir]                              readarray [-n count] [-O origin] [-s count] [-t] >
command [-pVv] command [arg ...]                     readonly [-aAf] [name[=value] ...] or readonly -p>
compgen [-abcdefgjksuv] [-o option]  [-A action] [>  return [n]
complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [>  select NAME [in WORDS ... ;] do COMMANDS; done
compopt [-o|+o option] [-DE] [name ...]              set [-abefhkmnptuvxBCHP] [-o option-name] [--] [a>
continue [n]                                         shift [n]
coproc [NAME] command [redirections]                 shopt [-pqsu] [-o] [optname ...]
declare [-aAfFgilrtux] [-p] [name[=value] ...]       source filename [arguments]
dirs [-clpv] [+N] [-N]                               suspend [-f]
disown [-h] [-ar] [jobspec ...]                      test [expr]
echo [-neE] [arg ...]                                time [-p] pipeline
enable [-a] [-dnps] [-f filename] [name ...]         times
eval [arg ...]                                       trap [-lp] [[arg] signal_spec ...]
exec [-cl] [-a name] [command [arguments ...]] [re>  true
exit [n]                                             type [-afptP] name [name ...]
export [-fn] [name[=value] ...] or export -p         typeset [-aAfFgilrtux] [-p] name[=value] ...
false                                                ulimit [-SHacdefilmnpqrstuvx] [limit]
fc [-e ename] [-lnr] [first] [last] or fc -s [pat=>  umask [-p] [-S] [mode]
fg [job_spec]                                        unalias [-a] name [name ...]
for NAME [in WORDS ... ] ; do COMMANDS; done         unset [-f] [-v] [name ...]
for (( exp1; exp2; exp3 )); do COMMANDS; done        until COMMANDS; do COMMANDS; done
function name { COMMANDS ; } or name () { COMMANDS>  variables - Names and meanings of some shell vari>
getopts optstring name [arg]                         wait [id]
hash [-lr] [-p pathname] [-dt] [name ...]            while COMMANDS; do COMMANDS; done
help [-dms] [pattern ...]                            { COMMANDS ; }



ja ich habe das bluetooth script per copy&paste eingefügt, da es aber blöd formatiert war habe ich es rechts angeordnet und bei der einen Zeile ausversehen das "#" mit gelöscht. Und ich habe bei der Zeile 

Code:
# Set the audio output to HDMI. Change if you don't use HDMI audio out.
# Examples: 0 = auto, 1 = analog, 2 = HDMI
amixer cset numid=3 2
 
aus der 2 eine 1 gemacht da ich ja den analogen ausgang nutzen möchte, richtig?!
lg
smiley
hör mal speaker-test -t pink -D hw:0
ok jetzt rauscht es

0 - Front Left
Time per period = 2.231453

time per period = .... ändert sich

0 - Front Left bleibt immer gleich


was mich auch etwas wundert ist, dass er mir bei amixer controls als namen PCM angibt und nirgends etwas mit MASTER so wie es ja auch im script steht, und bei manuellem eingeben findet er auch keinen MASTER... :/
hat es damit was zu tun?!
probier das koppeln und musik abspielen mal, nachdem du den test gemacht hast
und kann kodi noch was wiedergeben, nachdem du den test gemacht hast?
(05.01.2016, 20:14)nichnormal schrieb: [ -> ]probier das koppeln und musik abspielen mal, nachdem du den test gemacht hast
und kann kodi noch was wiedergeben, nachdem du den test gemacht hast?


werde ich testen, habe den test vorhin abgebrochen, hoffe er beendet den test automatisch.

PS: hatte meinen beitrag oben editiert. Smile
Also ich hab jetzt das mit A2DP mal unter Jessie probiert...Bin beeindruckt. Geht unglaublich simpel!
Vergiss die bisherigen Anleitungen, die gehen mit Jessie nicht.

Stattdessen:

Code:
sudo apt-get install bluez bluez-tools pulseaudio-module-bluetooth python-gobject python-gobject-2

Code:
sudo nano /etc/bluetooth/audio.conf
folgende Zeile einfügen:
Code:
Enable=Source,Sink,Media,Socket,Headset,Gateway,Control

und dann noch ne startup-datei erstellen:

Code:
sudo nano /opt/carpc/startup/initBluetooth.sh

dort das hier reinsetzen:
Code:
#!/bin/bash

#Bluetooth aktivieren
sudo systemctl start bluetooth

sleep 1

#Bluetooth-Config ausführen
echo -e 'power on\nconnect \t \nagent NoInputNoOutput \ndefault-agent \ndiscoverable on \npairable on \nconnect \t \nquit' | bluetoothctl

das ganze in der Startup_Stage2-Datei verlinken:
Code:
sudo nano /opt/carpc/startup/StartCarPC_stage2
irgendwo einfügen, wo es passt (relativ egal. Bei mir stehts in der Mitte)
Code:
#set Bluetooth

sudo /opt/carpc/startup/initBluetooth.sh &

Evtl noch per
Code:
sudo chmod 775 /opt/carpc/startup/initBluetooth.sh
die Rechte anpassen.

Neu starten, sollte funktionieren. Smile
Tut es bei mir jedenfalls. :p

//edit: Es fehlte noch eins:
Code:
sudo chmod 775 /opt/carpc/startup/initBluetooth.sh
Seiten: 1 2 3