m0_65236130 2021-12-13 14:41 采纳率: 100%
浏览 27
已结题

英伟达tegra210 连接电视/hifi,默认声卡无法自动选择HDMI,只能手动选择(默认是模拟输出)

英伟达tegra210 (板卡没有扬声器等设备)连接电视/hifi,屏幕音量有2个选项,hdmi和模拟输出,默认是模拟输出。查看板卡信息:

 aplay -l

card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3 []

>  ls
card0  cards    hwdep  tegrahda         timers
card1  devices  pcm    tegrasndt210ref  version

> cat cards
 0 [tegrahda       ]: tegra-hda - tegra-hda
                      tegra-hda at 0x70038000 irq 81
 1 [tegrasndt210ref]: tegra-snd-t210r - tegra-snd-t210ref-mobile-rt565x
                      tegra-snd-t210ref-mobile-rt565x

看alsa.conf文件,默认声卡应该选择hdmi,但是实际打开屏幕,默认是模拟输出。

参照网上方法,在asound.conf文件加入 defaults.pcm.card 0 defaults.pcm.device 3 defaults.ctl.card 0 。重启后打开音乐没有声音,手动选择hdmi,音乐有声音。试了几天,还是不能开机自动是hdmi。

请教一下,如何才你开机就是hdmi?

  • 写回答

3条回答 默认 最新

  • m0_65236130 2021-12-23 10:25
    关注

    设置开机默认输出是hdmi,陆续尝试了几个星期,昨天终于成功了,现将方法记录下来分享。
    1、查询声卡详细信息: pacmd list-cards
    2、找到你要设置的默认声卡的 索引号和 有效文件:如下

    2 card(s) available.
        index: 0
        name: <alsa_card.platform-70030000.hda>
        driver: <module-alsa-card.c>
        owner module: 7
        properties:
            alsa.card = "0"
            alsa.card_name = "tegra-hda"
            alsa.long_card_name = "tegra-hda at 0x70038000 irq 81"
            device.bus_path = "platform-70030000.hda"
            sysfs.path = "/devices/70030000.hda/sound/card0"
            device.form_factor = "internal"
            device.string = "0"
            device.description = "Built-in Audio"
            module-udev-detect.discovered = "1"
            device.icon_name = "audio-card"
        profiles:
            output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available:unknown)
            off: Off (priority 0, available: unknown)
        active profile: <output:hdmi-stereo>
        sinks:
            alsa_output.platform-70030000.hda.hdmi-stereo/#0: Built-in Audio Digital Stereo (HDMI)
    ............
    

    下边是在信息中找到我要默认的声卡输出和索引

     index: 0
    active profile: <output:hdmi-stereo>
    

    3、在/etc/pulse/default.pa文件末尾添加:

    set-card-profile 0 output:hdmi-stereo
    set-default-sink 0
    

    4、重启默认声卡就变成hdmi

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • aabbabababaa 2021-12-13 16:50
    关注

    alsa.conf 配置文件怎么配的?

    评论
  • m0_65236130 2021-12-17 18:08
    关注

    命令查询默认使用声卡:

    $ pacmd list-sinks | grep "index:\|name:"
        index: 0
        name: <alsa_output.platform-70030000.hda.hdmi-stereo>
      * index: 1
        name: <alsa_output.platform-sound.analog-stereo>
    

    alsa.conf文件:

    @hooks [
            {
                    func load
                    files [
                            {
                                    @func concat
                                    strings [
                                            { @func datadir }
                                            "/alsa.conf.d/"
                                    ]
                            }
                            "/etc/asound.conf"
                            "~/.asoundrc"
                    ]
                    errors false
            }
    ]
    
    # load card-specific configuration files (on request)
    
    cards.@hooks [
            {
                    func load
                    files [
                            {
                                    @func concat
                                    strings [
                                            { @func datadir }
                                            "/cards/aliases.conf"
                                    ]
                            }
                    ]
            }
            {
                    func load_for_all_cards
                    files [
                            {
                                    @func concat
                                    strings [
                                            { @func datadir }
                                            "/cards/"
                                            { @func private_string }
                                            ".conf"
                                    ]
                            }
                    ]
                              errors false
            }
    ]
    #
    # defaults
    #
    # show all name hints also for definitions without hint {} section
    defaults.namehint.showall on
    # show just basic name hints
    defaults.namehint.basic on
    # show extended name hints
    defaults.namehint.extended on
    #
    defaults.ctl.card 0
    defaults.pcm.card 0
    defaults.pcm.device 0
    defaults.pcm.subdevice -1
    defaults.pcm.nonblock 1
    defaults.pcm.compat 0
    defaults.pcm.minperiodtime 5000         # in us
    defaults.pcm.ipc_key 5678293
    defaults.pcm.ipc_gid audio
    defaults.pcm.ipc_perm 0660
    defaults.pcm.dmix.max_periods 0
    defaults.pcm.dmix.rate 48000
    defaults.pcm.dmix.format "unchanged"
    defaults.pcm.dmix.card defaults.pcm.card
    defaults.pcm.dmix.device defaults.pcm.device
    defaults.pcm.dsnoop.card defaults.pcm.card
    defaults.pcm.dsnoop.device defaults.pcm.device
    defaults.pcm.front.card defaults.pcm.card
    defaults.pcm.front.device defaults.pcm.device
    defaults.pcm.rear.card defaults.pcm.card
    defaults.pcm.rear.device defaults.pcm.device
    defaults.pcm.center_lfe.card defaults.pcm.card
    defaults.pcm.center_lfe.device defaults.pcm.device
    defaults.pcm.side.card defaults.pcm.card
    defaults.pcm.side.device defaults.pcm.device
    defaults.pcm.surround21.card defaults.pcm.card
    defaults.pcm.surround21.device defaults.pcm.device
    defaults.pcm.surround40.card defaults.pcm.card
    defaults.pcm.surround40.device defaults.pcm.device
    defaults.pcm.surround41.card defaults.pcm.card
    defaults.pcm.surround41.device defaults.pcm.device
    defaults.pcm.surround50.card defaults.pcm.card
    defaults.pcm.surround50.device defaults.pcm.device
    defaults.pcm.surround51.card defaults.pcm.card
    defaults.pcm.surround51.device defaults.pcm.device
    defaults.pcm.surround71.card defaults.pcm.card
    defaults.pcm.surround71.device defaults.pcm.device
    defaults.pcm.iec958.card defaults.pcm.card
    defaults.pcm.iec958.device defaults.pcm.device
    defaults.pcm.modem.card defaults.pcm.card
    defaults.pcm.modem.device defaults.pcm.device
    # truncate files via file or tee PCM
    defaults.pcm.file_format        "raw"
    defaults.pcm.file_truncate      true
    defaults.rawmidi.card 0
    defaults.rawmidi.device 0
    defaults.rawmidi.subdevice -1
    defaults.hwdep.card 0
    defaults.hwdep.device 0
    defaults.timer.class 2
    defaults.timer.sclass 0
    defaults.timer.card 0
    defaults.timer.device 0
    defaults.timer.subdevice 0
    
    #
    #  PCM interface
    #
    
    # redirect to load-on-demand extended pcm definitions
    pcm.cards cards.pcm
    
    pcm.default cards.pcm.default
    pcm.sysdefault cards.pcm.default
    pcm.front cards.pcm.front
    pcm.rear cards.pcm.rear
    pcm.center_lfe cards.pcm.center_lfe
    pcm.side cards.pcm.side
    pcm.surround21 cards.pcm.surround21
    pcm.surround40 cards.pcm.surround40
    pcm.surround41 cards.pcm.surround41
    pcm.surround50 cards.pcm.surround50
    pcm.surround51 cards.pcm.surround51
    pcm.surround71 cards.pcm.surround71
    pcm.iec958 cards.pcm.iec958
    pcm.spdif iec958
    pcm.hdmi cards.pcm.hdmi
    pcm.dmix cards.pcm.dmix
    pcm.dsnoop cards.pcm.dsnoop
    pcm.modem cards.pcm.modem
    pcm.phoneline cards.pcm.phoneline
    
    pcm.hw {
            @args [ CARD DEV SUBDEV ]
            @args.CARD {
                    type string
                    default {
                            @func getenv
                            vars [
                                    ALSA_PCM_CARD
                                    ALSA_CARD
                            ]
                            default {
                                    @func refer
                                    name defaults.pcm.card
                            }
    }
            }
            @args.DEV {
                    type integer
                    default {
                            @func igetenv
                            vars [
                                    ALSA_PCM_DEVICE
                            ]
                            default {
                                    @func refer
                                    name defaults.pcm.device
                            }
                    }
            }
            @args.SUBDEV {
                    type integer
                    default {
                            @func refer
                            name defaults.pcm.subdevice
                    }
            }
    type hw
            card $CARD
            device $DEV
            subdevice $SUBDEV
            hint {
                    show {
                            @func refer
                            name defaults.namehint.extended
                    }
                    description "Direct hardware device without any conversions"
            }
    }
    
    pcm.plughw {
            @args [ CARD DEV SUBDEV ]
            @args.CARD {
                    type string
                    default {
                            @func getenv
                            vars [
                                    ALSA_PCM_CARD
                                    ALSA_CARD
                            ]
    default {
                                    @func refer
                                    name defaults.pcm.card
                            }
                    }
            }
            @args.DEV {
                    type integer
                    default {
                            @func igetenv
                            vars [
                                    ALSA_PCM_DEVICE
                            ]
                            default {
                                    @func refer
                                    name defaults.pcm.device
                            }
                    }
            }
            @args.SUBDEV {
                    type integer
                    default {
     @func refer
                            name defaults.pcm.subdevice
                    }
            }
            type plug
            slave.pcm {
                    type hw
                    card $CARD
                    device $DEV
                    subdevice $SUBDEV
            }
            hint {
                    show {
                            @func refer
                            name defaults.namehint.extended
                    }
                    description "Hardware device with all software conversions"
            }
    }
    
    pcm.plug {
            @args [ SLAVE ]
     @args.SLAVE {
                    type string
            }
            type plug
            slave.pcm $SLAVE
    }
    
    pcm.shm {
            @args [ SOCKET PCM ]
            @args.SOCKET {
                    type string
            }
            @args.PCM {
                    type string
            }
            type shm
            server $SOCKET
            pcm $PCM
    }
    
    pcm.tee {
            @args [ SLAVE FILE FORMAT ]
    
    
     @args.SLAVE {
                    type string
            }
            @args.FILE {
                    type string
            }
            @args.FORMAT {
                    type string
                    default {
                            @func refer
                            name defaults.pcm.file_format
                    }
            }
            type file
            slave.pcm $SLAVE
            file $FILE
            format $FORMAT
            truncate {
                    @func refer
                    name defaults.pcm.file_truncate
            }
    }
    pcm.file {
            @args [ FILE FORMAT ]
            @args.FILE {
                    type string
            }
            @args.FORMAT {
                    type string
                    default {
                            @func refer
                            name defaults.pcm.file_format
                    }
            }
            type file
            slave.pcm null
            file $FILE
            format $FORMAT
            truncate {
                    @func refer
                    name defaults.pcm.file_truncate
            }
    }
    
    pcm.null {
    type null
            hint {
                    show {
                            @func refer
                            name defaults.namehint.basic
                    }
                    description "Discard all samples (playback) or generate zero samm
    ples (capture)"
            }
    }
    
    #
    #  Control interface
    #
    
    ctl.sysdefault {
            type hw
            card {
                    @func getenv
                    vars [
                            ALSA_CTL_CARD
                            ALSA_CARD
                    ]
    default {
                            @func refer
                            name defaults.ctl.card
                    }
            }
            hint.description "Default control device"
    }
    ctl.default ctl.sysdefault
    
    ctl.hw {
            @args [ CARD ]
            @args.CARD {
                    type string
                    default {
                            @func getenv
                            vars [
                                    ALSA_CTL_CARD
                                    ALSA_CARD
                            ]
                            default {
                                    @func refer
                                    name defaults.ctl.card
                            }
     }
            }
            type hw
            card $CARD
            hint.description "Direct control device"
    }
    
    ctl.shm {
            @args [ SOCKET CTL ]
            @args.SOCKET {
                    type string
            }
            @args.CTL {
                    type string
            }
            type shm
            server $SOCKET
            ctl $CTL
    }
    
    #
    #  RawMidi interface
    #
    rawmidi.default {
            type hw
            card {
                    @func getenv
                    vars [
                            ALSA_RAWMIDI_CARD
                            ALSA_CARD
                    ]
                    default {
                            @func refer
                            name defaults.rawmidi.card
                    }
            }
            device {
                    @func igetenv
                    vars [
                            ALSA_RAWMIDI_DEVICE
                    ]
                    default {
                            @func refer
                            name defaults.rawmidi.device
                    }
            }
     hint.description "Default raw MIDI device"
    }
    
    rawmidi.hw {
            @args [ CARD DEV SUBDEV ]
            @args.CARD {
                    type string
                    default {
                            @func getenv
                            vars [
                                    ALSA_RAWMIDI_CARD
                                    ALSA_CARD
                            ]
                            default {
                                    @func refer
                                    name defaults.rawmidi.card
                            }
                    }
            }
            @args.DEV {
                    type integer
                    default {
                            @func igetenv
    vars [
                                    ALSA_RAWMIDI_DEVICE
                            ]
                            default {
                                    @func refer
                                    name defaults.rawmidi.device
                            }
                    }
            }
            @args.SUBDEV {
                    type integer
                    default -1
            }
            type hw
            card $CARD
            device $DEV
            subdevice $SUBDEV
            hint {
                    description "Direct rawmidi driver device"
                    device $DEV
            }
    }
    rawmidi.virtual {
            @args [ MERGE ]
            @args.MERGE {
                    type string
                    default 1
            }
            type virtual
            merge $MERGE
    }
    
    #
    #  Sequencer interface
    #
    
    seq.default {
            type hw
            hint.description "Default sequencer device"
    }
    
    seq.hw {
            type hw
    }
    
    #  HwDep interface
    #
    
    hwdep.default {
            type hw
            card {
                    @func getenv
                    vars [
                            ALSA_HWDEP_CARD
                            ALSA_CARD
                    ]
                    default {
                            @func refer
                            name defaults.hwdep.card
                    }
            }
            device {
                    @func igetenv
                    vars [
                            ALSA_HWDEP_DEVICE
                    ]
                    default {
                            @func refer
    name defaults.hwdep.device
                    }
            }
            hint.description "Default hardware dependent device"
    }
    
    hwdep.hw {
            @args [ CARD DEV ]
            @args.CARD {
                    type string
                    default {
                            @func getenv
                            vars [
                                    ALSA_HWDEP_CARD
                                    ALSA_CARD
                            ]
                            default {
                                    @func refer
                                    name defaults.hwdep.card
                            }
                    }
            }
    @args.DEV {
                    type integer
                    default {
                            @func igetenv
                            vars [
                                    ALSA_HWDEP_DEVICE
                            ]
                            default {
                                    @func refer
                                    name defaults.hwdep.device
                            }
                    }
            }
            type hw
            card $CARD
            device $DEV
            hint {
                    description "Direct hardware dependent device"
                    device $DEV
            }
    }
    #  Timer interface
    #
    
    timer_query.default {
            type hw
    }
    
    timer_query.hw {
            type hw
    }
    
    timer.default {
            type hw
            class {
                    @func refer
                    name defaults.timer.class
            }
            sclass {
                    @func refer
                    name defaults.timer.sclass
            }
            card {
                    @func refer
    name defaults.timer.card
            }
            device {
                    @func refer
                    name defaults.timer.device
            }
            subdevice {
                    @func refer
                    name defaults.timer.subdevice
            }
            hint.description "Default timer device"
    }
    
    timer.hw {
            @args [ CLASS SCLASS CARD DEV SUBDEV ]
            @args.CLASS {
                    type integer
                    default {
                            @func refer
                            name defaults.timer.class
                    }
            }
    @args.SCLASS {
                    type integer
                    default {
                            @func refer
                            name defaults.timer.sclass
                    }
            }
            @args.CARD {
                    type string
                    default {
                            @func refer
                            name defaults.timer.card
                    }
            }
            @args.DEV {
                    type integer
                    default {
                            @func refer
                            name defaults.timer.device
                    }
            }
            @args.SUBDEV {
                    type integer
    default {
                            @func refer
                            name defaults.timer.subdevice
                    }
            }
            type hw
            class $CLASS
            sclass $SCLASS
            card $CARD
            device $DEV
            subdevice $SUBDEV
            hint {
                    description "Direct timer device"
                    device $DEV
            }
    
    
    
    
    
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 12月31日
  • 已采纳回答 12月23日
  • 创建了问题 12月13日

悬赏问题

  • ¥15 求局部放电案例库,用于预测局部放电类型
  • ¥100 QT Open62541
  • ¥15 stata合并季度数据和日度数据
  • ¥15 谁能提供rabbitmq,erlang,socat压缩包,记住版本要对应
  • ¥15 Vue3 中使用 `vue-router` 只能跳转到主页面?
  • ¥15 用QT,进行QGIS二次开发,如何在添加栅格图层时,将黑白的矢量图渲染成彩色
  • ¥50 监控摄像头 乐橙和家亲版 保存sd卡的文件怎么打开?视频怎么播放?
  • ¥15 Python的Py-QT扩展库开发GUI
  • ¥60 提问一下周期性信信号的问题
  • ¥15 jtag连接不上fpga怎么办