allebb / pirrot

A radio repeater controller (supporting both simplex and duplex operation modes) for the RaspberryPi.
https://pirrot.hallinet.com
57 stars 13 forks source link

Not recording/playing #16

Closed allebb closed 7 years ago

allebb commented 7 years ago

The problem is described here: http://sox.10957.n7.nabble.com/Changing-the-audio-input-card-td1645.html

allebb commented 7 years ago

This is another example of the issue: https://stackoverflow.com/questions/33108558/audio-capturing-using-alsa-library-snd-pcm-open-no-such-file-or-directory

allebb commented 7 years ago

https://github.com/alexylem/jarvis/issues/61

allebb commented 7 years ago

Examples of how to set the default driver: https://unix.stackexchange.com/questions/93128/alsa-how-can-i-tell-my-default-audio-output-is-card-2-and-device-0-not-hdmi

allebb commented 7 years ago

This is how openrepeater detected sound cards: https://github.com/OpenRepeater/openrepeater/blob/1.1.0/includes/get_sound.php

allebb commented 7 years ago

More information, specific to the Raspberry can be found here: https://sourceforge.net/p/sox/mailman/message/34114137/

This seems rather useful as it describes how to output the sound devices etc.

allebb commented 7 years ago

Apparently this should work:

sudo modprobe snd-pcm-oss
allebb commented 7 years ago

Also another interesting read so that the sound card order is re-prioritised which may fix the issue (as the Pi doesn't have a mic by default).

https://www.raspberrypi.org/forums/viewtopic.php?t=17950&p=347802

Could also try configuring as: hw:1,0 which apparently is what a USB headset/audio card uses when it's plugged into the RPi.

allebb commented 7 years ago

Another great example, can be found here:

This worked for me on Raspbian Jessie.

If you don't need the onboard audio chip (i.e. analog output or hdmi audio), disable it and then the USB audio device can become the primary device:

Disable onboard audio.
Open /etc/modprobe.d/raspi-blacklist.conf and add blacklist snd_bcm2835.
Allow the USB audio device to be the default device.
Open /lib/modprobe.d/aliases.conf and comment out the line options snd-usb-audio index=-2
Reboot
sudo reboot
Test it out.
$ aplay /usr/share/sounds/alsa/Front_Center.wav

Taken from: https://superuser.com/questions/989385/how-to-make-raspberry-pi-use-an-external-usb-sound-card-as-a-default

allebb commented 7 years ago

This is now fully working again now, the "fix" was to disable the onboard audio with the above comment, the details on how to achieve this can be found documented in the README.md file now.