User Tools

Site Tools


doc:appunti:linux:audio:audio_recording

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:linux:audio:audio_recording [2020/12/28 16:39] – [Ugreen USB audio adapter] niccolodoc:appunti:linux:audio:audio_recording [2020/12/28 17:14] – [Wireless mic on Ugreen USB audio adapter] niccolo
Line 125: Line 125:
 See this article about **[[audio_recording_android]]**. See this article about **[[audio_recording_android]]**.
  
-====== Wireless mic on Ugreen USB audio adapter ======+===== Wireless mic on Ugreen USB audio adapter =====
  
 The device is detected by the Linux Kernel 4.9.0 in this way: The device is detected by the Linux Kernel 4.9.0 in this way:
Line 143: Line 143:
  
 {{ ugreen-usb-audio.jpg?direct&220|Ugreen USB Audio Adapter}} {{ ugreen-usb-audio.jpg?direct&220|Ugreen USB Audio Adapter}}
 +
 +The **microphone socket** is a **3.5 mm TRS type** (three poles), it provides a bias current of **2.6 V** on both the **tip** and the **ring**, so it is advisable, as reported in the device manual, to **NOT use a simple two poles mono jack** (TS type), because it will short-circuit the bias current on the ring with the ground on the sleeve.
  
 Launching **alsamixer** and hitting F6 you can select the **USB Advanced Audio Device** sound card. Hit F4 to view the only one capture device, i.e. the microphone input line. Press **Space** to enable/disable the **capture** and **Up/Down arrows** to increase/decrease the **gain**. Launching **alsamixer** and hitting F6 you can select the **USB Advanced Audio Device** sound card. Hit F4 to view the only one capture device, i.e. the microphone input line. Press **Space** to enable/disable the **capture** and **Up/Down arrows** to increase/decrease the **gain**.
Line 150: Line 152:
 {{usb-advanced-audio-device-alsamixer.png?direct&300|USB Advenced Audio Device in Alsamixer}} {{usb-advanced-audio-device-alsamixer.png?direct&300|USB Advenced Audio Device in Alsamixer}}
  
-The **microphone socket** is **3.5 mm TRS type** (three poles), it provides a bias current of **2.6 V** on both the **tip** and the **ring**, so it is advisable, as reported in the device manual, to **NOT use a simple two poles mono jack** (TS type), because it will short-circuit the bias current on the ring with the ground on the sleeve.+I use the **PulseAudio** subsystem above the ALSA modules (this is the preferred method in modern GNU/Linux distro). In this case the volume is controlled via the graphics app **pavucontrol** or on the command line using the **pacmd** tool. The PulseAudio recording volume level should be between the **base volume** (value **20724**) and the **100%** (value **65536**)
 + 
 +Here are the commands to start an audio recording using a shell script: 
 + 
 +<code bash> 
 +#!/bin/sh 
 +SOURCE='alsa_input.usb-C-Media_Electronics_Inc._USB_Advanced_Audio_Device-00.analog-stereo' 
 +PORT='analog-input-mic' 
 +VOLUME=65536 
 +pacmd set-default-source "$SOURCE" 
 +pacmd set-source-port "$SOURCE" "$PORT" 
 +pacmd set-source-volume "$SOURCE" "$VOLUME" 
 +pacmd set-source-mute "$SOURCE"
 +parecord --verbose --device="$SOURCE" --channels=1 --fix-rate foobar.wav 
 +</code>
  
 +**WARNING**: The audio files produced by this USB adapter **do not cover the entire 16-bit range**; the values returned (converted into float dB) extend from **-0.5** to **+0.5**, i.e. exactly **the half of what expected** (-1.0 to +1.0). Above that values, **the audio is clipped**. You can view this in the pavucontrol monitor: it does not matter how loud you speak into the microphone, the volume meter bar never reaches the full scale. So **it is advisable** eventually to lower the volume (e.g. to **75%** or 50%) to **avoid clipping**, and to proceed with post-processing **software amplification**.
 ===== Web References ===== ===== Web References =====
  
doc/appunti/linux/audio/audio_recording.txt · Last modified: 2020/12/28 18:22 by niccolo