[FFmpeg-devel] [PATCH] lavd/alsa: implement get_device_list callbacks

wm4 nfxjfg at googlemail.com
Wed Oct 22 15:01:06 CEST 2014


On Wed, 22 Oct 2014 12:07:52 +0200
Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:

> On 22 October 2014 11:53, Nicolas George <george at nsup.org> wrote:
> 
> > Le septidi 27 vendémiaire, an CCXXIII, Lukasz Marek a écrit :
> > > ---
> > >  libavdevice/alsa-audio-common.c | 60
> > +++++++++++++++++++++++++++++++++++++++++
> > >  libavdevice/alsa-audio-dec.c    |  6 +++++
> > >  libavdevice/alsa-audio-enc.c    |  6 +++++
> > >  libavdevice/alsa-audio.h        |  2 ++
> > >  4 files changed, 74 insertions(+)
> > The rest looks good to me, but I have not checked the actual output. If you
> > have a working test tree, can you show the output on a typical system?
> >
> 
> It gives the same list as aplay -L (upper case). For example (ffmpeg will
> display it in different way, but the content is the same)
> 
> default
>     Playback/recording through the PulseAudio sound server
> null
>     Discard all samples (playback) or generate zero samples (capture)
> pulse
>     PulseAudio Sound Server
> sysdefault:CARD=PCH
>     HDA Intel PCH, ALC887-VD Analog
>     Default Audio Device
> front:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     Front speakers
> surround40:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     4.0 Surround output to Front and Rear speakers
> surround41:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     4.1 Surround output to Front, Rear and Subwoofer speakers
> surround50:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     5.0 Surround output to Front, Center and Rear speakers
> surround51:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
> surround71:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
> dmix:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     Direct sample mixing device
> dsnoop:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     Direct sample snooping device
> hw:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     Direct hardware device without any conversions
> plughw:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC887-VD Analog
>     Hardware device with all software conversions
> 
> Question is, if thats correct. Maybe aplay -l (lower case) with "raw"
> devices only should be listed , for example:
> 
> card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> 
> I don't know which is better so I'm glad to have more opinions about that/

I'd tend to add the default device as first entry (typically maps to
dmix, but I think you can't know that, and it might map to arbitrary
other devices, or just be configured to go through pulse), and then the
physical devices.

I suppose you would then change the actual device name to e.g.
"surround51" if your input data has 6 channels, and you'd append the
"CARD=PCH,DEV=0" parameters according to the selected device by the
user.

But I don't know if this is ideal.



More information about the ffmpeg-devel mailing list