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 revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:audio:audio_recording [2019/04/09 11:59] – [Electret] niccolo | doc:appunti:linux:audio:audio_recording [2020/12/27 08:34] – [Electrical compatibility and hardware autodetection] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Audio Recording With Linux ====== | + | ====== Audio Recording With GNU/Linux ====== |
===== Choosing the right jack ===== | ===== Choosing the right jack ===== | ||
Line 79: | Line 79: | ||
Now you can also measure a **bias current of 2.85 V** between the ground (**sleeve**) and the **ring** or the **tip**. | Now you can also measure a **bias current of 2.85 V** between the ground (**sleeve**) and the **ring** or the **tip**. | ||
- | Is not clear **how to disable the external microphone**: | + | 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. |
- | ===== Wireless | + | |
+ | Is not clear **how to disable the external microphone**: | ||
+ | |||
+ | ===== Problem: silence gaps using a cheap USB dongle ===== | ||
+ | |||
+ | I was **unable to use the microphone | ||
+ | |||
+ | < | ||
+ | usb 2-1.3: new full-speed USB device number 9 using ehci-pci | ||
+ | usb 2-1.3: New USB device found, idVendor=0c76, idProduct=1607 | ||
+ | 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 ===== | ===== Ugreen USB audio adapter ===== | ||
Line 102: | Line 130: | ||
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/ | 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. | 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 ===== | ||
- | ===== Problem: silence gaps using a cheap USB dongle ===== | + | We have purchased an **UHF wireless microphone** on Aliexpress.com for about 25 €. It is composed by: |
- | I was **unable to use the microphone | + | * The **transmitter** powered by **two AA batteries**, |
+ | * A **[[wp> | ||
+ | | ||
+ | * Frequency range: **610-675 MHz** (53 channels spaced | ||
+ | * Modulation system: DQPSK | ||
+ | * Frequency response: 60-16000 Hz | ||
+ | * Transmitted power: 10 dBm | ||
+ | * Working current: %%<=%% 100 mA | ||
- | < | + | * The **receiver** powered by **two AAA batteries**, featuring: |
- | usb 2-1.3: new full-speed USB device number 9 using ehci-pci | + | |
- | usb 2-1.3: New USB device found, idVendor=0c76, | + | * One small **telescopic antenna**. |
- | 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: | + | |
- | | + | |
- | | + | |
- | </code> | + | |
- | {{ linq-usb-audio.png? | + | {{wireless-mic-trasmitter.jpg? |
- | 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**. | + | {{wireless-mic-receiver.jpg? |
- | Once started Audacity, I was able to select | + | To connect the **UHF receiver** |
- | {{audacity-select-usb-audio.png? | + | ^ 1/4" TS female jack ^ Signal |
+ | | **Tip** | ||
+ | | | Not connected | ||
+ | | **Sleeve** | ||
- | 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 | + | 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 |
- | {{audacity-track-gaps.png? | + | 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**! | ||
+ | |||
+ | We can group the problems you can face in three main categories: | ||
+ | |||
+ | * Physical connection | ||
+ | * Electrical compatibility and hardware autodetection | ||
+ | * Software capabilities and settings | ||
+ | |||
+ | ===== Physical connection ===== | ||
+ | |||
+ | 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). | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ===== Electrical compatibility and hardware autodetection ===== | ||
+ | |||
+ | As stated above, the first problem is **powering the microphone** itself, because generally we will use an **electret** one. It is a **common practice** to provide the power on the same line of the microphone signal, so **requiring just two wires** for both power (from the device to the mic) and for signal (from the mic to the device). The power, also called //bias current//, is generally in the range of **2.5** to **5.0 volt**. | ||
+ | |||
+ | On a Xiaomi Mi A1 smartphone, which has a **TRRS 3.5 mm jack, CTIA standard**, we measured a bias current of **2.19 volt** between the microphone (sleeve) and the ground (ring). | ||
+ | |||
+ | Another parameter which should be considered is the **impedence**, | ||
+ | |||
+ | ===== Software capabilities and settings ===== | ||
+ | |||
+ | FIXME Complete the article! | ||
+ | |||
+ | Wishing to connect the **UHF microphone** to an **Android smartphone**, | ||
+ | |||
+ | ^ 1/4" TS female jack ^ Signal | ||
+ | | | Not connected | ||
+ | | | Not connected | ||
+ | | **Sleeve** | ||
+ | | **Tip** | ||
+ | The smartphone **did not sensed the microphone**, | ||
===== Web References ===== | ===== Web References ===== | ||
Line 140: | Line 213: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |
doc/appunti/linux/audio/audio_recording.txt · Last modified: 2020/12/28 18:22 by niccolo