doc:appunti:linux:audio:audio_recording
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:audio:audio_recording [2019/04/23 12:50] – [Web References] niccolo | doc:appunti:linux:audio:audio_recording [2020/12/28 18:22] (current) – niccolo | ||
---|---|---|---|
Line 44: | Line 44: | ||
A small movable **induction coil**, positioned in the **magnetic field** of a permanent magnet, is attached to the diaphragm. The sound wave moves the diaphragm and the coil moves in the magnetic field, producing a varying current in the coil through **electromagnetic induction**. No power is required: the current is carried directly on **two poles** to the mic input. These microphones generally have a **1/4" mono jack**. | A small movable **induction coil**, positioned in the **magnetic field** of a permanent magnet, is attached to the diaphragm. The sound wave moves the diaphragm and the coil moves in the magnetic field, producing a varying current in the coil through **electromagnetic induction**. No power is required: the current is carried directly on **two poles** to the mic input. These microphones generally have a **1/4" mono jack**. | ||
+ | |||
==== Condenser ==== | ==== Condenser ==== | ||
Line 56: | Line 57: | ||
Unlike capacitor ones, electret microphones **do not require polarizing voltage**, but generally they contain an integrated preamplifier that **does require power**. In this cases a **TRS jack** can be used, where the ring carries power via a resistor from, normally, a 5 V supply in the computer (often incorrectly called // | Unlike capacitor ones, electret microphones **do not require polarizing voltage**, but generally they contain an integrated preamplifier that **does require power**. In this cases a **TRS jack** can be used, where the ring carries power via a resistor from, normally, a 5 V supply in the computer (often incorrectly called // | ||
- | ===== External mic on the Acer Travelmate B113-E ===== | + | ====== Wireless UHF microphone |
- | + | ||
- | Running **Debian GNU/Linux 9 Stretch**, it seems that the use of the **headphone/ | + | |
- | + | ||
- | < | + | |
- | jack/ | + | |
- | jack/ | + | |
- | </ | + | |
- | + | ||
- | but nothing is reported about the plug of a microphone. Beside that, no bias current appear on the microphone jack. The solution is to run the **hdajackretask** tool (from the **alsa-tools-gui** Debian package), then force the connection of **Pin 0x19**: | + | |
- | + | ||
- | * Enable the **Show unconnected pins** option. | + | |
- | * Click **Pin ID: 0x19** => **Override** => **Microphone**. | + | |
- | * **Apply now** (it asks for the root password, as it has to run a script with superuser privileges). | + | |
- | + | ||
- | the running **acpi_listen** will print: | + | |
- | + | ||
- | < | + | |
- | jack/ | + | |
- | </ | + | |
- | + | ||
- | Now you can also measure a **bias current of 2.85 V** between the ground (**sleeve**) and the **ring** or the **tip**. | + | |
- | + | ||
- | Using **alsamixer** you can control the capture device (hit F6 to select the **HDA Intel PCH** sound card), it is advisable to set **Mic Boost** as low as possible (eventually zero) and **Capture** level to 100. | + | |
- | + | ||
- | Is not clear **how to disable the external microphone**: | + | |
- | + | ||
- | ===== Problem: silence gaps using a cheap USB dongle ===== | + | |
- | + | ||
- | I was **unable to use the microphone connector** on my Acer TravelMate, so I tried to use an USB dongle, marked **LinQ**. The device was detected by the Linux Kernel 4.9.0: | + | |
- | + | ||
- | < | + | |
- | usb 2-1.3: new full-speed USB device number 9 using ehci-pci | + | |
- | usb 2-1.3: New USB device found, idVendor=0c76, | + | |
- | usb 2-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0 | + | |
- | usb 2-1.3: Product: USB Headphone Set | + | |
- | input: USB Headphone Set as / | + | |
- | / | + | |
- | hid-generic 0003: | + | |
- | input, | + | |
- | on usb-0000: | + | |
- | </ | + | |
- | + | ||
- | {{ linq-usb-audio.png? | + | |
- | The USB audio adapter worked quite nicely at playing audio, I use it on a QNAP TS-120 NAS, transformed into a media player installing Debian GNU/Linux on it. The Linux kernel and the **ALSA audio subsystem** works well on setting the levels for **playback**. | + | |
- | + | ||
- | Once started Audacity, I was able to select the microphone line of the USB dongle as a **capture device**: | + | |
- | + | ||
- | {{audacity-select-usb-audio.png? | + | |
- | + | ||
- | Recording a sample track revealed an annoying problem: about **every 0.4 seconds** you can see a **gap of silence** in the audio track of about **two hundredths of a second**. The audio track is unusable! | + | |
- | + | ||
- | {{audacity-track-gaps.png? | + | |
- | + | ||
- | ===== Ugreen USB audio adapter ===== | + | |
- | + | ||
- | The device is detected by the Linux Kernel 4.9.0 in this way: | + | |
- | + | ||
- | < | + | |
- | usb 2-1.3: new full-speed USB device number 5 using ehci-pci | + | |
- | usb 2-1.3: New USB device found, idVendor=0d8c, | + | |
- | usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 | + | |
- | usb 2-1.3: Product: USB Advanced Audio Device | + | |
- | usb 2-1.3: Manufacturer: | + | |
- | input: C-Media Electronics Inc. USB Advanced Audio Device as / | + | |
- | / | + | |
- | hid-generic 0003: | + | |
- | input, | + | |
- | on usb-0000: | + | |
- | </ | + | |
- | + | ||
- | {{ ugreen-usb-audio.jpg? | + | |
- | + | ||
- | 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/ | + | |
- | + | ||
- | It seems that the best setting for audio recording through the mic, is to keep the **capture mic gain to 100**: | + | |
- | + | ||
- | {{usb-advanced-audio-device-alsamixer.png? | + | |
- | + | ||
- | 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. | + | |
- | + | ||
- | ===== Wireless UHF microphone ===== | + | |
We have purchased an **UHF wireless microphone** on Aliexpress.com for about 25 €. It is composed by: | We have purchased an **UHF wireless microphone** on Aliexpress.com for about 25 €. It is composed by: | ||
Line 168: | Line 88: | ||
The **2.6 volt** current provided by the USB adapter on th **jack ring** will go nowhere (not connected). The **2.6 volt** current provided on the **jack tip** is probably not required by the UHF receiver, but **it should not harm**. **No infromation** is available about **microphone impedence** expected by the USB adapter, on the other hand no information is available about the **impedence of the mic interface** of the UHF receiver. | The **2.6 volt** current provided by the USB adapter on th **jack ring** will go nowhere (not connected). The **2.6 volt** current provided on the **jack tip** is probably not required by the UHF receiver, but **it should not harm**. **No infromation** is available about **microphone impedence** expected by the USB adapter, on the other hand no information is available about the **impedence of the mic interface** of the UHF receiver. | ||
- | Despite all this empirical approach, the **voice registration is quite satisfying**! | + | Despite all this empirical approach, the **voice registration is quite satisfying**! |
- | ====== Audio Recording With Android | + | |
- | Recording audio using an **external microphone** connected to an **Android device** can be a real nightmare. We tried the hard way using a Chinese, no-brand, **wireless UHF microphone**! | + | ===== Wireless mic on the Acer Travelmate TMB113-E ===== |
- | We can group the problems you can face in three main categories: | + | See this article about **[[audio_recording_tmb113_e]]**. |
- | * Physical connection | + | ===== Wireless mic on Android ===== |
- | * Electrical compatibility and hardware autodetection | + | |
- | * Software capabilities and settings | + | |
- | ===== Physical connection ===== | + | See this article about **[[audio_recording_android]]**. |
- | Most Android devices have a **3.5 mm jack** accepting a **TRRS connector in CTIA standard** and every brand of mobile phones produces **headsets** with their own standard. The vast majority of solutions uses **electret microphones** requiring a **bias current**, but use **some combinations of impedence** to detect the insertion of the microphone and to **handle the headset button** (or buttons). | + | ===== Wireless mic on Ugreen USB audio adapter ===== |
- | So, connecting an external microphone, can be as simple as making a cable that connects the **ring** and the **sleve** of the **CTIA connector** to (respectively) the **ground** and the **microphone line** of the microphone. The hard part is to guess, or empirically try, if the microphone **requires a bias current**, if the Android device is provinding such a current and if the microphone produces a sufficient **output level** (actually a voltage in the order of the millivolts) that can be used by the device. | + | See this article about **[[audio_recording_usb_adapter]]**. |
- | ===== Electrical compatibility and hardware autodetection | + | ====== Problem: silence gaps using a cheap USB dongle ====== |
- | As stated above, the first problem is **powering | + | I was **unable to use the microphone |
- | FIXME: How much current is provided in our test? Is the current always present or switched-on only at jack insertion? | + | < |
+ | usb 2-1.3: new full-speed USB device number 9 using ehci-pci | ||
+ | usb 2-1.3: New USB device found, idVendor=0c76, | ||
+ | usb 2-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0 | ||
+ | usb 2-1.3: Product: USB Headphone Set | ||
+ | input: USB Headphone Set as / | ||
+ | / | ||
+ | hid-generic 0003: | ||
+ | input, | ||
+ | | ||
+ | </ | ||
- | Another parameter which should be considered is the **impedence** FIXME | + | {{ linq-usb-audio.png? |
+ | The USB audio adapter worked quite nicely at playing audio, I use it on a QNAP TS-120 NAS, transformed into a media player installing Debian GNU/Linux on it. The Linux kernel and the **ALSA audio subsystem** works well on setting the levels for **playback**. | ||
- | ===== Software capabilities and settings ===== | + | Once started Audacity, I was able to select the microphone line of the USB dongle as a **capture device**: |
- | FIXME Complete the article! | + | {{audacity-select-usb-audio.png? |
- | Wishing to connect the **UHF microphone** to an **Android smartphone**, we prepared an **adapter cable**. From 3.5 mm jack TRRS male to 1/4" jack TS female, with this pinout: | + | Recording a sample track revealed an annoying problem: about **every 0.4 seconds** you can see a **gap of silence** in the audio track of about **two hundredths of a second**. The audio track is unusable! |
- | ^ 1/4" TS female jack ^ Signal | + | {{audacity-track-gaps.png? |
- | | | Not connected | + | |
- | | | Not connected | + | |
- | | **Sleeve** | + | |
- | | **Tip** | + | |
- | The smartphone **did not sensed the microphone**, | + | ====== Web References |
- | ===== Web References ===== | + | |
* [[wp> | * [[wp> | ||
Line 218: | Line 141: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// |
doc/appunti/linux/audio/audio_recording.1556016627.txt.gz · Last modified: 2019/04/23 12:50 by niccolo