Single-board computer software development discussions
 help / color / mirror / Atom feed
From: Pavel Isopenko <master@pauli.ru>
To: devel-sbc@lists.altlinux.org
Subject: Re: [devel-sbc] Переключение звука на RPI4
Date: Wed, 20 Nov 2019 17:47:31 +0300
Message-ID: <fb9a34a2-4f52-aa3f-482b-bdbcea52f5ae@pauli.ru> (raw)
In-Reply-To: <cb48e9cd-f669-611c-1ac7-138ac77ec47f@ya.ru>


20.11.2019 15:57, Антон Мидюков пишет:
> 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?
> Такого сценария использования будет достаточно? Или нет?
>
Может быть и достаточно. Пробовать надо. Кто сделает?
Тем временем, в Сизиф ушёл RPi-audioswitch. Он для ручного переключения, 
что идее с udev не противоречит.

http://git.altlinux.org/tasks/archive/done/_235/241113/logs/events.1.1.log



-- 
С уважением, *Павел Исопенко*
тел. +79165329582
email: master@pauli.ru
XMPP: pavelri@jabber.credoaudit.ru


  parent reply	other threads:[~2019-11-20 14:47 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     ` [devel-sbc] Переключение звука на RPI4 Антон Мидюков
2019-11-20 13:17       ` Alexey V. Vissarionov
2019-11-20 14:47       ` Pavel Isopenko [this message]
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=fb9a34a2-4f52-aa3f-482b-bdbcea52f5ae@pauli.ru \
    --to=master@pauli.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