Alsa device for ffmpeg (i/o)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am using the snd-aloop alsa driver and i wanna first inject one stream 
using ffmpeg then record it into a file still using ffmpeg.

The injection from the pcm stream is done as follow to the alsa Loopback 
devices :

/usr/local/bin/ffmpeg -f s16le -acodec pcm_s16le -i tcp://localhost:4001 
-f alsa hw:1

Then to record from the Loopback device :

     /usr/local/bin/ffmpeg -f alsa -acodec pcm_s16le hw:1

My problem is to define which input to use for the -i parameter. Indeed, 
between the hw:1,0 or hw:1, ... and so on, this is not very clear.

Can i use hw:1, hw:1,0, default, or something else ?

Using my config, does anybody can help to define the right alsa device 
for ffmpeg.

Here is a detail of my settings :

root@amahealth-pc:~# arecord -l
**** Liste des Périphériques Matériels CAPTURE ****
carte 0: PCH [HDA Intel PCH], périphérique 0: ALC282 Analog [ALC282 Analog]
   Sous-périphériques: 0/1
   Sous-périphérique #0: subdevice #0
carte 1: Loopback [Loopback], périphérique 0: Loopback PCM [Loopback PCM]
   Sous-périphériques: 0/1
   Sous-périphérique #0: subdevice #0
carte 1: Loopback [Loopback], périphérique 1: Loopback PCM [Loopback PCM]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0

root@amahealth-pc:~# arecord -L
null
     Discard all samples (playback) or generate zero samples (capture)
pulse
     PulseAudio Sound Server
default
     Playback/recording through the PulseAudio sound server
sysdefault:CARD=PCH
     HDA Intel PCH, ALC282 Analog
     Default Audio Device
front:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Front speakers
surround40:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct sample snooping device
hw:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Hardware device with all software conversions
sysdefault:CARD=Loopback
     Loopback, Loopback PCM
     Default Audio Device
dmix:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct sample mixing device
dmix:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct sample snooping device
hw:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Hardware device with all software conversions

root@amahealth-pc:~# aplay -L
null
     Discard all samples (playback) or generate zero samples (capture)
pulse
     PulseAudio Sound Server
default
     Playback/recording through the PulseAudio sound server
sysdefault:CARD=PCH
     HDA Intel PCH, ALC282 Analog
     Default Audio Device
front:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Front speakers
surround40:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
     HDA Intel PCH, HDMI 0
     HDMI Audio Output
hdmi:CARD=PCH,DEV=1
     HDA Intel PCH, HDMI 1
     HDMI Audio Output
dmix:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct sample mixing device
dmix:CARD=PCH,DEV=3
     HDA Intel PCH, HDMI 0
     Direct sample mixing device
dmix:CARD=PCH,DEV=7
     HDA Intel PCH, HDMI 1
     Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
     HDA Intel PCH, HDMI 0
     Direct sample snooping device
dsnoop:CARD=PCH,DEV=7
     HDA Intel PCH, HDMI 1
     Direct sample snooping device
hw:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
     HDA Intel PCH, HDMI 0
     Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
     HDA Intel PCH, HDMI 1
     Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
     HDA Intel PCH, ALC282 Analog
     Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
     HDA Intel PCH, HDMI 0
     Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
     HDA Intel PCH, HDMI 1
     Hardware device with all software conversions
sysdefault:CARD=Loopback
     Loopback, Loopback PCM
     Default Audio Device
dmix:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct sample mixing device
dmix:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct sample snooping device
hw:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0
     Loopback, Loopback PCM
     Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1
     Loopback, Loopback PCM
     Hardware device with all software conversions
root@amahealth-pc:~# aplay -l
**** Liste des Périphériques Matériels PLAYBACK ****
carte 0: PCH [HDA Intel PCH], périphérique 0: ALC282 Analog [ALC282 Analog]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0
carte 0: PCH [HDA Intel PCH], périphérique 3: HDMI 0 [HDMI 0]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0
carte 0: PCH [HDA Intel PCH], périphérique 7: HDMI 1 [HDMI 1]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0
carte 1: Loopback [Loopback], périphérique 0: Loopback PCM [Loopback PCM]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0
carte 1: Loopback [Loopback], périphérique 1: Loopback PCM [Loopback PCM]
   Sous-périphériques: 1/1
   Sous-périphérique #0: subdevice #0

root@amahealth-pc:~# cat /proc/asound/modules
  0 snd_hda_intel
  1 snd_aloop

root@amahealth-pc:~# cat /proc/asound/
card0/    card1/    cards     devices   hwdep     Loopback/ modules   
PCH/      pcm       seq/      timers    version

root@amahealth-pc:~# cat /proc/asound/devices
   1:        : sequencer
   2: [ 1- 1]: digital audio playback
   3: [ 1- 1]: digital audio capture
   4: [ 1- 0]: digital audio playback
   5: [ 1- 0]: digital audio capture
   6: [ 1]   : control
   7: [ 0- 7]: digital audio playback
   8: [ 0- 3]: digital audio playback
   9: [ 0- 0]: digital audio playback
  10: [ 0- 0]: digital audio capture
  11: [ 0- 3]: hardware dependent
  12: [ 0- 0]: hardware dependent
  13: [ 0]   : control
  33:        : timer

root@amahealth-pc:~# cat /proc/asound/pcm
00-00: ALC282 Analog : ALC282 Analog : playback 1 : capture 1
00-03: HDMI 0 : HDMI 0 : playback 1
00-07: HDMI 1 : HDMI 1 : playback 1
01-00: Loopback PCM : Loopback PCM : playback 1 : capture 1
01-01: Loopback PCM : Loopback PCM : playback 1 : capture 1

root@amahealth-pc:~# cat /proc/asound/cards
  0 [PCH            ]: HDA-Intel - HDA Intel PCH
                       HDA Intel PCH at 0xe0630000 irq 44
  1 [Loopback       ]: Loopback - Loopback
                       Loopback 1

-- 
Regards

Thierry GAYET


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user





[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux