Single-board computer software development discussions
 help / color / mirror / Atom feed
From: "Антон Мидюков" <midyukov-anton@ya.ru>
To: devel-sbc@lists.altlinux.org
Subject: Re: [devel-sbc] Переключение звука на RPI4
Date: Wed, 20 Nov 2019 19:57:42 +0700
Message-ID: <cb48e9cd-f669-611c-1ac7-138ac77ec47f@ya.ru> (raw)
In-Reply-To: <82f766b3-82b5-1d5a-14b1-b5f639f287b9@pauli.ru>

15.11.2019 3:45, Павел Исопенко пишет:
> Был неточен. Поправлюсь.
>
> #!/bin/sh
>
> TMPFCMD="/tmp/dialog.file"
>
> dialog --clear --title "Добрый день, $USER!" --menu "\
> Выберите желаемый аудиовыход:" 10 50 2    "0"  "HDMI audio device"   
> "1" "3,5мм headphone jack" 2> $TMPFCMD
> CMD2RUN=$(cat $TMPFCMD)
> if [ "$?" -eq "0" ]; then
> case "$CMD2RUN" in
>     '0')
>     echo 'Вы выбрали HDMI audio device'
>     amixer -c0 cset numid=3 2
>     ;;
>     '1')
>     echo 'Вы выбрали 3,5мм headphone jack'
>     amixer -c0 cset numid=3 1
>     ;;
>     '-1')
>     echo 'Вы вышли, нажав ESC, или же внутри dialogа произошла ошибка'
>     exit 1
>     ;;
> esac
> fi
>
> rm -f $TMPFCMD
А может сделать правило udev, которое будет при подключении 
наушников/колонок звук выводить на них, а при отключении обратно на hdmi?
Такого сценария использования будет достаточно? Или нет?

-- 
С уважением, Антон Мидюков <antohami@altlinux.org>



  parent reply	other threads:[~2019-11-20 12:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 16:07 [devel-sbc] Патч, восстанавливающий работоспособность звуковой подсистемы для nanopc-t4 Lenar Shakirov
2019-11-14 18:24 ` Павел Исопенко
2019-11-14 20:45   ` Павел Исопенко
2019-11-18 15:50     ` Lenar Shakirov
2019-11-19  7:36       ` Pavel Isopenko
2019-11-20 12:57     ` Антон Мидюков [this message]
2019-11-20 13:17       ` [devel-sbc] Переключение звука на RPI4 Alexey V. Vissarionov
2019-11-20 14:47       ` Pavel Isopenko
2019-11-20 14:54         ` Антон Мидюков

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb48e9cd-f669-611c-1ac7-138ac77ec47f@ya.ru \
    --to=midyukov-anton@ya.ru \
    --cc=devel-sbc@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Single-board computer software development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-sbc/0 devel-sbc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-sbc devel-sbc/ http://lore.altlinux.org/devel-sbc \
		devel-sbc@lists.altlinux.org devel-sbc@lists.altlinux.ru devel-sbc@lists.altlinux.com
	public-inbox-index devel-sbc

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-sbc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git