Yes, the command you suggested should work correctly even with the && operator. Using && ensures that the second command is executed only if the first command (chmod) was successful.
The structure you wrote is correct, so if you want to run the two commands consecutively, here's what it might look like:
The chmod command sets the permissions for the /run/user/$(id -u)/pulse/native folder to 777, so anyone can read, write, and execute.
The qemu-system-ppc command starts a PPC (PowerPC) virtual machine with specific BIOS, network, and video configurations, and other PCI devices via vfio-pci.
Make sure that:
The vfio-pci devices are configured correctly and that access to the PCI devices (06:00.0 and 06:00.1) is authorized.
The /run/user/$(id -u)/pulse/native folder is accessible by your user, and that 777 permissions are appropriate for your use case.
If the commands are structured correctly and the system is configured to use vfio-pci and network devices, everything should work as expected.
I get error -12 memory Insufficient I tried making a script divided by one for the GPU the result is the same, or it loads the kernel and stops (doesn't boot).
I tried Enable BAR, etc., but the result is identical.
I also tried various tests, including changing -m 1024 to -m 2048, same result.
GPU recognized and everything works except the audio.
I understand that my hardware is not dedicated. For example, if I used: A GPU and AmigaOS-compatible sound card, I wouldn't have any problems with pass-through across all the hardware.
But in my case, when everything is installed, I have 2 GPU, the integrated audio and the two HDMI outputs from the GPUs (Nvidia and R9 Radeon).
I'd just like to know which users have managed to use the GPU and audio with AmigaONE with QEMU.
NOTE: I'm wondering: Is it very difficult to make an -ac97 or -es1370 audio driver ?
so that only the GPU can pass through ?
Thanks.
Just as a day well spent brings a happy sleep, so a life well used brings a happy death.
I don't know what kind of problems you're having with QEmu/AmigaOS and audio.
What kind of exotic sound chip does your motherboard have, or what kind of motherboard is it?
For example, I have a Z170x gaming 7 with a SoundCore3d sound chip onboard with Ubuntu 25.04. LineOut works perfectly in QEmu and AmigaOS (AC97). SPDIF doesn't work!
I can't get the sound chip out of the IOMMU group, so I can't test the Soundcore chip directly under AmigaOS (if there is a suitable driver).
You could remove, for example: -device vfio-pci,host=01:00.1,bus=pci.0 since this is the sound of the graphics card. Outputting sound via the graphics card and HDMI will probably not be possible under AmigaOS. I highly doubt there are drivers for that.
Of course, you should make sure that there are also drivers for AmigaOS 4.1
Example (USB gamepad): -Microsoft Sidewinder Pro is recognized and appears to be working. Prefs/AmigaInput shows it. -Retroflag Classic USB gamepad: Not displayed or recognized in Prefs/AmigaInput.
Edited by Falke_34 on 2025/9/14 9:23:04 Edited by Falke_34 on 2025/9/14 9:27:54 Edited by Falke_34 on 2025/9/14 9:36:47 Edited by Falke_34 on 2025/9/14 9:38:15
The motherboard I'm using is: Asus Tuf Gaming Plus B550 and everything is recognized by Linux, including the audio chip.
There's only one problem I'm noticing now: I can clearly use two PCI GPUs.
The problem is that ACS is only recognized in the BIOS on the second PCI GPU slot. The main slot doesn't support ACS for the GPU.
Or is there a BIOS option to swap slots? that I'm not familiar with and I don't know what it might be.
I actually have to change the default AlsaMixer because it always points to the HDMI audio output, so I do:
Alsamixer -c1 and then manually configure the configuration file to use the integrated audio chipset.
But this only happens with QEMU, not with the Linux system I'm using.
So I think this is the problem with QEMU audio because it doesn't point to Alsamixer -c1.
I hope I made myself clear.
NOTE:
I'm creating a script based on Arch-Linux with only ALSA-AUDIO, without PIPEWIRE support already installed. This is to verify that the ISO I created has no audio issues.
I also report it here to keep track on the web:
#!/bin/bash # Script personalizzato per EndeavourOS / Arch Linux # Base + ALSA + NetworkManager + XFCE + Firefox + Xed
Qemu uses what you set in the host system. Audio example: If you set it to HDMI output in Linux, Qemu will also use that output – but you won't hear anything under AmigaOS because there are no drivers. SPDIF is the same! Lineout under Linux, and the sound also comes out of lineout in QEMU/AmigaOS.
What you're doing here with Alsaaudio etc. is beyond my knowledge.
For me, under Ubuntu - installed - I set the sound settings to lineout, and it works under both Linux and QEmu/AmigaOS.
Regarding graphics: If you have two full-fledged graphics cards in your computer, it's quite possible that you could use two graphics cards as a passthrough.
But that doesn't make much sense – since we only need the Radeon R9 (for example) – and if that only works in the first slot, then it can go there. I have 1x IGP from the i5 and in the 1st PCIe slot the Radeon graphics card
I don't know much about Linux myself, but if I had problems like yours, I would reinstall it once - without reinstalling anything, test the sound under Linux - it works -> great -> start Qemu and test it as well
if [ -n "$ENABLED_MSG" ]; then
echo "--- Kernel enable lines ---"
echo "$ENABLED_MSG"
echo
fi
if [ -n "$DISABLED_MSG" ]; then
echo "--- Kernel disable lines ---"
echo "$DISABLED_MSG"
echo
fi
# --- 5) Original: list only GPU-containing groups -------------------------
echo "=== GPU-Containing IOMMU Groups ==="
if [ ! -d "$GROUPS_DIR" ] || [ "$GROUP_COUNT" -eq 0 ]; then
echo "(no IOMMU groups found)"
else
declare -A GPU_COUNT_BY_GROUP=()
group_warnings=()
for g in "$GROUPS_DIR"/*; do
[ -d "$g" ] || continue
group_num=$(basename "$g")
gpu_found=false
device_lines=""
non_gpu_non_bridge=false
gpu_count_in_this_group=0
for d in "$g"/devices/*; do
[ -e "$d" ] || continue
pci_addr=$(basename "$d")
# -nns prints class code [XXXX] and vendor:device [vvvv:dddd]
line=$(lspci -nns "$pci_addr" 2>/dev/null || echo "$pci_addr (unlisted)")
device_lines+="$line"$'\n'
# Extract first [...] which is the class code, e.g. 0300, 0302, 0403, 0604, 0600
class_code=$(echo "$line" | awk -F'[][]' '{print $2}')
# Detect GPUs / 3D controllers and their HDA audio functions
if echo "$line" | grep -qE 'VGA compatible controller|3D controller'; then
gpu_found=true
gpu_count_in_this_group=$((gpu_count_in_this_group+1))
fi
if $gpu_found; then
echo "IOMMU Group $group_num:"
echo "$device_lines"
# Track GPUs per group
GPU_COUNT_BY_GROUP["$group_num"]=$gpu_count_in_this_group
# Warn if unexpected devices share the group with the GPU
if $non_gpu_non_bridge; then
group_warnings+=("WARN: Group $group_num contains non-GPU, non-audio, non-bridge devices (consider different slot/CPU root complex or ACS).")
fi
fi
done
# Post-checks
# 1) Each GPU should be alone (one GPU per group)
shared_groups=()
for gnum in "${!GPU_COUNT_BY_GROUP[@]}"; do
if [ "${GPU_COUNT_BY_GROUP[$gnum]}" -gt 1 ]; then
shared_groups+=("$gnum")
fi
done
if [ "${#shared_groups[@]}" -gt 0 ]; then
echo
echo "WARN: Multiple GPUs share these IOMMU groups: ${shared_groups[*]} (prefer one GPU per group for VFIO)."
fi
# 2) Any non-bridge co-residents?
if [ "${#group_warnings[@]}" -gt 0 ]; then
echo
printf "%s\n" "${group_warnings[@]}"
fi
fi
This script enters everything that is needed for IOMMU into the respective files setup_iommu_vfio.sh
#!/bin/bash
# Skript zur Aktivierung von IOMMU und Konfiguration von VFIO für PCI Passthrough
set -e # Bei Fehler abbrechen
# --- Schritt 1: GRUB anpassen ---
echo "Backup von /etc/default/grub wird erstellt..."
cp /etc/default/grub /etc/default/grub.bak
echo "Ändere GRUB_CMDLINE_LINUX_DEFAULT..."
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt"/' /etc/default/grub
echo "Backup von $VFIO_CONF_PATH (falls vorhanden)..."
if [ -f "$VFIO_CONF_PATH" ]; then
cp "$VFIO_CONF_PATH" "$VFIO_CONF_PATH.bak"
echo "Backup erstellt unter $VFIO_CONF_PATH.bak"
fi
echo "Erstelle neue vfio.conf mit gewünschten Optionen..."
Just a stupid question: why don’t you just use/try Ubuntu/Kubuntu/Xubuntu
"I just installed xfce+alsa-audio without pipewire." Isn't all of this already included in your Linux? Or why are you installing all of this separately?
Unfortunately, I don't quite understand your problem. It almost seems like you've messed something up.
As I wrote before -> Reinstall your Linux -> test the audio – it should work right away -> install QEmu and test the audio as well.
Which Linux are you using? Maybe I can test it myself.
@white I'm still not sure what you're trying to do but in case you want to use the HDMI audio part of the card you pass through that's not going to work. As long as you don't pass it through and have the host driver loaded you can use that output but to pass it through you have to unbind the host driver and assign vfio-pci driver to it so you can't use it from the host for audio output any more even if you don't pass it through to the guest. It would only work if the guest could drive it but AmigaOS does not have a driver for the audio function of the card so you can't use it for audio. You have to use another sound output on the host (either your motherboard's internal audio or another sound card). If you have another sound card that AmigaOS can use you can also pass that trhough with vfio and select that in AmigaOS. If you're using you motherboard's audio (which up to know everybody assumed you're trying to do) then make sure you get sound from that also when running programs with sudo then it should also work with QEMU.
@white Maybe because you're not asking questions that I can understand. What is CHANNEL 1? You can set the default device in /etc/asound.conf. I have there:
defaults.pcm.!card PCH
defaults.ctl.!card PCH
where you can list the available devices with aplay -l but I've already told you that before. Your distro may also have some way to set it but if you get audio from your host normally and it's not through the card you're trying to pass through it should just work the same way with pass through. It's not possible to get sound from the passed through card with AmigaOS. (It's also possible to select alsa devices on QEMU command line and documented at https://www.qemu.org/docs/master/system/invocation.html but I'm not trying to explain that. Set the default alsa device to the card you want to use and it should work. You can check what is the default device in alsa with aplay -L)
qemu-system-x86_64 -hda <disk-image.qcow2> -soundhw all -audio-device alsa -audiodev driver=alsa,id=snd0,out.buffer=8192,in.buffer=8192,out.channels=2,in.channels=1,device=hw:1,0
Option details:
-hda <disk-image.qcow2>: Specifies the virtual disk image (edit with your own path).
-soundhw all: Enables all virtual audio devices.
-audio-device alsa: Specifies the use of ALSA for audio.
-audiodev driver=alsa: Configures the audio driver to ALSA.
id=snd0: Assigns a unique ID to the audio.
out.buffer=8192,in.buffer=8192: Sets the input/output buffers for the audio.
out.channels=2,in.channels=1: Defines the number of channels (stereo output and mono input). --------------------------------------------------------------- THIS LINE:
device=hw:1,0: Selects the ALSA audio device (in this case, hw:1,0 represents the second sound card, corresponding to -c1 in alsamixer).
Thank you
NOTE: For example, I also have two USB audio sticks: which obviously correspond to alsamixer -c2 alsamixer -c3
I could use them with other virtual machines if I needed to without necessarily using the same sound card.
Think of them as virtual hard drives 0-1-2 etc.
Edited by white on 2025/9/14 19:05:49
Just as a day well spent brings a happy sleep, so a life well used brings a happy death.