QNAP ALSA drivers help

I’m trying to sort an Icecast link to be able to play my library to a couple of internet radios I already own.
My Roon Core is a QNAP TS 251B and works very effectively. I have Icecast installed and can easily stream an individual file to Icecast using FFMPEG.
However, I am struggling with accessing the drivers that Roon uses. I can clearly see in Roon settings that it uses ALSA to access the four audio outputs of the TS251B. But it appears that Roon has installed these ALSA drivers for itself. None of the usual ALSA commands (aplay arecord etc) are possible to use, unless I ssh to the Roon qpkg directory itself - and even then, only aplay is possible. And aplay -l says “no audio devices found”.
I will have to recompile ffmpeg to be able to see ALSA at all (currently it is ‘unknown input module’) but I’m concerned that even when I do, the ALSA that Roon is using is kept to itself somehow… can anyone shed some light on how this is implemented please? I’m not a linux expert by any means, but I get by - but this is a very new situation to me!
Many thanks.

I also wonder - is it possible to stream RAAT to FFMPEG directly? Or similar software? Then I would not need to access any audio drivers…
Thanks!

Can anyone help? Even if just with the official info on Roon QNAP audio drivers implementation?

Thanks!

Hello @klerm,

At this point in time, Roon on Linux only supports playback to ALSA audio devices. I’ve filled a feature request ticket with the team regarding your use case.

-John

Thank you very much, that answers the second question! What can you tell me about the QNAP ALSA implementation? Clearly it installs something to do it…

Thanks again,

Kit

Hello @klerm,

@crieke would be best positioned to answer that question, as he is responsible for maintaining the RoonServer package for QNAP.

-John

The ALSA libraries that are installed with Roon Server on QNAP are only used on QTS 4.2.x systems.
QTS systems below 4.3 had no 64-bit system libraries, so these were required.
Since QTS 4.3 the system is fully 64-bit and the system libraries are used.

Thanks very much both. @crieke, I will try a reinstall as I have upgraded QTS a few times since Roon was installed. But I wondered, in case this doesn’t change things, how I could access the ALSA drivers to capture output? aplay currently indicates that no audio devices exists, for example.

Many thanks!

But ALSA playback is working in Roon so far?
I am asking, as I have noticed, that in some rare cases ALSA was not available (probably due to a failed or incomplete QTS installation).
In that case it can manually be enforced by running the command:
/etc/init.d/bluetooth.sh start
(Alsa ist part of the bluetooth package on QNAP)

1 Like

Thank you! Yes, ALSA drivers appear in Roon settings, and playback works out of the QNAP’s speaker - thanks for checking.
I tried your command (again thanks) but sadly I get:

[Kit@Mouseion ~]$ /etc/init.d/bluetooth.sh start
ln: /usr/lib/libbluetooth.so.3.5.0: Permission denied
ln: /usr/lib/libbluetooth.so.3: Permission denied
sh: /etc/.qsys.log: Permission denied
sh: /etc/.qsys.log: Permission denied
/etc/init.d/bluetooth.sh: line 166: 16628 Segmentation fault /sbin/daemon_mgr bluetoothd start “/etc/init.d/bluetooth.sh btstart 2>/dev/null 1>/dev/null”

I can’t sudo as I understand that’s not possible in QNAP - have read a lot about people locking themselves out trying to get root access. Is there anything else I can try?

Have thought about it and realise that bluetooth doesn’t appear on the feature list of my model, but a hint on the QNAP website suggests that it might be possible to plug in a bluetooth adapter (https://www.qnap.com/en/how-to/tutorial/article/how-to-manage-and-play-music-with-music-station)
I don’t own one but obviously can buy one, if you think that that’s a likely solution?

Thanks again,

K

Another option could be using a raspberry pi instead of the QNAP. It’s cheap and can run icecast and uses Alsa. Install a disto like Dietpi and you can run bridge on it and send music to it and capture it and send it on to your internet radios. I would use a different encoder though such as liquidsoap or ices rather than ffmpeg as it runs into buffer issues using ffmpeg as the encoder. Or just send the stream to your icecast server on the QNAP. This is what I did when experimenting with getting my vinyl via Roon.

1 Like

Thanks @CrystalGipsy - I had thought of the same, although your tips are very valuable about liquidsoap/ices too (I use FFMPEG a lot for work, so it was the first thing I reached for - plus, it’s already on the QNAP).
You’re right that it’d work and be inexpensive - but I’m really hoping to avoid it as it’d be a shame to waste existing hardware and a good Intel cpu that’s not doing anything - I like to keep things minimal where I can…!
Certainly if this project fails, I’ll do it, and I’m grateful for the encoder tips.

K.

1 Like

No, sudo works on qnap as well. You just should login as admin.

But with sudo you could also destroy a lot of stuff (if you enter the wrong command or mistype something).

Thanks @crieke
Using admin login, I can start that Bluetooth service, and for the first time, aplay works as a command.
However, aplay -l shows just:

**** List of PLAYBACK Hardware Devices ****
ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL hw:0
aplay: device_list:277: control open (0): No such file or directory

This is a new result, but seemingly saying the same thing…! But it’s really strange, as Roon can clearly see the four sound devices on the QNAP. But aplay can’t, or doesn’t seem to… Can you help?

Thanks again.

Using cat, I can also see:

[~] # cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0x91210000 irq 128

But addressing hw:0 in FFMPEG returns ‘cannot open audio device’…

Just to close this off, I gave up trying to make the QNAP audio drivers make sense - they seem to be haunted. The QNAP support say that they aren’t yet implemented (clearly not quite true, but still…).
I made a small virtual machine on the QNAP, installed Roon Bridge (brilliant bit of software, I’m incredibly glad it exists), loaded snd-aloop, selected it as output device and streaming to Icecast using DarkIce (my devices don’t support Vorbis so I have to use MP3) from there was easy, plus adding a cron job to make it autostart.
Thanks for your assistance, and I hope this is useful for anyone to help in the future.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.