Sound?

Linux Center is Linux Container APP, can run different isolated Linux systems on Asustor Nas system using a single Linux kernel.

Moderator: Lillian.W@AST

User avatar
Nazar78
Posts: 1984
youtube meble na wymiar Warszawa
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Sound?

Post by Nazar78 »

Is there supposed to be sound coming from the Debian Desktop HDMI? Clean Jessie install, I saw the HDA Intel PCH sound listed on my AS5304T. I was able to adjust the Alsa mixer volume slider and toggle mute off/on but there's no actual sound coming from the speakers. It has sound when running Virtualbox or Kodi but not Debian. Have tried upgrading the Stretch and Buster still no sound. Any advise? Thank you.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
User avatar
Nazar78
Posts: 1984
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Sound?

Post by Nazar78 »

Ok, I've made some findings about the missing sound and happy to share... I was quite disappointed with the Asustor Portal concept, Virtualbox outdated and not stable, Kodi no longer officially supported and its alternatives even side loaded Kodi/PMS stuttering on HEVC (main reason I got this AS5304T advertised as 4K 10bit HEVC).

So I'm trying to make do with Debian but it's surprisingly up to my "not-too-high" expectation after some messing around, got it fully upgraded to the latest Buster (tedious process, I'll post more if anybody's interested), 4K in VLC with VAAPI hardware acceleration is so much smoother.

Back to the sound issue, note it's already on the latest firmware 3.4.4.RAT2 with Linux Center 1.0.1.r175:

1. When the NAS reboots without Asustor Portal + X.org (required to display Debian over HDMI), the /dev/snd/ is missing, probably eudev not triggered which it did in X.org.

2. For some strange reason to get the audio back, I did the following exact steps in the App Central after every reboot:
  • a. Disable Linux Center.
  • b. Enable Asustor Portal, which also auto enables its dependencies, X.org (for udev /dev/snd/*), Web browser and Remote Center.
  • c. Open any browser i.e. Chrome from the portal and play anything from youtube. There should be sound over HDMI.
  • d. Disable X.org, which also disable its dependant apps, Asustor Portal, Remote Center and Web browser.
  • e. Enable Linux Center.
After the steps above, I got the sound back on my TV from Debian and it stays until next reboot. I briefly tried to automate the sequence above with start up scripts but the sound doesn't come back if I skip step "c.". I'm fairly new to Asustor, anybody know how to properly enable/disable the apkg package from CLI? I was only calling the start-stop scripts.

I had open ticket with support about this Debian sound issue, sent logs, they remoted into my system and lastly I've given them my findings as above although not sure what's the outcome will be. Will they fix this? Running linux container (LXC) desktop environments (DE) seems promising on this type of NAS if they improve further its support.
Attachments
LXC.png
LXC.png (686.46 KiB) Viewed 10175 times
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
User avatar
Nazar78
Posts: 1984
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Sound?

Post by Nazar78 »

I managed to get it running the latest Ubuntu 19.10 Eoan Ermine Desktop. Videos are much more stable and smooth, way much lesser frame drops sometimes to none as compared to Debian Desktop.

Only one thing left is to fix the missing sound /dev/snd/ on NAS upon reboot.

Asustor support seems clueless about LXC and has to stopped replying to existing tickets.

I guess not many is using this Linux-Center app :(
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
User avatar
Nazar78
Posts: 1984
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Sound? <TEMP FIX>

Post by Nazar78 »

Just to share a temporary remedy (until they, Asustor themselves, fixed this) for anyone running into this missing sound issue in the Linux Center Debian Desktop after reboot because /dev/snd is not setup by default. As far as I know it's only setup by the Asustor Portal but only one app can be enabled at one time.

Probably in the future I could provide a package app containing diff patch for this but for now I'll try to describe below for someone who's new to unix. If anyone knows a better way to initialize the sound please feel free to share.

1. SSH into your NAS (Windows use putty, Mac use terminal) as root, pass same as admin,

Code: Select all

ssh root@192.168.1.2
where the IP is your NAS IP. Ensure SSH is already enabled in the Services->Terminal->SSH prior.

2. Assuming Linux Center has already been installed, edit this file using vi, enter:

Code: Select all

vi /usr/local/AppCentral/linux-center/CONTROL/start-stop.sh
3. After opening the file, move your cursor caret to beginning of line 10 which contains several spaces followed by "/sbin/ldconfig" (refer attached screenshot). Get into the insert mode by pressing "i", press enter once to move down the line, place back the cursor at line 10 then paste below (Windows putty paste using right-click):

Code: Select all

                # Fix missing sound upon reboot
                # Requires ASPortal and X.org but disabled
                APP_CENTRAL=/usr/local/AppCentral
                if [ "`grep HDMI=1 $APP_CENTRAL/linux-center/containers/debian/container.conf`" != "" ] && [ "`$APP_CENTRAL/xorg/usr/bin/amixer|grep PCM`" = "" ];then
                        for i in asportal remote-center web-browser xorg;do
                                apkg --disable $i>/dev/null 2>&1
                        done
                        for i in xorg asportal;do
                                $APP_CENTRAL/$i/CONTROL/start-stop.sh start>/dev/null 2>&1
                        done
                        BREAK=0
                        while [ "`$APP_CENTRAL/asportal/webman/general.cgi --act run_app --app "ASUSTOR Portal"|grep '"success": true'`" = "" ];do
                                BREAK=$((BREAK+1))
                                [ $BREAK -ge 60 ] && break
                                sleep 1
                        done
                        BREAK=0
                        while [ "`$APP_CENTRAL/xorg/usr/bin/amixer|grep PCM`" = "" ];do
                                BREAK=$((BREAK+1))
                                [ $BREAK -ge 60 ] && break
                                sleep 1
                        done
                        sleep 5
                        for i in asportal xorg;do
                                $APP_CENTRAL/$i/CONTROL/start-stop.sh stop>/dev/null 2>&1
                        done
                fi
                # Fix missing sound upon reboot
Screenshot from 2020-01-17 02-45-41.png
Screenshot from 2020-01-17 02-45-41.png (121.15 KiB) Viewed 9675 times
4. After inserting the lines above, press "ESC" to exit the insert mode then enter ":wq" to save and quit. At anytime you messed up, press "ESC" then enter ":q!" to quit without saving after which you can retry editing again. The usual undo/redo doesn't seems to work with the busybox version of vi!

5. Restart your NAS if the sound is already missing, else this should work the next time your NAS reboot. Note Asustor Portal and X.org needs to be installed but disabled. Also avoid remote sessions like Chrome Remote Desktop as another session would mess up the alsa/pulseaudio or even inputs and could also lockup the HDMI audio sink until next reboot. Use VNC instead.

Final words... After fixing the sound issue, a few tweaks/mods here and there, I'm overall satisfied with the Nimbustor4. Running LXC on the NAS, I could also run few games from Steam like CS:GO on medium settings FHD. The passthrough 5.1 surround also seems to be working well including smooth 4K 100mbps HEVC 10bit video playback on VLC and hardware video decoding acceleration on Chromium. Really wondering why Asustor is still sticking with its sluggish AS Portal? So no more going back to Asustor Portal for me but I'll not replace the core ADM with Ubuntu for its firmware/bios support.
Attachments
Screenshot from 2020-01-17 00-41-35.png
Screenshot from 2020-01-17 00-41-35.png (1.35 MiB) Viewed 9675 times
Last edited by Nazar78 on Sat Mar 21, 2020 9:35 am, edited 1 time in total.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
funkyfish13
Posts: 4
Joined: Mon Jan 27, 2020 11:44 pm

Re: Sound?

Post by funkyfish13 »

Hey Nazar78,

as you can guess, i struggled upon your post by searching a solution for exact the same problem.

As my AS6202T offers even Debian8, to get around spotify / video issues with Asustor Portal.

SPDIF would be my favourite way. But no succses with your workaround so far. (Debian8 / AS Portal / X.org etc.)
#1
I guess i need another Value than HDMI grepped?!
#2
I rather like having another distro than debian (maybe ubuntu ect.)
(i would apreciate a way to add another distro to LXC very much)

Could you please provide me some of your knowledge
Tanks in advance

Sebastian
AS6202T 16GB 4TB
User avatar
Nazar78
Posts: 1984
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Sound?

Post by Nazar78 »

funkyfish13 wrote:#1
I guess i need another Value than HDMI grepped?!
#2
I rather like having another distro than debian (maybe ubuntu ect.)
(i would apreciate a way to add another distro to LXC very much)
#1 The grep sequence you saw in the script I've provided was just to trigger AS Portal, then wait for the audio device to be ready before booting the Linux Center (LXC). My issue was the sound got lost when the NAS reboots. I tried to recreate the /dev/snd paths then let alsa/pulseaudio take over in LXC but it seems only AS Portal is able to initialize the audio device.

I'm not clear about your issue though. Do you have SPDIF audio from the Debian 8 or at least from AS Portal? If not, try uninstall LXC, enable back AS Portal then reboot. After reboot, go to the AS Portal then set the audio output to SPDIF (mine has only HDMI1 as my NAS has no SPDIF). If there's sound from your SPDIF output, install LXC then start it up. If there's no audio from your SPDIF, install pulseaudio then edit the /etc/pulse/default.pa inside LXC, look for the commented part where you can manually load your device without auto detection from udev (udev doesn't run in container like LXC). The default I think it's hw:1,0 and you need to change this to the card,id that reflects your SPDIF output, try start with hw:0,0. Use "aplay -l" to list your audio devices. After saving, to test use current admin to run pulseaudio -k to kill and it'll restart itself without rebooting then you can test each time see which is working.

#2 I tried using the lxc commands to setup new instance of other distros but they won't boot up which I could have missed something, that I could try play again when I've the time. So I did a dist then full-upgrade with source pointing to other distros using chroot. Encountered few errors which I solved each manually until all the packages are tidy up nicely and up to date.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
funkyfish13
Posts: 4
Joined: Mon Jan 27, 2020 11:44 pm

Re: Sound?

Post by funkyfish13 »

Thank you for replying fast!

In AS Portal i do have sound over SPDIF so i assume i will have it in LXC too, but sadly i wont.
I am not very familiar with Debian (Linux in general) but i tried several hints including pulseaudio.
I wonder how the LXC deals with the hardware virtual wired to the VM…

So i will follow the steps you mentioned with pulseaudio (hope it works in debian8 also)

If you have some time to provide me some steps to install ubuntu instead debian i would be happy.

BTW is Virtualbox not working - i did not tried it so far?

tia
Sebastian
AS6202T 16GB 4TB
funkyfish13
Posts: 4
Joined: Mon Jan 27, 2020 11:44 pm

Re: Sound?

Post by funkyfish13 »

Thank you for hints.
In some way i succseeded in getting sound off SPDIF. Therefor i modified the default.pa and get it to work instantly.
But after reboot - i get an error on pulseaudio "cant load modul alsa… / cant load hw:0,1" Alsa configuration misconfigured?!
The LX Player works nevertheless - thats wierd!
If i reboot the entire NAS i need to start over with AS Portal again to get HW recognized by LHX.
I guess i need to go somewhat deeper in it…

Second strange behaviour is the firefox i have installed newly - no sound - spotify keep skipping all songs on the playlist… (i guess this is an issue with sound drivers as well)

What can i do further?!

thanks in advance
Sebastian
AS6202T 16GB 4TB
User avatar
Nazar78
Posts: 1984
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Sound?

Post by Nazar78 »

funkyfish13 wrote: But after reboot - i get an error on pulseaudio "cant load modul alsa… / cant load hw:0,1" Alsa configuration misconfigured?!
The LX Player works nevertheless - thats wierd!
Probably some old bug? It's based on Debian 8 Jessie but think the release was since 2017/07/28. You could try do apt update then apt upgrade but it would possibly fail because the way Asustor compile the kernel (I had to manually recompile some of my needed app binaries due to this and I've already feedback to Asustor support about it). So just leave it as it is as long it's working.

If i reboot the entire NAS i need to start over with AS Portal again to get HW recognized by LHX.
I guess i need to go somewhat deeper in it…
Yes this is the issue I am facing. The sound is gone on every NAS reboot because the path /dev/snd is not created when AS Portal/Xorg got disabled by LXC requirement. As mentioned in previous post I did tried recreating the /dev/snd and its contents but still LXC couldn't initialize the sound think due to lack of udev which can't run in LXC (udev dependant snap apps will fail to install or work). So that's why I created that part of the script in the previous post to automate the AS Portal enable then disable portion. This will reboot the NAS directly into LXC with a working sound.

Second strange behaviour is the firefox i have installed newly - no sound - spotify keep skipping all songs on the playlist… (i guess this is an issue with sound drivers as well)
Probably an old bug too. I haven't tried Firefox/Spotify but in Chrome/VLC the sound is perfect even in games and everything is smooth in fact I'm replying to you here now from LXC's Ubuntu Chrome listening to YouTube on another tab :)
I'll see if I can put a guide on the latest Ubuntu Eoan (not Focal as it's buggy) but I'll need time to restart from fresh to do the guide. Also I'm quite new to Asustor, just got it few months back, still getting the hang of it and I can only test what's on my NAS model but not on yours like SPDIF which my NAS lacks. Or I'll just share my version with the account recreated then build it into a new apkg but it still needs tweaking and I'll need to find somewhere to host the downloadable image. I'll PM you if I need someone to test as it seems there's not much demand by looking at this section of the forum.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
funkyfish13
Posts: 4
Joined: Mon Jan 27, 2020 11:44 pm

Re: Sound?

Post by funkyfish13 »

Thank you so much for support.
All went well with debian 8. Besides the 1 sec stutter on spotify...
Now i tried Debian 10 and i run into trouble about the performance with videoplayback - every time during HDD activities the videoplayback is stuttering. Is there any workaround? (Cache/LXC Container Size/intelHD400drivers/etc...)
I am so close to an [nearly] perfect entertainment center :cry:
If there is some hint for me.

Thanx in advance

Sebastian
AS6202T 16GB 4TB
Post Reply

Return to “Linux-Center”