-
Notifications
You must be signed in to change notification settings - Fork 0
USB Audio Card for the RPi
inspired by https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions
super-easy, wie es sih herausstellt - im RPi-Jukebox-RFID-Projekt bereits abgedeckt:
Alles im KApitel "Audio is not woerking,hat gereicht, um meine USB-Soundkarte zu aktivieren:
Before you file a ticket on github, please read this section and when you file it, please answer these questions:
what version are you on? Type in terminal cat /home/pi/settings/version what soundcard are you using? does your Raspberry Pi play any sound? did the audio work and then you connected a sound card and now it doesn't?
This might occur if you are using external sound cards like pHat BEAT or the like. I split this into two parts: a) sound did never work and b) sound worked once, now, with a new soundcard, it doesn't.
a) Audio never worked
This could happen if you are using an external soundcard. Generally, if you have audio troubles, try searching the web, because it might get complicated. But try this first:
Learn here why to specify the audio iFace in the file settings/Audio_iFace_Name.
If that doesn't work, check if the device is recognised by your Pi:
$ cat /proc/asound/modules
0 snd_bcm2835
1 snd_usb_audio
This shows that device 1 is the usb audio card. Open the sound configuration file.
$ sudo nano /usr/share/alsa/alsa.conf
Now replace the lines near the end of the file:
defaults.ctl.card 0
defaults.pcm.card 0
with:
defaults.ctl.card 1
defaults.pcm.card 1
Now the audio card for the system is set to 1. Reboot the RPi:
$ sudo reboot
Register your USB device for the Phoniebox
Now we know a lot about the RFID reader attached to our RPi. In order to use it as a controller for our Phoniebox, the software needs to know which device to listen to.
To register your device, go to the directory containing all the scripts and run the file RegisterDevice.py.
cd /home/pi/RPi-Jukebox-RFID/scripts/ python2 RegisterDevice.py
This will bring up a list of one or more devices. Spot the device you are using as a RFID reader, type the number (in this case 2) and hit Enter.
Choose the reader from list 0 Chicony USB Keyboard 1 Chicony USB Keyboard 2 Sycreader USB Reader 3 Logitech USB-PS/2 Optical Mouse
You can check if your device was registered properly by taking a look inside the file that was just generated, called deviceName.txt.
cat deviceName.txt
Now your Phoniebox knows which device to listen to when you are swiping your cards or keyrings.
Was ich nicht nachvollziehen konnte ist die Ergänzung:
According to this post the better way is to add or modify file /etc/asound.conf.
$ sudo nano /etc/asound.conf
And add the following content. You can change this, of course to match your settings:
pcm.!default { type hw card 1 } ctl.!default { type hw card 1 }
Die Datei konnte ich auf meinem System nicht finden.