Universal HDMI Sound (...Plug n' Play 4 Porteus)
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Static HDMI (...Out Of The Box Audio)
Well, it is kind of an important element of Porteus and we are seeing more and more people having problems due to dual sound setups. Today I sorted the whole Analog/HDMI thing on my laptop.
I now have some udev rules that automatically send video to HDMI when it is plugged. I also have a script that will ask which card you want to use and give you a test. Works fine for me on three machines tested.
I now have some udev rules that automatically send video to HDMI when it is plugged. I also have a script that will ask which card you want to use and give you a test. Works fine for me on three machines tested.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- blue4meridian
- Shogun
- Posts: 279
- Joined: 29 Sep 2014, 05:58
- Distribution: 64bit LxQt (Plastique/Mikachu)
- Location: Jersey City N.J. USA
Re: Static HDMI (...Out Of The Box Audio)
Salutations...
@brokenman... Outstanding...
does your script allow for
saving (eg. persistance?) the result of the audio card choice?
Best Regards...

@brokenman... Outstanding...

saving (eg. persistance?) the result of the audio card choice?
Best Regards...

- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Static HDMI (...Out Of The Box Audio)
If you are saving changes then it will persist. If not then it won't. The whole idea is that user needs to swap sound devices so persistence is not really appropriate. Also if you have a USB install that moves from machine to machine then a persistent asound.conf is no good.
For people that boot into fresh mode and want to select a sound card and keep it persistent, just copy the resulting alsa config file into the rootcopy folder and you're done.
For people that boot into fresh mode and want to select a sound card and keep it persistent, just copy the resulting alsa config file into the rootcopy folder and you're done.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- blue4meridian
- Shogun
- Posts: 279
- Joined: 29 Sep 2014, 05:58
- Distribution: 64bit LxQt (Plastique/Mikachu)
- Location: Jersey City N.J. USA
Re: Solved:Static HDMI (...Out Of The Box Audio)
Salutations...
Well stated. However...I'm curious.
does that mean you are using the Google (AndroidOS) approach?
Namely... when you connect Android's HDMI to a TV the Android device automatically switches to HDMI sound.
There is no need to choose cards or do configuration. Android uses HDMI sound for TV and analog for every thing else.
If not... what do I need to do to get a Plug n' Play result? I haven't had time yet to research Google's solution.
Best Regards...

Well stated. However...I'm curious.

Namely... when you connect Android's HDMI to a TV the Android device automatically switches to HDMI sound.
There is no need to choose cards or do configuration. Android uses HDMI sound for TV and analog for every thing else.
If not... what do I need to do to get a Plug n' Play result? I haven't had time yet to research Google's solution.
Best Regards...

- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Solved?:Static HDMI (...Out Of The Box Audio)
Yes, on my machine I have made it possible to send the video and sound to HDMI when HDMI is plugged in. I don't use it though. I prefer the video to go to the monitor but the sound to stay on the laptop (kickass Harman Kardon speakers). It is really not so difficult to script this, but there is some buginess when scripts are run via udev.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- blue4meridian
- Shogun
- Posts: 279
- Joined: 29 Sep 2014, 05:58
- Distribution: 64bit LxQt (Plastique/Mikachu)
- Location: Jersey City N.J. USA
Re: Solved?:Static HDMI (...Out Of The Box Audio)
Salutations...
IMHO...
I make this suggestion as a recording engineer
w/ over 30 years experience (I once did a project for Columbia/Sony).
There are other ways of getting analog distortion ("warmth").
Such as... use the output of your TV instead of the device.
Because your TV is designed to output sound to speakers.
If you need distortion use an analog preamp (or amplifier).
That noted... you said your script queries before doing Plug n' Play.
What is needed for automated connection (Google's solution)?
Best Regards...

IMHO...

w/ over 30 years experience (I once did a project for Columbia/Sony).
There are other ways of getting analog distortion ("warmth").
Such as... use the output of your TV instead of the device.
Because your TV is designed to output sound to speakers.
If you need distortion use an analog preamp (or amplifier).
That noted... you said your script queries before doing Plug n' Play.
What is needed for automated connection (Google's solution)?
Best Regards...

- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Solved?:Static HDMI (...Out Of The Box Audio)
Completely automated plug n play is just a matter of using xrandr to find the HDMI device.
Then a file is created at /etc/asound.conf telling alsa which sound device to use. The problem I encountered was writing the asound.conf file from a udev script. Shouldn't be too hard to figure out once i get some more time. Remember I am creating a universal solution that will work on the majority of machines. If this solution is required just for YOUR machine it is much simpler. Just create two asound config files. One for the analog output and one for the HDMI output. When udev detects a HDMI plugin it creates a symlink at /etc/asound.conf pointing to the correct HDMI config file. If you need help with this just post the output of:
And using aplay -l to find the HDMI sound device using the output of the above command (E.g HDMI1).xrandr | awk '/ connected/{print$1}'
Then a file is created at /etc/asound.conf telling alsa which sound device to use. The problem I encountered was writing the asound.conf file from a udev script. Shouldn't be too hard to figure out once i get some more time. Remember I am creating a universal solution that will work on the majority of machines. If this solution is required just for YOUR machine it is much simpler. Just create two asound config files. One for the analog output and one for the HDMI output. When udev detects a HDMI plugin it creates a symlink at /etc/asound.conf pointing to the correct HDMI config file. If you need help with this just post the output of:
Code: Select all
xrandr && aplay -l
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- blue4meridian
- Shogun
- Posts: 279
- Joined: 29 Sep 2014, 05:58
- Distribution: 64bit LxQt (Plastique/Mikachu)
- Location: Jersey City N.J. USA
Re: Solved?:Static HDMI (...Out Of The Box Audio)
Salutations...
The solution I refer to is universal.
Because it is Google's solution to the problem.
"All" (as in "universal") Android devices are Plug n' Play. When there are quires and/or configuration... that is not Plug n' Play.
This solution is not for my device... it is the solution to the problem of Plug n' Play for ALL Porteus devices.
Best Regards...

The solution I refer to is universal.

"All" (as in "universal") Android devices are Plug n' Play. When there are quires and/or configuration... that is not Plug n' Play.
This solution is not for my device... it is the solution to the problem of Plug n' Play for ALL Porteus devices.
Best Regards...

- Tonio
- Contributor
- Posts: 276
- Joined: 28 Dec 2010, 16:37
- Distribution: Slackware,porteus,FreeBSD,Slax
- Location: 127.0.0.1
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
@brokenman
Would you mind posting the script? I ran your commands sugested I get
I have checked the the aplay -l command also and contents of /etc/asound.conf I get
Would you mind posting the script? I ran your commands sugested I get
Code: Select all
guest@porteus:~$ xrandr && aplay -l
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 593mm x 371mm
1920x1200 60.0*+
1920x1080 60.0 59.9
1920x1080i 60.1 60.0
1680x1050 59.9
1400x1050 59.9
1280x1024 75.0 60.0
1440x900 59.9
1280x960 60.0
1152x864 75.0
1280x720 60.0 59.9
1024x768 75.1 70.1 60.0
1440x480 60.0 59.9
1440x480i 60.1 60.1
832x624 74.6
800x600 72.2 75.0 60.3 56.2
720x480 60.0 59.9
640x480 75.0 72.8 66.7 60.0 59.9
720x400 70.1
DVI-0 disconnected (normal left inverted right x axis y axis)
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC887-VD Analog [ALC887-VD Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC887-VD Digital [ALC887-VD Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
guest@porteus:~$ xrandr | awk '/ connected/{print$1}'
HDMI-0
guest@porteus:~$
Code: Select all
.... /* removed to save space ********/ ........
state.HDMI {
control {
}
}
state.CX23885 {
control {
}
}
guest@porteus:~$ cat /etc/asound.conf
cat: /etc/asound.conf: No such file or directory
guest@porteus:~$
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
Check if you have a config file at: $HOME/.asound.conf
If so move it elsewhere and run aplay -l again. The output should be something like:
If so move it elsewhere and run aplay -l again. The output should be something like:
Code: Select all
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: 92HD99BXX Analog [92HD99BXX Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Tonio
- Contributor
- Posts: 276
- Joined: 28 Dec 2010, 16:37
- Distribution: Slackware,porteus,FreeBSD,Slax
- Location: 127.0.0.1
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
File $HOME/.asound.conf appears to not be found
Looking at
http://www.maketecheasier.com/setup-hd ... in-linux/
I have done suggested command, and get
EDIT*2 Created the suggested file .asoundrc with different values for hw 0,3, 0,2, etc and I get
So I removed it to get sound again. Thanks for your help and sorry for not reporting back earlier.
I also have a correction, the file /etc/asound.conf does not exist, the one that does is /etc/asound.state

Code: Select all
guest@porteus:~$ cat $HOME/.asound.conf
cat: /home/guest/.asound.conf: No such file or directory
guest@porteus:~$ ls .as*
/bin/ls: cannot access .as*: No such file or directory
guest@porteus:~$ pwd
/home/guest
guest@porteus:~$ find -iname "*.conf" > .allconffiles
guest@porteus:~$ cat .allconffiles
guest@porteus:~$ su -c 'find -iname "*.conf" > /home/guest/.allconffiles'
Password:
find: `./.gvfs': Permission denied
guest@porteus:~$ cat .allconffiles
guest@porteus:~$ su -c 'find -iname "*.conf" > /home/guest/.allconffiles'
Password:
find: `./.gvfs': Permission denied
guest@porteus:~$
root@porteus:/etc# ls *.conf
ca-certificates.conf gpm-syn.conf mtools.conf smartd.conf
changes-exit.conf gpm-twiddler.conf nfsmount.conf syslog.conf
dhcpcd.conf host.conf nscd.conf updatedb.conf
dnsmasq.conf ld.so.conf nsswitch.conf usb_modeswitch.conf
esd.conf logrotate.conf resolv.conf wpa_supplicant.conf
ffserver.conf mdadm.conf sensors3.conf
gpm-root.conf mke2fs.conf serial.conf
root@porteus:/etc# cd /root/
root@porteus:~# ls
Desktop/ Documents/ Downloads/ Music/ Pictures/ Video/
root@porteus:~# cat $HOME/.asound.conf
cat: /root/.asound.conf: No such file or directory
root@porteus:~# echo $HOME
/root
root@porteus:~# exit
logout
guest@porteus:~$ echo $HOME
/home/guest
guest@porteus:~$ ls .allconffiles
.allconffiles
guest@porteus:~$ cat .allconffiles
http://www.maketecheasier.com/setup-hd ... in-linux/
I have done suggested command, and get
Code: Select all
guest@porteus:~$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=SB
HDA ATI SB, ALC887-VD Analog
Default Audio Device
sysdefault:CARD=SB
HDA ATI SB, ALC887-VD Analog
Default Audio Device
front:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
Front speakers
surround21:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
HDA ATI SB, ALC887-VD Digital
IEC958 (S/PDIF) Digital Audio Output
guest@porteus:~$
Code: Select all
guest@porteus:~$ aplay -L
ALSA lib conf.c:1697:(snd_config_load1) _toplevel_:7:17:Unexpected char
ALSA lib conf.c:3417:(config_file_open) /home/guest/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
guest@porteus:~$ rm .asoundrc

Code: Select all
root@porteus:~# lspci -vv | grep 'HDMI'
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
Code: Select all
state.HDMI {
control {
}
}
state.CX23885 {
control {
}
}
root@porteus:~#
root@porteus:~# lspci -v | grep -i audio
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
05:00.0 Multimedia video controller: Conexant Systems, Inc. CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb (rev 0f)
root@porteus:~#
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
I don't see any HDMI audio device in your output. Perhaps you need to try proprietary drivers for this card.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Tonio
- Contributor
- Posts: 276
- Joined: 28 Dec 2010, 16:37
- Distribution: Slackware,porteus,FreeBSD,Slax
- Location: 127.0.0.1
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
If it does not appear, it is there:
But the /etc/asound.state shows the same result and I loaded the boot parameter radeon.audio=1 and there is no sound from hdmi. I try the propietary driver(included in austrumi 3.1.7 and it has no sound either FYI). I have slackware64-current as of May 05 to install but have not done so yet. I like to run porteus without hardrive on this machine. I disconnected hard drive because if I leave it connected, it boots into windows 7
and does not give me a chance to boot cd/live usb. it has UEFI
Do not worry about it, but if you insist on fixing this, or finding a workaround, don't hesitate to post suggestions and I'll try them. Most of the solutions online are for *buntu and/or *buntu based distros which have pulseaudio installed. We don't want to work with that beast here, nor worry about a similar systemd stuff that may find its way
over to Slackware which I hope never happens.
Code: Select all
guest@porteus:~/Downloads$ su -c 'lspci -v | grep -i audio'
Password:
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
05:00.0 Multimedia video controller: Conexant Systems, Inc. CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb (rev 0f)
guest@porteus:~/Downloads$ su -c 'lspci -vv | grep 'HDMI' '
Password:
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
guest@porteus:~/Downloads$


Do not worry about it, but if you insist on fixing this, or finding a workaround, don't hesitate to post suggestions and I'll try them. Most of the solutions online are for *buntu and/or *buntu based distros which have pulseaudio installed. We don't want to work with that beast here, nor worry about a similar systemd stuff that may find its way


- blue4meridian
- Shogun
- Posts: 279
- Joined: 29 Sep 2014, 05:58
- Distribution: 64bit LxQt (Plastique/Mikachu)
- Location: Jersey City N.J. USA
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
Salutations...
@ brokenman... I "need help".
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
DVI-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 983mm x 576mm
1920x1080 60.0*+ 50.0 59.9 30.0 25.0 24.0 30.0 24.0
1920x1080i 60.1 50.0 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1280x960 60.0
1360x768 60.0
1280x720 60.0 50.0 59.9
1440x576i 50.1
1024x768 60.0 60.0
960x720 60.0
1440x480i 60.1 60.1
928x696 60.1
896x672 60.0
800x600 60.0 60.3 56.2
720x576 50.0
700x525 60.0
720x480 60.0 59.9
640x512 60.0
640x480 60.0 60.0 59.9
512x384 60.0
400x300 60.3 56.3
320x240 60.1
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Best Regards...

@ brokenman... I "need help".

guest@porteus:~$ xrandr && aplay -lIf this solution is required just for YOUR machine it is much simpler. Just create two asound config files. One for the analog output and one for the HDMI output. When udev detects a HDMI plugin it creates a symlink at /etc/asound.conf pointing to the correct HDMI config file. If you need help with this just post the output of:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
DVI-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 983mm x 576mm
1920x1080 60.0*+ 50.0 59.9 30.0 25.0 24.0 30.0 24.0
1920x1080i 60.1 50.0 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1280x960 60.0
1360x768 60.0
1280x720 60.0 50.0 59.9
1440x576i 50.1
1024x768 60.0 60.0
960x720 60.0
1440x480i 60.1 60.1
928x696 60.1
896x672 60.0
800x600 60.0 60.3 56.2
720x576 50.0
700x525 60.0
720x480 60.0 59.9
640x512 60.0
640x480 60.0 60.0 59.9
512x384 60.0
400x300 60.3 56.3
320x240 60.1
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Best Regards...

- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Universal HDMI Sound (...Plug n' Play 4 Porteus)
Help with what exactly?
If you are talking about getting sound over HDMI then this is what I can offer. Your /etc/asound.conf file should look like this for analog:
defaults.pcm.card 0
defaults.pcm.device 1
defaults.ctl.card 0
and this for HDMI
defaults.pcm.card 1
defaults.pcm.device 3
defaults.ctl.card 1
If the HDMI doesn't work then try replacing number 3 with 7
If this doesn't work I am out of ideas. Probably a driver for nVidia you need and don't have. Please try this in always fresh mode.
If you are talking about getting sound over HDMI then this is what I can offer. Your /etc/asound.conf file should look like this for analog:
defaults.pcm.card 0
defaults.pcm.device 1
defaults.ctl.card 0
and this for HDMI
defaults.pcm.card 1
defaults.pcm.device 3
defaults.ctl.card 1
If the HDMI doesn't work then try replacing number 3 with 7
If this doesn't work I am out of ideas. Probably a driver for nVidia you need and don't have. Please try this in always fresh mode.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.