Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
52 user(s) are online (39 user(s) are browsing Forums)

Members: 0
Guests: 52

more...

Support us!

Headlines

 
  Register To Post  

(1) 2 3 »
qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:15:22
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:15:44
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just popping in
Just popping in


See User information
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).


My QEmu Startfile:
sudo qemu-system-ppc -M amigaone -m 2048 -rtc base=localtime -accel tcg \
-bios /home/falke34/Schreibtisch/QEmu/AmigaOne/u-boot-amigaone.bin \
-vga none -display sdl \
-device rtl8139,netdev=net0 -netdev user,id=net0 \
-device vfio-pci,host=01:00.0,bus=pci.0,x-vga=on,multifunction=on \
-device vfio-pci,host=01:00.1,bus=pci.0 \
-device bochs-display \
-device usb-mouse \
-drive format=raw,file=/dev/sda \
-serial stdio

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.

You can passthrough for AmigaOS 4:
- Graphic cards (only GPU, not the Soundpart)
- Soundcards PCI/PCIe see here: https://www.amigans.net/modules/newbb/ ... id=156680#forumpost156680
- USB Mouse, Keyboard and Gamepad
- Network Cards PCI/PCIe?

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.

Here is a small compatibility List: https://www.acube-systems.biz/compatibility/compatibility_41.php


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
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:16:16
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just popping in
Just popping in


See User information
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.

Picture: https://www.directupload.eu/file/d/9042/gmgvjj6c_png.htm


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

My QEmu PPC Build Script (Ubuntu): https://github.com/Falke3434/Buildscri ... mu-Build-Script_Ubuntu.sh

This script (for Ubuntu) shows me if IOMMU etc is enabled and the GPU

Picture: https://www.directupload.eu/file/d/9042/ukuofdrd_png.htm

vfio-check.sh:
#!/bin/bash
# VFIO host sanity check: IOMMU support + GPU-containing groups

set -u  # don't use -e so greps that find nothing don't abort

# --- helpers ---------------------------------------------------------------
have() { command -"$1" >/dev/null 2>&1; }

read_klog() {
  if 
have journalctlthen journalctl --b 0 2>/dev/null
  
else dmesg 2>/dev/null
  fi
}

trim() { sed -'s/^[[:space:]]*//' -'s/[[:space:]]*$//'; }

# --- 1) CPU vendor + boot flags -------------------------------------------
CPU_VENDOR="$(
  (lscpu 2>/dev/null | awk -F: '/Vendor ID/{print $2}' | trim) ||
  (grep -m1 'vendor_id' /proc/cpuinfo 2>/dev/null | awk '{print $3}')
)"
[ -"${CPU_VENDOR}] && CPU_VENDOR="(unknown)"

CMDLINE="$(cat /proc/cmdline 2>/dev/null || echo '')"
HAS_INTEL_FLAG=$(echo "$CMDLINEgrep -'intel_iommu=on' && echo yes || echo no)
HAS_AMD_FLAG=$(echo "$CMDLINEgrep -'amd_iommu=on' && echo yes || echo no)
HAS_PT_FLAG=$(echo "$CMDLINEgrep -'iommu=pt' && echo yes || echo no)

# --- 2) Kernel log signals ------------------------------------------------
KLOG="$(read_klog)"

DISABLED_MSG=$(echo "$KLOGegrep -'IOMMU.*disabled by BIOS|DMAR:.*disabled|AMD-Vi:.*disabled' || true)
ENABLED_MSG=$(echo "$KLOGegrep -'DMAR: IOMMU enabled|AMD-Vi:.*IOMMU.*enabled|IOMMU: .*enabled' || true)
IR_MSG=$(echo "$KLOGegrep -'Interrupt remapping enabled' || true)

# --- 3) IOMMU groups presence --------------------------------------------
GROUPS_DIR="/sys/kernel/iommu_groups"
GROUP_COUNT=0
if [ -"$GROUPS_DIR]; then
  GROUP_COUNT
=$(find "$GROUPS_DIR-mindepth 1 -maxdepth 1 -type d 2>/dev/null wc -awk '{print $1}')
fi

# Heuristic: active if groups exist (>0). Logs help explain state.
IOMMU_ACTIVE="no"
"$GROUP_COUNT-gt 0 ] && IOMMU_ACTIVE="yes"

# --- 4) Report summary ----------------------------------------------------
echo "=== IOMMU Summary ==="
echo "CPU vendor           : $CPU_VENDOR"
echo "Kernel cmdline       : $CMDLINE"
echo "Boot flags           : intel_iommu=$HAS_INTEL_FLAG  amd_iommu=$HAS_AMD_FLAG  iommu=pt=$HAS_PT_FLAG"
echo "Groups directory     : $GROUPS_DIR  (exists: $([ -d "$GROUPS_DIR" ] && echo yes || echo no))"
echo "IOMMU group count    : $GROUP_COUNT"
echo "Kernel says enabled  : $([ -n "$ENABLED_MSG" ] && echo yes || echo no)"
echo "Interrupt remapping  : $([ -n "$IR_MSG" ] && echo yes || echo no)"
echo "Kernel says disabled : $([ -n "$DISABLED_MSG" ] && echo yes || echo no)"
echo "IOMMU ACTIVE?        : $IOMMU_ACTIVE"
echo

if [ -
"$ENABLED_MSG]; then
  
echo "--- Kernel enable lines ---"
  
echo "$ENABLED_MSG"
  
echo
fi
if [ -"$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 [ ! -"$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

      # Allowlist: 0300(VGA), 0302(3D), 0403(HDA audio), 0600(host bridge), 0604(PCI bridge)
      case "$class_code" in
        0300|0302|0403|0600|0604) : ;;
        *) non_gpu_non_bridge=true ;;
      esac
    done

    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 -'s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt"/' /etc/default/grub

echo "GRUB-Konfiguration aktualisiert."

# --- Schritt 2: vfio.conf erstellen ---
VFIO_CONF_PATH="/etc/modprobe.d/vfio.conf"

echo "Backup von $VFIO_CONF_PATH (falls vorhanden)..."
if [ -"$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..."

cat "$VFIO_CONF_PATH<<EOF
options vfio
-pci ids=1002:6810,1002:aab0
softdep drm pre
vfio-pci
softdep snd_hda_intel pre
vfio-pci
blacklist radeon
blacklist amdgpu
EOF

echo "vfio.conf wurde erstellt."

# --- Schritt 3: GRUB aktualisieren ---
echo "Aktualisiere GRUB..."
update-grub

# --- Schritt 4: initramfs aktualisieren ---
echo "Aktualisiere initramfs..."
update-initramfs -u

echo "✔ Alle Änderungen wurden durchgeführt."
echo "🔁 Bitte starte dein System neu, damit alles wirksam wird."


Edited by Falke_34 on 2025/9/14 10:59:21
Edited by Falke_34 on 2025/9/14 11:00:40
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:16:36
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just popping in
Just popping in


See User information
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.

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Quite a regular
Quite a regular


See User information
@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.

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:16:56
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Quite a regular
Quite a regular


See User information
@white
When compiling QEMU check the configure output. I have:
Audio backends
    OSS support                     
YES
    sndio support                   
NO
    ALSA support                    
YES 1.2.9
    PulseAudio support              
NO
    PipeWire support                
NO
    JACK support                    
YES 1.9.21

and the compiled executable
$ ./qemu-system-ppc -audio help
Available audio drivers
:
none
alsa
dbus
jack
oss
sdl
wav

Without any -audio options this defaults to alsa and works. You don't need jack support either, I just happen to have that too.

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/10/20 3:17:41
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Quite a regular
Quite a regular


See User information
@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)

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
.


Edited by white on 2025/9/14 19:05:49
Edited by white on 2025/10/20 3:17:20
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
these are my Audio Backends:

qemu-system-ppc -audiodev help

Available audio drivers:
none
alsa
jack
obs
pa
pipewire
sdl
spice
wav


currently this command makes me use SUDO:

SM501:

sudo --preserve-env = VGA,romfile=/home/white/Scaricati/Silicon/VGABIOS-lgpl-latest.bin -m 2048 -serial stdio -vga none -device sm501 -device rtl8139,netdev=mynet0 -netdev user,id=mynet0 -drive index=0,media=disk,format=raw,file=/home/white/Scaricati/Silicon/Update2-ONE-32gb.raw -device ac97

I have to test it with real GPU with SM501 it works


Edited by white on 2025/9/15 8:43:32
Edited by white on 2025/9/15 8:46:24
Edited by white on 2025/9/15 9:05:13
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
URRA !!!


AUDIO now works with the Radeon HD 7800 (R9) 280X GPU.


But I need to fix the network, it tends to crash.

But now I can do all the tests I need.

GPU and AUDIO -AC97 and -ES1370 with SUDO:

sudo --preserve-env qemu-system-ppc -M amigaone -m 2048 -bios /home/white/Scaricati/u-boot-amigaone.bin -serial stdio -drive media=disk,format=raw,file=/home/white/Scaricati/Radeon/1ONE-32gb.raw -netdev user,id=net -device rtl8139,netdev=net -vga none -device vfio-pci,host=07:00.0,bus=pci.0,x-vga=on,multifunction=on -device vfio-pci,host=07:00.1,bus=pci.0 -device bochs-display,romfile=""


Edited by white on 2025/9/15 12:28:26
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
@white

Quote:
white wrote:URRA !!!


AUDIO now works with the Radeon HD 7800 (R9) 280X GPU.




Congratulations 🎉

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
@Maijestro

Thanks, I backed up the Linux partition
And closed the PC cabinet.

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Quite a regular
Quite a regular


See User information
@white
Glad that you solved it finally. Apparently the sound server you're using needs some environment variables that were lost with sudo. As you see it has nothing to do with QEMU or AmigaOS but with your Linux host and pipewire/pulsaudio or whatever that uses.

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
Arch-Linux

I'm adding some notes that may be useful in the future.
This is the basics. Now I need to go back and look at the options more closely because I use two monitors and two GPUs.
So I need to change some settings. Then I'll see if I can do everything on the same monitor without using two.

sudo xed /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog nvme_load=YES nvidia_drm.modeset=1 loglevel=3 amd_iommu=on iommu=pt'

sudo xed /etc/modprobe.d/vfio.conf:

options vfio-pci ids=1002:6810,1002:aab0
softdep drm pre: vfio-pci
softdep snd_hda_intel pre: vfio-pci
blacklist radeon
blacklist amdgpu

sudo xed /etc/mkinitcpio.conf:

MODULES=(vfio_pci vfio vfio_iommu_type1)

Go to top
Re: qemu amigaos 4.1 sudo without no audio
Just can't stay away
Just can't stay away


See User information
@Balaton

Thanks, I reinstalled all the Pipewire audio backends, including

The difference is:
sudo --preserve-env qemu-system-ppc

You can also specify the specific audio to use with:
sudo --preserve-env


--preserve-env

Makes sudo preserve normal user environment variables, such as:

DISPLAY: useful for GUI

PATH: custom paths

QEMU_AUDIO_DRV, LD_LIBRARY_PATH, etc.

This is useful when QEMU needs custom environment variables to function properly (audio, graphics, network, etc.).

EXAMPLE:

export QEMU_AUDIO_DRV=alsa

If you then start QEMU with sudo, you'll lose the environment variables, unless you use:
sudo --preserve-env=QEMU_AUDIO_DRV qemu-system-ppc

This way, sudo keeps QEMU_AUDIO_DRV=alsa even in the root context.

by ChatGPT

But you need to know how to communicate with it, otherwise it won't help you

Go to top

  Register To Post
(1) 2 3 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1
Pegasos2
X5000
X1000
A1222
Sam 440/460
Classic PowerPC Amiga
WinUAE emulation
Qemu emulation
Total Votes: 198
The poll will close at 2025/12/1 12:00
4 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project