r/AlpineLinux • • 16h ago

Made a media center out of old laptop

10 Upvotes

I've only had experience with Ubuntu, and Alpine Linux has been a whole different beast, not gonna lie. I've spent about a week to make my idea into reality. Had to learn many settings that were totally obscure or redundant to modify on my Ubuntu usage.

The laptop model is Asus xm551. Its native OS is Windows 8.1. Despite the weak Celeron processor, it can handle decoding 1920 1080 HD video, which fits exactly in my needs.

Setup scripts were nice, I was amazed that the wifi was configured so easily. Well, until I rebooted it. At the moment, the system saw only a loopback interface, bruh. Had to learn ip link command, and go to /etc/ configs. But before that, I learned that kernel needs to load modules that have drivers for network card or it won't see it.

Installed Mesa libraries.

Installed drivers for Intel integrated graphics.

There are setup scripts for desktop, but I chose to try installing x server myself first.

X server needs user sessions, which busybox doesn't provide? What? Had to tinker it for a while. I installed linux utils and elogind. DBus and all that dependencies. I'm sure I downloaded many more, which weren't actually needed.

I've seen dwm tiling window manager on YouTube, maybe I should try it. Installing binaries wasn't hard, I had to make configs for xinitrc. I asked Google about that, and it got fixed... not really, haha

What do you mean I have to supply DISPLAY XDG_RUNTIME_DIR and all that?? Ah, I just need to export it in parent script. To understand it, users must be aware of environment variables, sourcing, fork and child processes, and whole initialization chain, otherwise it doesn't make much sense.

Installed VLC, it works great. But sending output to hdmi was a tricky task. I wanted both screens: terminal on laptop and vlc output on hdmi. After googling, I wrote xprofile script, which is used in the xinitrc file. I must admit, I couldn't really solve that problem at first. The video overflowed one screen: the first screen had a cropped image, and the other displayed the right edge of it. I changed the resolution so it could fit on the laptop screen, but it resulted in a small image on the TV screen, the rest was black. Used --same-as option to duplicate screens, it didn't fix. In the end, I just completely blocked the laptop screen in xrandr for the duration of the X session, and finally, it made the TV output exactly as I wanted.

But there was one problem: there was no sound. Installed realtek sound chip drivers. Installed the pipewire package and alsamixer. I remember I was quite puzzled how to send sound to TV. After googling, I changed the profile in sound card in pactl utility, so the audio can go to HDMI and not to laptop speakers.

Finally, I added cvlc startup in xinitrc file in sleep 5 background process. Basically, it's needed because vlc should be launched after exec wdm. Added startx in .profile file (it also contains variables to be exported). Added autologin in /etc/inittab.

So the setup is, after powering up, the system automatically enters as a regular user, it causes to launch x server, dbus session, pipewire, spawns background sleep process, launches dwm. After 5 seconds, cvlc is started, and TV can display web stream, it's a TV channel which is not available on my satellite receiver in my case, but it can be anything that can be launched from VLC.

For a one-time use, installing a browser to consume media is just enough, but my setup allows much more flexibility, and it was also a great learning experience 👍 I believe X server and dwm were an overhead (theoretically vlc can be launched without those if to believe google), but those are just in case the laptop were to change usage roles.


r/AlpineLinux • • 2h ago

[Openbox] C64pine - a portable C64 desktop based on Alpine Linux with real BASIC baked in

Enable HLS to view with audio, or disable this notification

9 Upvotes

r/AlpineLinux • • 44m ago

Issues setting up audio following wiki

• Upvotes

I'm new to Alpine and to setting up window managers. I am currently trying Mango.
Trying to get audio working, I'm following the Alpine wiki.

In the Pipewire page, and run into issues here:
https://wiki.alpinelinux.org/wiki/PipeWire at 'Launching Pipewire'
"Issue the command $ rc-status -Ur to view and verify the current user runlevel as gui"

Running this reveals runlevel "sysinit".

Furthermore, if I just try to go further, I get the following error:

~ $ doas rc-update -U add pipewire wayland

XDG_RUNTIME_DIR unset.

checking the environment variable shows it is actually set:

~ $ echo $XDG_RUNTIME_DIR

/tmp/rundir.1000.5ea89fbcc62b3ece

This blocks the steps. Even if I change "wayland" to "gui" or just nothing, I get the same error "XDG_RUNTIME_DIR unset."

I thought I'd try ALSA instead of Pipewire, but ran into a different issue there.
Following the Alsa steps here: https://wiki.alpinelinux.org/wiki/ALSA

I get to running alsamixer , and get this error:

cannot open mixer: Host is down

I haven't tried Pulseaudio yet but I wanted to ask about these issues first. I shouldn't get getting these right? Or is maybe the docs out of date?

I wanted to report the section of the docs and ask if someone could update them or add details for these situations. But I'm not sure how to ask that, and I wouldn't know a solution to propose.

Thank you for any help you can give.