Hi all,
In my Linux machine, I connected the plantronics usb headset with mic and I see(with the help of dmesg) that this device detected.
[116676.507868] usb 2-2: new full-speed USB device number 5 using xhci_hcd [116676.923445] usb 2-2: New USB device found, idVendor=047f, idProduct=c012 [116676.927091] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [116676.934252] usb 2-2: Product: Plantronics .Audio 628 USB [116676.941445] usb 2-2: Manufacturer: Plantronics [116676.945731] usb 2-2: ep 0x84 - rounding interval to 64 microframes, ep desc says 80 microframes [116677.078071] hidraw: raw HID events driver (C) Jiri Kosina [116677.159669] usbcore: registered new interface driver usbhid [116677.161686] usbhid: USB HID core driver [116677.175458] input: Plantronics Plantronics .Audio 628 USB as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/0003:047F:C012.0001/input/input4 [116677.234588] plantronics 0003:047F:C012.0001: input,hiddev0,hidraw0: USB HID v1.00 Device [Plantronics Plantronics .Audio 628 USB] on usb-0000:00:14.0-2/input3 [116677.281756] usbcore: registered new interface driver snd-usb-audio
The following nodes are present in the /dev/snd
$ ls -l /dev/snd/
total 0
drwxr-xr-x 2 root root 60 May 12 11:32 by-id
drwxr-xr-x 2 root root 60 May 12 11:32 by-path
crw-rw---- 1 root audio 116, 2 May 12 11:32 controlC1
crw-rw---- 1 root audio 116, 4 May 12 11:32 pcmC1D0c
crw-rw---- 1 root audio 116, 3 May 12 11:32 pcmC1D0p
crw-rw---- 1 root audio 116, 1 May 12 11:32 seq
crw-rw---- 1 root audio 116, 33 May 12 11:32 timer
What are all these devices present in /dev/snd
How do I use it for playing and recording an audio?
Basically first I want to gain knowledge on set of test cases I can run on ALSA and then learn ALSA kernel modules stuff including snd_usb_audio mdule.
So please guide me by providing related documentation/Steps.
Thanks,
On Tue, May 12, 2020 at 10:13:10PM +0530, Subhashini Rao Beerisetty wrote:
Hi all,
In my Linux machine, I connected the plantronics usb headset with mic and I see(with the help of dmesg) that this device detected.
[116676.507868] usb 2-2: new full-speed USB device number 5 using xhci_hcd [116676.923445] usb 2-2: New USB device found, idVendor=047f, idProduct=c012 [116676.927091] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [116676.934252] usb 2-2: Product: Plantronics .Audio 628 USB [116676.941445] usb 2-2: Manufacturer: Plantronics [116676.945731] usb 2-2: ep 0x84 - rounding interval to 64 microframes, ep desc says 80 microframes [116677.078071] hidraw: raw HID events driver (C) Jiri Kosina [116677.159669] usbcore: registered new interface driver usbhid [116677.161686] usbhid: USB HID core driver [116677.175458] input: Plantronics Plantronics .Audio 628 USB as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/0003:047F:C012.0001/input/input4 [116677.234588] plantronics 0003:047F:C012.0001: input,hiddev0,hidraw0: USB HID v1.00 Device [Plantronics Plantronics .Audio 628 USB] on usb-0000:00:14.0-2/input3 [116677.281756] usbcore: registered new interface driver snd-usb-audio
The following nodes are present in the /dev/snd
$ ls -l /dev/snd/
total 0
drwxr-xr-x 2 root root 60 May 12 11:32 by-id
drwxr-xr-x 2 root root 60 May 12 11:32 by-path
crw-rw---- 1 root audio 116, 2 May 12 11:32 controlC1
crw-rw---- 1 root audio 116, 4 May 12 11:32 pcmC1D0c
crw-rw---- 1 root audio 116, 3 May 12 11:32 pcmC1D0p
crw-rw---- 1 root audio 116, 1 May 12 11:32 seq
crw-rw---- 1 root audio 116, 33 May 12 11:32 timer
What are all these devices present in /dev/snd
How do I use it for playing and recording an audio?
Basically first I want to gain knowledge on set of test cases I can run on ALSA and then learn ALSA kernel modules stuff including snd_usb_audio mdule.
So please guide me by providing related documentation/Steps.
ALSA should "just work" with this device, no need to do anything to the kernel driver. Does it not work properly for you as-is?
thanks,
greg k-h
On Tue, 12 May 2020, Greg KH wrote:
On Tue, May 12, 2020 at 10:13:10PM +0530, Subhashini Rao Beerisetty wrote:
... [116677.281756] usbcore: registered new interface driver snd-usb-audio
The following nodes are present in the /dev/snd
$ ls -l /dev/snd/
total 0
drwxr-xr-x 2 root root 60 May 12 11:32 by-id
drwxr-xr-x 2 root root 60 May 12 11:32 by-path
crw-rw---- 1 root audio 116, 2 May 12 11:32 controlC1
crw-rw---- 1 root audio 116, 4 May 12 11:32 pcmC1D0c
crw-rw---- 1 root audio 116, 3 May 12 11:32 pcmC1D0p
crw-rw---- 1 root audio 116, 1 May 12 11:32 seq
crw-rw---- 1 root audio 116, 33 May 12 11:32 timer
What are all these devices present in /dev/snd
How do I use it for playing and recording an audio?
Basically first I want to gain knowledge on set of test cases I can run on ALSA and then learn ALSA kernel modules stuff including snd_usb_audio mdule.
So please guide me by providing related documentation/Steps.
ALSA should "just work" with this device, no need to do anything to the kernel driver. Does it not work properly for you as-is?
To clarify (if it's not too obvious): Normally these devices are never accessed directly by programs, instead, there is a userspace library called alsa-lib which provides a userspace API and then handles the communication with the kernel devices.
/Ricard
On Tue, May 12, 2020, at 11:43 AM, Subhashini Rao Beerisetty wrote>
How do I use it for playing and recording an audio?
Basically first I want to gain knowledge on set of test cases I can run on ALSA and then learn ALSA kernel modules stuff including snd_usb_audio mdule.
So please guide me by providing related documentation/Steps.
Hi, searching for an ALSA tutorial will get you far. However on a modern Linux distribution you will likely want to target pulseaudio. There are other libraries like RtAudio or PortAudio that may be easier to use and are cross platform.
ALSA seems to give the most reliable results when enumerating audio devices. This can be done when pulseaudio is installed. The pulseaudio results are harder to interpret.
In my experience, and not necessarily targeted at you, I have experienced massive difficulties getting RtAudio and PortAudio working in a reproducible way. ALSA is the most reliable but an unusual configuration, and pulseaudio is a hot complicated mess.
For what it's worth, the sound API on Linux is so pointlessly complex that I have, in the past, created a custom USB driver to avoid going through the sound API. It was easier to use libusb and get raw samples.
On Wed, May 13, 2020 at 8:53 PM Sid Spry sid@aeam.us wrote:
On Tue, May 12, 2020, at 11:43 AM, Subhashini Rao Beerisetty wrote>
How do I use it for playing and recording an audio?
Basically first I want to gain knowledge on set of test cases I can run on ALSA and then learn ALSA kernel modules stuff including snd_usb_audio mdule.
So please guide me by providing related documentation/Steps.
Hi, searching for an ALSA tutorial will get you far. However on a modern Linux distribution you will likely want to target pulseaudio. There are other libraries like RtAudio or PortAudio that may be easier to use and are cross platform.
ALSA seems to give the most reliable results when enumerating audio devices. This can be done when pulseaudio is installed. The pulseaudio results are harder to interpret.
In my experience, and not necessarily targeted at you, I have experienced massive difficulties getting RtAudio and PortAudio working in a reproducible way. ALSA is the most reliable but an unusual configuration, and pulseaudio is a hot complicated mess.
For what it's worth, the sound API on Linux is so pointlessly complex that I have, in the past, created a custom USB driver to avoid going through the sound API. It was easier to use libusb and get raw samples.
Great. Does the custom USB driver is available in public repository?
participants (4)
-
Greg KH
-
Ricard Wanderlof
-
Sid Spry
-
Subhashini Rao Beerisetty