LP> up audio on Raspbian Jessie, nor do most solutions apply to the latest LP> release of Jessie (many propose alterations LP> to /etc/modprobe.d/alsa-base.conf, a file that doesn't exist in the LP> current LP> Raspbian Jessie).
I don't use Jessie, for my setups (personal issue), only Wheezy.. so see if
/usr/share/alsa/alsa.conf
appears to REPLACE the above... see if you have that..... and post it...
ALSA's docu is notoriously, well, CRAPPY! Unless you wrote it... BUT it is a very powerful system.. I use something called plugins to basically create TWO INPUTS from a stereo line in on the wolfson...
LP> Now, here's my test... LP> pi@redbeard:~ $ arecord testit.wav LP> arecord: main:722: audio open error: No such file or directory
That will NEVER WORK! ALSA and the Pi think device 0 is the default Pi output card, and it has NO RECORDING ABILITIES. ** UNLESS ** you change the default order in the alsa.conf or .asound.rc file
LP> So, let's see what forcing the specific device will do. Blindly, I used LP> plughw, but hw will work (as in not error out) as well:
I've got a C-Media USB Microphone ( C-Media Electronics Inc. USB PnP Sound Device, idVendor=0d8c, idProduct=013c) that I would like to use as the primary audio INPUT on a Raspberry Pi 3 running a recently upgraded refresh of Raspbian Jessie.
I know that the USB microphone is in good working order, having used it (briefly) on my Slackware desktop. But, I can't seem to get it to work on the Raspberry Pi.
There doesn't seem to be a way to properly configure the microphone as the Primary Audio Input, at least not under a stock Jessie install. Perhaps I'm missing some software or documentation.
Has anyone successfully installed this device on their Raspberry Pi 3? If so, can you give me some guidance here?
Thanks
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
Does the PI actually have any capability to read audio at all?
--
"Anyone who believes that the laws of physics are mere social
conventions is invited to try transgressing those conventions from the
windows of my apartment. (I live on the twenty-first floor.) "
Alan Sokal
- alsamixer recognizes the USB microphone, and lets me alter it's input volume, muting, and AGC.
- arecord -l lists the USB microphone as card 1, device 1
Web searches show that
1) USB microphones (specifically, /this/ USB microphone) are supported in this hardware/software environment, and
2) the setup is, at best, arcane, and varies by release of Jessie
Instructions are unclear, mostly coming from forums where single users post their problem, and multiple users post (often conflicting) solutions. (Much like here :-) ). There doesn't seem to be a definitive guide as to how to set up audio on Raspbian Jessie, nor do most solutions apply to the latest release of Jessie (many propose alterations to /etc/modprobe.d/alsa-base.conf, a file that doesn't exist in the current Raspbian Jessie).
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
That has ways of cycling through all possible connected devices and VU meters and so on.
Handy for testing...
--
?It is hard to imagine a more stupid decision or more dangerous way of
making decisions than by putting those decisions in the hands of people
who pay no price for being wrong.?
Thomas Sowell
On Thursday October 6 2016 02:57, in comp.sys.raspberry-pi, "rick christian" wrote:
Bus 001 Device 007: ID 0a81:0101 Chesen Electronics Corp. Keyboard Bus 001 Device 005: ID 2525:8902 Bus 001 Device 009: ID 046d:092b Logitech, Inc. Labtec Webcam Plus Bus 001 Device 008: ID 05dc:a81d Lexar Media, Inc. Bus 001 Device 006: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller (NB: The above device is the USB Microphone) Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Advanced Linux Sound Architecture Driver Version k4.4.21-v7+.
0 [ALSA ]: bcm2835 - bcm2835 ALSA bcm2835 ALSA 1 [Device ]: USB-Audio - USB PnP Sound Device C-Media Electronics Inc. USB PnP Sound Device at usb-3f980000.usb-1.3.2, full s
[snip]
0: [ 0] : control 16: [ 0- 0]: digital audio playback 17: [ 0- 1]: digital audio playback 32: [ 1] : control 33: : timer 56: [ 1- 0]: digital audio capture
00-00: bcm2835 ALSA : bcm2835 ALSA : playback 8 00-01: bcm2835 ALSA : bcm2835 IEC958/HDMI : playback 1 01-00: USB Audio : USB Audio : capture 1
[snip]
**** List of CAPTURE Hardware Devices **** card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0
[snip]
In the last 100 lines of dmesg, only the following seems to be relevant: [ 6.447485] usbcore: registered new interface driver snd-usb-audio There are no other references to the USB audio device that I can see. But, here are the last 100 lines:
[ 4.158414] input: CHESEN USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1/0003:0A81:0101.0004/input/input3 [ 4.168068] scsi host0: usb-storage 1-1.3.3:1.0 [ 4.219975] hid-generic 0003:0A81:0101.0004: input,hidraw3: USB HID v1.10 Device [CHESEN USB Keyboard] on usb-3f980000.usb-1.5/input1 [ 4.259702] usb 1-1.3.4: new full-speed USB device number 9 using dwc_otg [ 4.376273] usb 1-1.3.4: New USB device found, idVendor=046d, idProduct=092b [ 4.385796] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 4.395295] usb 1-1.3.4: Product: Camera [ 4.404690] usb 1-1.3.4: Manufacturer: [ 5.031119] systemd[1]: Started Set Up Additional Binary Formats. [ 5.041291] systemd[1]: Mounting POSIX Message Queue File System... [ 5.066718] fuse init (API version 7.23) [ 5.090775] i2c /dev entries driver [ 5.110190] systemd[1]: Starting Slices. [ 5.129488] systemd[1]: Reached target Slices. [ 5.149835] systemd[1]: Mounted POSIX Message Queue File System. [ 5.167904] systemd[1]: Mounted Debug File System. [ 5.187099] systemd[1]: Started File System Check on Root Device. [ 5.215963] systemd[1]: Started Increase datagram queue length. [ 5.234686] systemd[1]: Started Restore / save the current clock. [ 5.281094] systemd[1]: Started Load Kernel Modules. [ 5.300586] systemd[1]: Started Create list of required static device nodes for the current kernel. [ 5.312915] systemd[1]: Time has been changed [ 5.340120] systemd[1]: Started udev Coldplug all Devices. [ 5.490054] systemd[1]: Starting Create Static Device Nodes in /dev... [ 5.540302] systemd[1]: Starting Apply Kernel Variables... [ 5.561398] systemd[1]: Mounting Configuration File System... [ 5.581661] systemd[1]: Mounting FUSE Control File System... [ 5.602704] systemd[1]: Starting Syslog Socket. [ 5.612178] systemd[1]: Listening on Syslog Socket. [ 5.612381] systemd[1]: Starting Journal Service... [ 5.632540] systemd[1]: Started Journal Service. [ 5.796750] random: nonblocking pool is initialized [ 5.810101] scsi 0:0:0:0: Direct-Access Lexar USB Flash Drive
1100 PQ: 0 ANSI: 4 [ 5.811282] sd 0:0:0:0: [sda] 31258624 512-byte logical blocks: (16.0 GB/14.9 GiB) [ 5.811862] sd 0:0:0:0: [sda] Write Protect is off [ 5.811880] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00 [ 5.812426] sd 0:0:0:0: [sda] No Caching mode page found [ 5.812441] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 5.815518] sda: sda1 [ 5.817720] sd 0:0:0:0: [sda] Attached SCSI removable disk [ 5.850846] systemd-udevd[145]: starting version 215 [ 6.363708] media: Linux media interface: v0.10 [ 6.395703] Linux video capture interface: v2.00 [ 6.438202] gspca_main: v2.14.0 registered [ 6.441938] gspca_main: spca561-2.14.0 probing 046d:092b [ 6.447485] usbcore: registered new interface driver snd-usb-audio [ 6.473709] input: spca561 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/input/input4 [ 6.474364] usbcore: registered new interface driver spca561 [ 6.542503] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer [ 6.562542] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq
83) (baudrate 100000) [ 6.567940] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at
0x3f200000 [ 6.633418] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) [ 6.797589] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 6.849339] usbcore: registered new interface driver brcmfmac [ 7.007797] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: May
27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df
7 [ 7.031656] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 7.177041] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 7.177069] cfg80211: World regulatory domain updated: [ 7.177078] cfg80211: DFS Master region: unset [ 7.177087] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 7.177101] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A,
2000 mBm), (N/A) [ 7.177114] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A,
2000 mBm), (N/A) [ 7.177126] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A,
2000 mBm), (N/A) [ 7.177141] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 7.177155] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 7.177168] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A,
2000 mBm), (0 s) [ 7.177180] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A,
2000 mBm), (N/A) [ 7.177192] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 7.659252] systemd-journald[143]: Received request to flush runtime journal from PID 1 [ 8.169973] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists [ 8.170003] brcmfmac: brcmf_add_if: ignore IF event [ 8.175335] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 8.175369] brcmfmac: power management disabled [ 8.744050] cfg80211: Regulatory domain changed to country: CA [ 8.744079] cfg80211: DFS Master region: FCC [ 8.744089] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 8.744104] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A,
3000 mBm), (N/A) [ 8.744120] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A) [ 8.744134] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2400 mBm), (0 s) [ 8.744147] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A,
2400 mBm), (0 s) [ 8.744159] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A,
3000 mBm), (N/A) [ 9.174389] uart-pl011 3f201000.uart: no DMA platform data [ 9.256395] Process accounting resumed [ 9.381944] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 9.408904] Adding 102396k swap on /var/swap. Priority:-1 extents:2 across:176124k SSFS [ 9.941314] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 9.941513] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 13.578514] Bluetooth: Core ver 2.21 [ 13.578604] NET: Registered protocol family 31 [ 13.578614] Bluetooth: HCI device and connection manager initialized [ 13.578637] Bluetooth: HCI socket layer initialized [ 13.578654] Bluetooth: L2CAP socket layer initialized [ 13.578689] Bluetooth: SCO socket layer initialized [ 13.588408] Bluetooth: HCI UART driver ver 2.3 [ 13.588430] Bluetooth: HCI UART protocol H4 registered [ 13.588440] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 13.588617] Bluetooth: HCI UART protocol BCM registered [ 13.799333] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 13.799346] Bluetooth: BNEP filters: protocol multicast [ 13.799359] Bluetooth: BNEP socket layer initialized
Done that. USB PnP Sound Device shows, Mic gain at 100%, AGC is enabled.
That might be the problem. I didn't have it set in alsamixer. I specified it directly in the arecord command.
OK.
Now, here's my test... pi@redbeard:~ $ arecord testit.wav arecord: main:722: audio open error: No such file or directory
OK. Despite using alsamixer to set the MIC to 100% gain and to be the capture device, and confirming that it was still 100% gain and set to be the capture device /after/ the above arecord invocation, arecord doesn't seem to see the MIC.
So, let's see what forcing the specific device will do. Blindly, I used plughw, but hw will work (as in not error out) as well:
pi@redbeard:~ $ arecord -D plughw:1 testit.wav Recording WAVE 'testit.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... arecord: pcm_read:2031: read error: Interrupted system call
Here, I now have a file called testit.wav, which file says is testit.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 8000 Hz
So, now I aplay the file pi@redbeard:~ $ aplay testit.wav Playing WAVE 'testit.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono and get a quiet hiss over the speakers.
I know that the speakers work and the volume is set correctly, as aplay /usr/share/sounds/alsa/Front_Center.wav comes out as clear as a bell.
And, I know that the mic works, as I've used it (recorded from it) on my Slackware linux system. And I know that the Raspberry Pi 3 / Raspbian Jessie "knows" that the mic is there, from the above info.
Obviously, I'm missing something. But, what?
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
pcm.hw { @args [ CARD DEV SUBDEV ] @args.CARD { type string default { @func getenv vars [ ALSA_PCM_CARD ALSA_CARD ] default { @func refer name defaults.pcm.card } } } @args.DEV { type integer default { @func igetenv vars [ ALSA_PCM_DEVICE ] default { @func refer name defaults.pcm.device } } } @args.SUBDEV { type integer default { @func refer name defaults.pcm.subdevice } } type hw card $CARD device $DEV subdevice $SUBDEV hint { show { @func refer name defaults.namehint.extended } description "Direct hardware device without any conversions" } }
pcm.plughw { @args [ CARD DEV SUBDEV ] @args.CARD { type string default { @func getenv vars [ ALSA_PCM_CARD ALSA_CARD ] default { @func refer name defaults.pcm.card } } } @args.DEV { type integer default { @func igetenv vars [ ALSA_PCM_DEVICE ] default { @func refer name defaults.pcm.device } } } @args.SUBDEV { type integer default { @func refer name defaults.pcm.subdevice } } type plug slave.pcm { type hw card $CARD device $DEV subdevice $SUBDEV } hint { show { @func refer name defaults.namehint.extended } description "Hardware device with all software conversions" } }
pcm.plug { @args [ SLAVE ] @args.SLAVE { type string } type plug slave.pcm $SLAVE }
pcm.shm { @args [ SOCKET PCM ] @args.SOCKET { type string } @args.PCM { type string } type shm server $SOCKET pcm $PCM }
pcm.tee { @args [ SLAVE FILE FORMAT ] @args.SLAVE { type string } @args.FILE { type string } @args.FORMAT { type string default { @func refer name defaults.pcm.file_format } } type file slave.pcm $SLAVE file $FILE format $FORMAT truncate { @func refer name defaults.pcm.file_truncate } }
pcm.file { @args [ FILE FORMAT ] @args.FILE { type string } @args.FORMAT { type string default { @func refer name defaults.pcm.file_format } } type file slave.pcm null file $FILE format $FORMAT truncate { @func refer name defaults.pcm.file_truncate } }
pcm.null { type null hint { show { @func refer name defaults.namehint.basic } description "Discard all samples (playback) or generate zero samples (capture)" } }
# # Control interface # ctl.sysdefault { type hw card { @func getenv vars [ ALSA_CTL_CARD ALSA_CARD ] default { @func refer name defaults.ctl.card } } } ctl.default ctl.sysdefault
ctl.hw { @args [ CARD ] @args.CARD { type string default { @func getenv vars [ ALSA_CTL_CARD ALSA_CARD ] default { @func refer name defaults.ctl.card } } } type hw card $CARD }
ctl.shm { @args [ SOCKET CTL ] @args.SOCKET { type string } @args.CTL { type string } type shm server $SOCKET ctl $CTL }
# # RawMidi interface #
rawmidi.default { type hw card { @func getenv vars [ ALSA_RAWMIDI_CARD ALSA_CARD ] default { @func refer name defaults.rawmidi.card } } device { @func igetenv vars [ ALSA_RAWMIDI_DEVICE ] default { @func refer name defaults.rawmidi.device } } }
rawmidi.hw { @args [ CARD DEV SUBDEV ] @args.CARD { type string default { @func getenv vars [ ALSA_RAWMIDI_CARD ALSA_CARD ] default { @func refer name defaults.rawmidi.card } } } @args.DEV { type integer default { @func igetenv vars [ ALSA_RAWMIDI_DEVICE ] default { @func refer name defaults.rawmidi.device } } } @args.SUBDEV { type integer default -1 } type hw card $CARD device $DEV subdevice $SUBDEV hint { description "Direct rawmidi driver device" device $DEV } }
rawmidi.virtual { @args [ MERGE ] @args.MERGE { type string default 1 } type virtual merge $MERGE }
# # Sequencer interface #
seq.default { type hw }
seq.hw { type hw }
# # HwDep interface #
hwdep.default { type hw card { @func getenv vars [ ALSA_HWDEP_CARD ALSA_CARD ] default { @func refer name defaults.hwdep.card } } device { @func igetenv vars [ ALSA_HWDEP_DEVICE ] default { @func refer name defaults.hwdep.device } } }
hwdep.hw { @args [ CARD DEV ] @args.CARD { type string default { @func getenv vars [ ALSA_HWDEP_CARD ALSA_CARD ] default { @func refer name defaults.hwdep.card } } } @args.DEV { type integer default { @func igetenv vars [ ALSA_HWDEP_DEVICE ] default { @func refer name defaults.hwdep.device } } } type hw card $CARD device $DEV }
# # Timer interface #
timer_query.default { type hw }
timer_query.hw { type hw }
timer.default { type hw class { @func refer name defaults.timer.class } sclass { @func refer name defaults.timer.sclass } card { @func refer name defaults.timer.card } device { @func refer name defaults.timer.device } subdevice { @func refer name defaults.timer.subdevice } hint.description "Default direct hardware timer device" }
timer.hw { @args [ CLASS SCLASS CARD DEV SUBDEV ] @args.CLASS { type integer default { @func refer name defaults.timer.class } } @args.SCLASS { type integer default { @func refer name defaults.timer.sclass } } @args.CARD { type string default { @func refer name defaults.timer.card } } @args.DEV { type integer default { @func refer name defaults.timer.device } } @args.SUBDEV { type integer default { @func refer name defaults.timer.subdevice } } type hw class $CLASS sclass $SCLASS card $CARD device $DEV subdevice $SUBDEV }
I'll say. I struggled with it on Slackware longer ago than I care to remember. But, what I have on my Slackware system is an older version of ALSA, and I don't have these config files there. And, the mic works without config files there - go figure.
Not guilty, thank Ghu
Thanks for the help
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.